exam.php 7.6 KB

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