exam.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. import { delete0, get, post } from '@/utils/request'
  2. const examApi = {
  3. // *********************************************************************************************************************
  4. // 科目接口
  5. getSubject: '/api/content/exam/subject',
  6. getSubjectKV: '/api/content/exam/subject/kv',
  7. getSubjectCascade: '/api/content/exam/subject/cascade',
  8. // *********************************************************************************************************************
  9. // 试题接口
  10. getQuestionType: '/api/content/exam/question/type',
  11. getQuestion: '/api/content/exam/question',
  12. addQuestion: '/api/content/exam/question',
  13. // *********************************************************************************************************************
  14. // 试卷接口
  15. examPaperApi: '/api/content/exam/paper',
  16. getPaper: '/api/content/exam/paper',
  17. addPaper: '/api/content/exam/paper',
  18. getPaperDetail: '/api/content/exam/paper/detail',
  19. getPaperKeyValue: '/api/content/exam/paper/kv',
  20. // *********************************************************************************************************************
  21. // 考试接口
  22. examList: '/api/content/exam/eval/list',
  23. startExam: '/api/content/exam/eval/start',
  24. cacheUserAnswer: '/api/content/exam/eval/cache',
  25. submitExam: '/api/content/exam/eval/submit',
  26. // *********************************************************************************************************************
  27. // 阅卷接口
  28. getExamMarkList: '/api/content/exam/mark/list',
  29. getMarkView: '/api/content/exam/mark/view',
  30. submitExamMark: '/api/content/exam/mark/submit'
  31. }
  32. // *********************************************************************************************************************
  33. // 科目接口
  34. export function getSubject() {
  35. return get(examApi.getSubject)
  36. }
  37. export function getSubjectKV() {
  38. return get(examApi.getSubjectKV)
  39. }
  40. export function getSubjectCascade() {
  41. return get(examApi.getSubjectCascade)
  42. }
  43. // *********************************************************************************************************************
  44. // 试题接口
  45. export function getQuestionType() {
  46. return get(examApi.getQuestionType)
  47. }
  48. export function getQuestions(queryParams) {
  49. return get(examApi.getQuestion, queryParams)
  50. }
  51. export function deleteQuestion(questionId) {
  52. return delete0(examApi.getQuestion + '/' + questionId)
  53. }
  54. export function getQuestion(questionId) {
  55. return get(examApi.getQuestion + '/' + questionId)
  56. }
  57. export function addQuestion(jsonData) {
  58. return post(examApi.addQuestion, jsonData)
  59. }
  60. // *********************************************************************************************************************
  61. // 试卷接口
  62. export function getPapers(queryParams) {
  63. return get(examApi.examPaperApi, queryParams)
  64. }
  65. export function getPaper(queryParams) {
  66. return get(examApi.examPaperApi + '/detail', queryParams)
  67. }
  68. export function getPaperKeyValues() {
  69. return get(examApi.getPaperKeyValue)
  70. }
  71. export function addPaper(jsonData) {
  72. return post(examApi.addPaper, jsonData)
  73. }
  74. export function deletePaper(paperId) {
  75. return delete0(examApi.addPaper + '/' + paperId)
  76. }
  77. // *********************************************************************************************************************
  78. // 考试接口
  79. export function getExamList() {
  80. return get(examApi.examList)
  81. }
  82. export function getExamInfo(queryParams) {
  83. return get(examApi.startExam, queryParams)
  84. }
  85. export function getPaperQuestions(paperId) {
  86. return get('/api/content/exam/paper/' + paperId + '/question')
  87. }
  88. export function submitExam(jsonData) {
  89. return post(examApi.submitExam, jsonData)
  90. }
  91. export function cacheUserAnswer(jsonData) {
  92. return post(examApi.cacheUserAnswer, jsonData)
  93. }
  94. export function getCachedUserAnswer(queryParams) {
  95. return get(examApi.cacheUserAnswer, queryParams)
  96. }
  97. // *********************************************************************************************************************
  98. // 阅卷接口
  99. export function getExamMarkList(params) {
  100. return get(examApi.getExamMarkList, params)
  101. }
  102. export function getMarkView(queryParams) {
  103. return get(examApi.getMarkView, queryParams)
  104. }
  105. export function submitMarkResult(jsonData) {
  106. return post(examApi.submitExamMark, jsonData)
  107. }
  108. // *********************************************************************************************************************
  109. // 考试结果接口
  110. export function getResultView(paperId) {
  111. return get('/api/content/exam/result/view/' + paperId)
  112. }
  113. // *********************************************************************************************************************
  114. // 考试数据接口
  115. export function getExamCount() {
  116. return get('/api/content/exam/statistic/count')
  117. }
  118. export function getExamPassRate() {
  119. return get('/api/content/exam/statistic/rate')
  120. }
  121. export function getLineChartData() {
  122. return get('/api/content/exam/statistic/linechart')
  123. }