PartitionConfig.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Converters;
  3. using System.Collections.Generic;
  4. namespace DaJiaoYan.Models
  5. {
  6. public class PartitionConfig
  7. {
  8. /// <summary>
  9. /// 选项相关
  10. /// {"height":38,"optionCount":"4","options":"A,B,C,D","width":282,"x":149,"y":458}
  11. /// </summary>
  12. public class TopicRect
  13. {
  14. public int X { get; set; }
  15. public int Y { get; set; }
  16. public int Width { get; set; }
  17. public int Height { get; set; }
  18. public int OptionCount { get; set; }
  19. /// <summary>
  20. /// 选项
  21. /// </summary>
  22. public string Options { get; set; }
  23. /// <summary>
  24. /// 选项列表,将Options 切分
  25. /// </summary>
  26. public List<string> OptionList { get; set; }
  27. }
  28. public class OptionRect
  29. {
  30. public int X { get; set; }
  31. public int Y { get; set; }
  32. public int Width { get; set; }
  33. public int Height { get; set; }
  34. public string OptionValue { get; set; }
  35. /// <summary>
  36. /// 该选项的点数量(需要预先载入模版统计点的数量)
  37. /// </summary>
  38. public int Points { get; set; }
  39. /// <summary>
  40. /// 题号?
  41. /// </summary>
  42. public string Key { get; set; }
  43. /// <summary>
  44. /// 选项的顺序
  45. /// </summary>
  46. public int Index { get; set; }
  47. /// <summary>
  48. /// 选项的内容
  49. /// </summary>
  50. public string Option { get; set; }
  51. /// <summary>
  52. /// 填涂的百分比
  53. /// </summary>
  54. public double PaintThreshold
  55. {
  56. get; set;
  57. }
  58. }
  59. public class PartitionAuthority
  60. {
  61. public bool Divide { get; set; }
  62. [JsonProperty(PropertyName = "upload_student")]
  63. public bool UploadStudent { get; set; }
  64. }
  65. public class DivideConfig
  66. {
  67. /// <summary>
  68. /// 小空划分信息
  69. /// </summary>
  70. [JsonProperty(PropertyName = "choose_rects")]
  71. public List<TestOptionConfig> EmptyRects { get; set; }
  72. [JsonProperty(PropertyName = "correct_type"), JsonConverter(typeof(StringEnumConverter))]
  73. public Enumerates.QuestionType? CorrectType { get; set; }
  74. [JsonProperty(PropertyName = "end_index")]
  75. public int EndIndex { get; set; }
  76. [JsonProperty(PropertyName = "start_index")]
  77. public int StartIndex { get; set; }
  78. [JsonProperty(PropertyName = "pager_type")]
  79. public string PaperType { get; set; }
  80. [JsonProperty(PropertyName = "option_type")]
  81. public string OptionType { get; set; }
  82. /// <summary>
  83. /// 选项划分信息
  84. /// </summary>
  85. [JsonProperty(PropertyName = "option_rects")]
  86. public List<OptionRect> OptionRects { get; set; }
  87. [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
  88. public Rect Rect { get; set; }
  89. [JsonProperty(PropertyName = "score_rects")]
  90. public List<Models.ScoreRect> ScoreRects { get; set; }
  91. [JsonProperty(PropertyName = "topic_rects")]
  92. public Dictionary<string, TopicRect> TopicRects { get; set; }
  93. [JsonProperty(PropertyName = "rect_divide", NullValueHandling = NullValueHandling.Ignore)]
  94. public Dictionary<string, RectDivide> RectDivides { get; set; }
  95. }
  96. public class RectDivide
  97. {
  98. [JsonProperty(PropertyName = "rect")]
  99. public List<Rect> Rect { get; set; }
  100. [JsonProperty(PropertyName = "type")]
  101. public int Type { get; set; }
  102. [JsonProperty(PropertyName = "type_tips")]
  103. public string TypeTips { get; set; }
  104. [JsonProperty(PropertyName = "name")]
  105. public string Name { get; set; }
  106. [JsonProperty(PropertyName = "order")]
  107. public int Order { get; set; }
  108. [JsonProperty(PropertyName = "option_rect")]
  109. public Dictionary<string, RectDivide> OptionRect { get; set; }
  110. [JsonProperty(PropertyName = "index")]
  111. public int Index { get; set; }
  112. [JsonProperty(PropertyName = "children")]
  113. public Dictionary<string, RectDivide> Children { get; set; }
  114. }
  115. public string Id { get; set; }
  116. public string Name { get; set; }
  117. [JsonProperty(PropertyName = "correct_type")]
  118. public Enumerates.QuestionType CorrectType { get; set; }
  119. [JsonProperty(PropertyName = "show_order")]
  120. public int ShowOrder { get; set; }
  121. [JsonProperty(PropertyName = "partition_score")]
  122. public float PartitionScore { get; set; }
  123. public DivideConfig Config { get; set; }
  124. [JsonProperty(PropertyName = "empty_count")]
  125. public int EmptyCount { get; set; }
  126. [JsonProperty(PropertyName = "option_count")]
  127. public int OptionCount { get; set; }
  128. [JsonProperty(PropertyName = "question_config")]
  129. public List<QuestionConfig> QuestionConfigs { get; set; }
  130. public PartitionAuthority Authority { get; set; }
  131. }
  132. }