exam.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. 3 => '答错之后停止答题,并且无法重新开始',
  14. );
  15. $cate = function()
  16. {
  17. $array = array();
  18. $cate = Dever::load('question/cate-state');
  19. if($cate)
  20. {
  21. $array += $cate;
  22. }
  23. return $array;
  24. };
  25. $continue_num_type = array
  26. (
  27. 1 => '自然日,每天凌晨自动恢复',
  28. 2 => '按照小时间隔',
  29. 3 => '按照天间隔',
  30. );
  31. $continue_num_user = array
  32. (
  33. 1 => '对用户所有答题有效',
  34. 2 => '对用户本次答题有效',
  35. );
  36. return array
  37. (
  38. # 表名
  39. 'name' => 'exam',
  40. # 显示给用户看的名称
  41. 'lang' => '测试规则设置',
  42. # 是否显示在后台菜单
  43. 'order' => 200,
  44. # 数据结构
  45. 'struct' => array
  46. (
  47. 'id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => 'ID',
  51. 'default' => '',
  52. 'desc' => '',
  53. 'match' => 'is_numeric',
  54. 'order' => 'desc',
  55. 'list' => true,
  56. ),
  57. 'hr1' => array
  58. (
  59. 'name' => '基本信息',
  60. 'class' => '',//本项必须填写
  61. 'attr' => '',
  62. ),
  63. 'name' => array
  64. (
  65. 'type' => 'varchar-150',
  66. 'name' => '标题',
  67. 'default' => '',
  68. 'desc' => '标题',
  69. 'match' => 'is_string',
  70. 'update' => 'text',
  71. 'search' => 'fulltext',
  72. 'list' => true,
  73. ),
  74. 'desc' => array
  75. (
  76. 'type' => 'varchar-500',
  77. 'name' => '描述',
  78. 'default' => '',
  79. 'desc' => '描述',
  80. 'match' => 'option',
  81. 'update' => 'textarea',
  82. 'search' => 'fulltext',
  83. //'list' => true,
  84. ),
  85. 'pic' => array
  86. (
  87. 'type' => 'varchar-150',
  88. 'name' => '规则介绍图',
  89. 'default' => '',
  90. 'desc' => '规则介绍图',
  91. 'match' => 'option',
  92. 'update' => 'image',
  93. 'key' => '1',
  94. 'place' => '150',
  95. ),
  96. 'hr2' => array
  97. (
  98. 'name' => '题目抽取规则',
  99. 'class' => '',//本项必须填写
  100. 'attr' => '',
  101. ),
  102. 'num' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '题目数量',
  106. 'default' => '10',
  107. 'desc' => '题目数量',
  108. 'match' => 'is_string',
  109. 'update' => 'text',
  110. ),
  111. 'cate_id' => array
  112. (
  113. 'type' => 'varchar-150',
  114. 'name' => '抽取题目所属分类',
  115. 'default' => '',
  116. 'desc' => '请选择分类',
  117. 'match' => 'is_string',
  118. 'update' => 'checkbox',
  119. 'option' => $cate,
  120. //'search_parent' => 'info_id',//根据哪个字段来确定本搜索选项的内容
  121. 'list' => '{cate_id} > 0 ? Dever::load("question/cate-one#name", {cate_id}) : "未知"',
  122. ),
  123. 'type' => array
  124. (
  125. 'type' => 'tinyint-1',
  126. 'name' => '题目抽取方式',
  127. 'default' => '2',
  128. 'desc' => '题目抽取方式',
  129. 'match' => 'is_numeric',
  130. 'update' => 'radio',
  131. 'option' => $type,
  132. 'control' => 'type',
  133. ),
  134. 'level_ids' => array
  135. (
  136. 'type' => 'varchar-300',
  137. 'name' => '难度数量设置-多个用换行隔开,如1,3 换行 3,4,则难度id为1的选出3个,难度id为3的选出4个,以此类推,总数量以题目数量为准,请准确输入',
  138. 'default' => '',
  139. 'desc' => '描述',
  140. 'match' => 'is_string',
  141. 'update' => 'textarea',
  142. 'search' => 'fulltext',
  143. //'list' => true,
  144. 'show' => 'type=4',
  145. ),
  146. 'info_ids' => array
  147. (
  148. 'type' => 'varchar-300',
  149. 'name' => '题库ID列表-多个请用换行',
  150. 'default' => '',
  151. 'desc' => '题库ID列表',
  152. 'match' => 'option',
  153. 'update' => 'textarea',
  154. //'list' => true,
  155. 'show' => 'type=3',
  156. ),
  157. 'hr3' => array
  158. (
  159. 'name' => '答题复活规则',
  160. 'class' => '',//本项必须填写
  161. 'attr' => '',
  162. ),
  163. 'continue' => array
  164. (
  165. 'type' => 'tinyint-1',
  166. 'name' => '持续答题规则',
  167. 'default' => '2',
  168. 'desc' => '持续答题规则',
  169. 'match' => 'is_numeric',
  170. 'update' => 'radio',
  171. 'option' => $continue,
  172. 'control' => 'continue',
  173. ),
  174. 'continue_times' => array
  175. (
  176. 'type' => 'int-11',
  177. 'name' => '超时时间-请直接输入秒数,由于网络消耗,可以设置为前端时间的2倍',
  178. 'default' => '20',
  179. 'desc' => '超时时间',
  180. 'match' => 'is_numeric',
  181. 'update' => 'text',
  182. 'show' => array('continue=2', 'continue=3'),
  183. ),
  184. 'continue_num' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '答错复活次数',
  188. 'default' => '3',
  189. 'desc' => '答错复活次数',
  190. 'match' => 'is_numeric',
  191. 'update' => 'text',
  192. 'show' => array('continue=2', 'continue=3'),
  193. ),
  194. 'continue_num_type' => array
  195. (
  196. 'type' => 'tinyint-1',
  197. 'name' => '答题复活时间间隔',
  198. 'default' => '1',
  199. 'desc' => '答题复活时间间隔',
  200. 'match' => 'is_numeric',
  201. 'update' => 'radio',
  202. 'option' => $continue_num_type,
  203. 'show' => array('continue=2', 'continue=3'),
  204. 'control' => 'continue_num_type',
  205. ),
  206. 'continue_num_type_times' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '答题复活时间间隔时间-如选择按照小时间隔则为24小时',
  210. 'default' => '24',
  211. 'desc' => '答题复活时间间隔时间',
  212. 'match' => 'is_numeric',
  213. 'update' => 'text',
  214. 'show' => array('continue_num_type=2', 'continue_num_type=3'),
  215. ),
  216. 'continue_num_user' => array
  217. (
  218. 'type' => 'tinyint-1',
  219. 'name' => '答题复活有效规则',
  220. 'default' => '1',
  221. 'desc' => '答题复活有效规则',
  222. 'match' => 'is_numeric',
  223. 'update' => 'radio',
  224. 'option' => $continue_num_user,
  225. 'show' => array('continue=2', 'continue=3'),
  226. ),
  227. 'hr4' => array
  228. (
  229. 'name' => '结果规则',
  230. 'class' => '',//本项必须填写
  231. 'attr' => '',
  232. ),
  233. 'content' => array
  234. (
  235. 'type' => 'text-1000',
  236. 'name' => '结果设置',
  237. 'default' => '',
  238. 'desc' => '结果设置',
  239. 'match' => 'is_string',
  240. 'update' => array
  241. (
  242. array
  243. (
  244. 'col' => 'score',
  245. 'name' => '结果分数-答对题目的总分数,区间用~隔开,如20~40,代表大于等于20小于等于40',
  246. 'default' => '0',
  247. 'desc' => '选项分数',
  248. 'match' => 'is_string',
  249. 'update' => 'text',
  250. ),
  251. array
  252. (
  253. 'col' => 'title',
  254. 'name' => '结果标题',
  255. 'default' => '',
  256. 'desc' => '结果标题',
  257. 'match' => 'is_string',
  258. 'update' => 'text',
  259. ),
  260. array
  261. (
  262. 'col' => 'pic',
  263. 'name' => '结果图片',
  264. 'default' => '',
  265. 'desc' => '结果图片',
  266. 'match' => 'is_string',
  267. 'update' => 'image',
  268. 'key' => 'Eself999',
  269. ),
  270. array
  271. (
  272. 'col' => 'info',
  273. 'name' => '结果描述',
  274. 'default' => '',
  275. 'desc' => '结果描述',
  276. 'match' => 'is_string',
  277. 'update' => 'editor',
  278. ),
  279. ),
  280. ),
  281. 'state' => array
  282. (
  283. 'type' => 'tinyint-1',
  284. 'name' => '状态',
  285. 'default' => '1',
  286. 'desc' => '请选择状态',
  287. 'match' => 'is_numeric',
  288. ),
  289. 'cdate' => array
  290. (
  291. 'type' => 'int-11',
  292. 'name' => '录入时间',
  293. 'match' => array('is_numeric', time()),
  294. 'desc' => '',
  295. # 只有insert时才生效
  296. 'insert' => true,
  297. 'search' => 'date',
  298. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  299. ),
  300. ),
  301. 'manage' => array
  302. (
  303. ),
  304. );