Exam.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <?php
  2. namespace addons\exam;
  3. use app\common\library\Menu;
  4. use think\Addons;
  5. /**
  6. * 插件
  7. */
  8. class Exam extends Addons
  9. {
  10. protected $menu
  11. = [
  12. [
  13. "name" => "exam",
  14. "title" => "考试系统",
  15. "icon" => "fa fa-columns",
  16. "sublist" => [
  17. [
  18. "name" => "exam/config_info",
  19. "title" => "参数配置",
  20. "icon" => "fa fa-cogs",
  21. "sublist" => [
  22. [
  23. "name" => "exam/config_info/index",
  24. "title" => "查看"
  25. ],
  26. [
  27. "name" => "exam/config_info/add",
  28. "title" => "添加"
  29. ],
  30. [
  31. "name" => "exam/config_info/edit",
  32. "title" => "编辑"
  33. ],
  34. [
  35. "name" => "exam/config_info/del",
  36. "title" => "删除"
  37. ],
  38. [
  39. "name" => "exam/config_info/multi",
  40. "title" => "批量更新"
  41. ]
  42. ]
  43. ],
  44. [
  45. "name" => "exam/grade",
  46. "title" => "考卷成绩",
  47. "icon" => "fa fa-list",
  48. "sublist" => [
  49. [
  50. "name" => "exam/grade/index",
  51. "title" => "查看"
  52. ],
  53. [
  54. "name" => "exam/grade/add",
  55. "title" => "添加"
  56. ],
  57. [
  58. "name" => "exam/grade/edit",
  59. "title" => "编辑"
  60. ],
  61. [
  62. "name" => "exam/grade/del",
  63. "title" => "删除"
  64. ],
  65. [
  66. "name" => "exam/grade/multi",
  67. "title" => "批量更新"
  68. ],
  69. [
  70. "name" => "exam/grade/detail",
  71. "title" => "详情"
  72. ],
  73. ]
  74. ],
  75. [
  76. "name" => "exam/paper",
  77. "title" => "试卷管理",
  78. "icon" => "fa fa-newspaper-o",
  79. "sublist" => [
  80. [
  81. "name" => "exam/paper/index",
  82. "title" => "查看"
  83. ],
  84. [
  85. "name" => "exam/paper/add",
  86. "title" => "添加"
  87. ],
  88. [
  89. "name" => "exam/paper/edit",
  90. "title" => "编辑"
  91. ],
  92. [
  93. "name" => "exam/paper/del",
  94. "title" => "删除"
  95. ],
  96. [
  97. "name" => "exam/paper/multi",
  98. "title" => "批量更新"
  99. ],
  100. [
  101. "name" => "exam/paper/recyclebin",
  102. "title" => "回收站"
  103. ],
  104. [
  105. "name" => "exam/paper/destroy",
  106. "title" => "真实删除"
  107. ],
  108. [
  109. "name" => "exam/paper/restore",
  110. "title" => "还原"
  111. ],
  112. ]
  113. ],
  114. [
  115. "name" => "exam/question",
  116. "title" => "试题管理",
  117. "icon" => "fa fa-question-circle-o",
  118. "sublist" => [
  119. [
  120. "name" => "exam/question/index",
  121. "title" => "查看"
  122. ],
  123. [
  124. "name" => "exam/question/add",
  125. "title" => "添加"
  126. ],
  127. [
  128. "name" => "exam/question/edit",
  129. "title" => "编辑"
  130. ],
  131. [
  132. "name" => "exam/question/del",
  133. "title" => "删除"
  134. ],
  135. [
  136. "name" => "exam/question/multi",
  137. "title" => "批量更新"
  138. ],
  139. [
  140. "name" => "exam/question/recyclebin",
  141. "title" => "回收站"
  142. ],
  143. [
  144. "name" => "exam/question/destroy",
  145. "title" => "真实删除"
  146. ],
  147. [
  148. "name" => "exam/question/restore",
  149. "title" => "还原"
  150. ],
  151. [
  152. "name" => "exam/question/import",
  153. "title" => "导入"
  154. ],
  155. ]
  156. ],
  157. [
  158. "name" => "exam/cate",
  159. "title" => "分类管理",
  160. "icon" => "fa fa-align-left",
  161. "sublist" => [
  162. [
  163. "name" => "exam/cate/import",
  164. "title" => "Import"
  165. ],
  166. [
  167. "name" => "exam/cate/index",
  168. "title" => "查看"
  169. ],
  170. [
  171. "name" => "exam/cate/add",
  172. "title" => "添加"
  173. ],
  174. [
  175. "name" => "exam/cate/edit",
  176. "title" => "编辑"
  177. ],
  178. [
  179. "name" => "exam/cate/del",
  180. "title" => "删除"
  181. ],
  182. [
  183. "name" => "exam/cate/multi",
  184. "title" => "批量更新"
  185. ],
  186. [
  187. "name" => "exam/cate/recyclebin",
  188. "title" => "回收站"
  189. ],
  190. [
  191. "name" => "exam/cate/destroy",
  192. "title" => "真实删除"
  193. ],
  194. [
  195. "name" => "exam/cate/restore",
  196. "title" => "还原"
  197. ],
  198. ]
  199. ],
  200. [
  201. "name" => "exam/notice",
  202. "title" => "系统公告",
  203. "icon" => "fa fa-volume-up",
  204. "sublist" => [
  205. [
  206. "name" => "exam/notice/index",
  207. "title" => "查看"
  208. ],
  209. [
  210. "name" => "exam/notice/add",
  211. "title" => "添加"
  212. ],
  213. [
  214. "name" => "exam/notice/edit",
  215. "title" => "编辑"
  216. ],
  217. [
  218. "name" => "exam/notice/del",
  219. "title" => "删除"
  220. ],
  221. [
  222. "name" => "exam/notice/multi",
  223. "title" => "批量更新"
  224. ]
  225. ]
  226. ],
  227. [
  228. "name" => "exam/roommanage",
  229. "title" => "考场功能",
  230. "icon" => "fa fa-home",
  231. "sublist" => [
  232. [
  233. "name" => "exam/room",
  234. "title" => "考场管理",
  235. "icon" => "fa fa-home",
  236. "sublist" => [
  237. [
  238. "name" => "exam/room/index",
  239. "title" => "查看"
  240. ],
  241. [
  242. "name" => "exam/room/add",
  243. "title" => "添加"
  244. ],
  245. [
  246. "name" => "exam/room/edit",
  247. "title" => "编辑"
  248. ],
  249. [
  250. "name" => "exam/room/del",
  251. "title" => "删除"
  252. ],
  253. [
  254. "name" => "exam/room/multi",
  255. "title" => "批量更新"
  256. ],
  257. [
  258. "name" => "exam/room/recyclebin",
  259. "title" => "回收站"
  260. ],
  261. [
  262. "name" => "exam/room/destroy",
  263. "title" => "真实删除"
  264. ],
  265. [
  266. "name" => "exam/room/restore",
  267. "title" => "还原"
  268. ]
  269. ]
  270. ],
  271. [
  272. "name" => "exam/room_signup",
  273. "title" => "考场报名",
  274. "icon" => "fa fa-pencil",
  275. "sublist" => [
  276. [
  277. "name" => "exam/room_signup/index",
  278. "title" => "查看"
  279. ],
  280. [
  281. "name" => "exam/room_signup/add",
  282. "title" => "添加"
  283. ],
  284. [
  285. "name" => "exam/room_signup/edit",
  286. "title" => "编辑"
  287. ],
  288. [
  289. "name" => "exam/room_signup/del",
  290. "title" => "删除"
  291. ],
  292. [
  293. "name" => "exam/room_signup/multi",
  294. "title" => "批量更新"
  295. ]
  296. ]
  297. ],
  298. [
  299. "name" => "exam/room_grade",
  300. "title" => "考场考试成绩",
  301. "icon" => "fa fa-list-ol",
  302. "sublist" => [
  303. [
  304. "name" => "exam/room_grade/index",
  305. "title" => "查看"
  306. ],
  307. [
  308. "name" => "exam/room_grade/add",
  309. "title" => "添加"
  310. ],
  311. [
  312. "name" => "exam/room_grade/edit",
  313. "title" => "编辑"
  314. ],
  315. [
  316. "name" => "exam/room_grade/del",
  317. "title" => "删除"
  318. ],
  319. [
  320. "name" => "exam/room_grade/multi",
  321. "title" => "批量更新"
  322. ],
  323. [
  324. "name" => "exam/room_grade/detail",
  325. "title" => "详情"
  326. ],
  327. ]
  328. ]
  329. ]
  330. ],
  331. [
  332. "name" => "exam/correction",
  333. "title" => "纠错反馈",
  334. "icon" => "fa fa-wpforms",
  335. "sublist" => [
  336. [
  337. "name" => "exam/correction_type",
  338. "title" => "纠错反馈类型",
  339. "icon" => "fa fa-dot-circle-o",
  340. "sublist" => [
  341. [
  342. "name" => "exam/correction_type/index",
  343. "title" => "查看"
  344. ],
  345. [
  346. "name" => "exam/correction_type/add",
  347. "title" => "添加"
  348. ],
  349. [
  350. "name" => "exam/correction_type/edit",
  351. "title" => "编辑"
  352. ],
  353. [
  354. "name" => "exam/correction_type/del",
  355. "title" => "删除"
  356. ],
  357. [
  358. "name" => "exam/correction_type/multi",
  359. "title" => "批量更新"
  360. ],
  361. ]
  362. ],
  363. [
  364. "name" => "exam/correction_question",
  365. "title" => "纠错反馈试题",
  366. "icon" => "fa fa-pencil",
  367. "sublist" => [
  368. [
  369. "name" => "exam/correction_question/index",
  370. "title" => "查看"
  371. ],
  372. [
  373. "name" => "exam/correction_question/add",
  374. "title" => "添加"
  375. ],
  376. [
  377. "name" => "exam/correction_question/edit",
  378. "title" => "编辑"
  379. ],
  380. [
  381. "name" => "exam/correction_question/del",
  382. "title" => "删除"
  383. ],
  384. [
  385. "name" => "exam/correction_question/multi",
  386. "title" => "批量更新"
  387. ]
  388. ]
  389. ],
  390. ]
  391. ],
  392. [
  393. "name" => "exam/dashboard/index",
  394. "title" => "控制台",
  395. "icon" => "fa fa-dashboard",
  396. "sublist" => []
  397. ]
  398. ]
  399. ]
  400. ];
  401. /**
  402. * 插件安装方法
  403. * @return bool
  404. */
  405. public function install()
  406. {
  407. Menu::create($this->menu);
  408. return true;
  409. }
  410. /**
  411. * 插件卸载方法
  412. * @return bool
  413. */
  414. public function uninstall()
  415. {
  416. Menu::delete('exam');
  417. return true;
  418. }
  419. /**
  420. * 插件启用方法
  421. * @return bool
  422. */
  423. public function enable()
  424. {
  425. Menu::enable('exam');
  426. return true;
  427. }
  428. /**
  429. * 插件禁用方法
  430. * @return bool
  431. */
  432. public function disable()
  433. {
  434. Menu::disable('exam');
  435. return true;
  436. }
  437. /**
  438. * 插件升级方法
  439. * @return bool
  440. */
  441. public function upgrade()
  442. {
  443. // 如果菜单有变更则升级菜单
  444. Menu::upgrade('exam', $this->menu);
  445. return true;
  446. }
  447. }