exam.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. $type = array
  3. (
  4. 1 => '开始答题时随机抽取',
  5. 2 => '每次答题时随机抽取',
  6. 3 => '指定题目ID',
  7. 4 => '按照难度随机抽取',
  8. );
  9. $continue = array
  10. (
  11. 1 => '答错之后继续答题',
  12. 2 => '答错之后停止答题',
  13. );
  14. $cate = function()
  15. {
  16. $array = array();
  17. $cate = Dever::load('question/cate-state');
  18. if($cate)
  19. {
  20. $array += $cate;
  21. }
  22. return $array;
  23. };
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'exam',
  28. # 显示给用户看的名称
  29. 'lang' => '测试规则设置',
  30. # 是否显示在后台菜单
  31. 'order' => 200,
  32. # 数据结构
  33. 'struct' => array
  34. (
  35. 'id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => 'ID',
  39. 'default' => '',
  40. 'desc' => '',
  41. 'match' => 'is_numeric',
  42. 'order' => 'desc',
  43. 'list' => true,
  44. ),
  45. 'name' => array
  46. (
  47. 'type' => 'varchar-150',
  48. 'name' => '标题',
  49. 'default' => '',
  50. 'desc' => '标题',
  51. 'match' => 'is_string',
  52. 'update' => 'text',
  53. 'search' => 'fulltext',
  54. 'list' => true,
  55. ),
  56. 'desc' => array
  57. (
  58. 'type' => 'varchar-500',
  59. 'name' => '描述',
  60. 'default' => '',
  61. 'desc' => '描述',
  62. 'match' => 'is_string',
  63. 'update' => 'textarea',
  64. 'search' => 'fulltext',
  65. //'list' => true,
  66. ),
  67. 'pic' => array
  68. (
  69. 'type' => 'varchar-150',
  70. 'name' => '测试图',
  71. 'default' => '',
  72. 'desc' => '测试图',
  73. 'match' => 'option',
  74. 'update' => 'image',
  75. 'key' => '1',
  76. 'place' => '150',
  77. ),
  78. 'cate_id' => array
  79. (
  80. 'type' => 'varchar-150',
  81. 'name' => '分类',
  82. 'default' => '',
  83. 'desc' => '请选择分类',
  84. 'match' => 'is_string',
  85. 'update' => 'checkbox',
  86. 'option' => $cate,
  87. //'search_parent' => 'info_id',//根据哪个字段来确定本搜索选项的内容
  88. 'list' => '{cate_id} > 0 ? Dever::load("question/cate-one#name", {cate_id}) : "未知"',
  89. ),
  90. 'type' => array
  91. (
  92. 'type' => 'tinyint-1',
  93. 'name' => '题目抽取方式',
  94. 'default' => '2',
  95. 'desc' => '题目抽取方式',
  96. 'match' => 'is_numeric',
  97. 'update' => 'radio',
  98. 'option' => $type,
  99. 'control' => 'type',
  100. ),
  101. 'level_ids' => array
  102. (
  103. 'type' => 'varchar-300',
  104. 'name' => '难度数量设置-多个用半角逗号隔开,如3,3,4,则简单选出3个,普通选出3个,困难选出4个,以此类推',
  105. 'default' => '',
  106. 'desc' => '描述',
  107. 'match' => 'is_string',
  108. 'update' => 'textarea',
  109. 'search' => 'fulltext',
  110. //'list' => true,
  111. 'show' => 'type=4',
  112. ),
  113. 'info_ids' => array
  114. (
  115. 'type' => 'varchar-300',
  116. 'name' => '题库ID列表-多个请用换行',
  117. 'default' => '',
  118. 'desc' => '题库ID列表',
  119. 'match' => 'option',
  120. 'update' => 'textarea',
  121. //'list' => true,
  122. 'show' => 'type=3',
  123. ),
  124. 'continue' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '持续答题规则',
  128. 'default' => '2',
  129. 'desc' => '持续答题规则',
  130. 'match' => 'is_numeric',
  131. 'update' => 'radio',
  132. 'option' => $continue,
  133. ),
  134. 'num' => array
  135. (
  136. 'type' => 'int-11',
  137. 'name' => '题目数量',
  138. 'default' => '10',
  139. 'desc' => '题目数量',
  140. 'match' => 'is_string',
  141. 'update' => 'text',
  142. ),
  143. 'content' => array
  144. (
  145. 'type' => 'text-1000',
  146. 'name' => '结果设置',
  147. 'default' => '',
  148. 'desc' => '结果设置',
  149. 'match' => 'is_string',
  150. 'update' => array
  151. (
  152. array
  153. (
  154. 'col' => 'score',
  155. 'name' => '结果分数-答对题目的总分数,区间用~隔开,如20~40,代表大于等于20小于等于40',
  156. 'default' => '0',
  157. 'desc' => '选项分数',
  158. 'match' => 'is_string',
  159. 'update' => 'text',
  160. ),
  161. array
  162. (
  163. 'col' => 'title',
  164. 'name' => '结果标题',
  165. 'default' => '',
  166. 'desc' => '结果标题',
  167. 'match' => 'is_string',
  168. 'update' => 'text',
  169. ),
  170. array
  171. (
  172. 'col' => 'pic',
  173. 'name' => '结果图片',
  174. 'default' => '',
  175. 'desc' => '结果图片',
  176. 'match' => 'is_string',
  177. 'update' => 'image',
  178. 'key' => 'Eself999',
  179. ),
  180. array
  181. (
  182. 'col' => 'info',
  183. 'name' => '结果描述',
  184. 'default' => '',
  185. 'desc' => '结果描述',
  186. 'match' => 'is_string',
  187. 'update' => 'editor',
  188. ),
  189. ),
  190. ),
  191. 'state' => array
  192. (
  193. 'type' => 'tinyint-1',
  194. 'name' => '状态',
  195. 'default' => '1',
  196. 'desc' => '请选择状态',
  197. 'match' => 'is_numeric',
  198. ),
  199. 'cdate' => array
  200. (
  201. 'type' => 'int-11',
  202. 'name' => '录入时间',
  203. 'match' => array('is_numeric', time()),
  204. 'desc' => '',
  205. # 只有insert时才生效
  206. 'insert' => true,
  207. 'search' => 'date',
  208. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  209. ),
  210. ),
  211. 'manage' => array
  212. (
  213. ),
  214. );