Prechádzať zdrojové kódy

更新 exam 模块接口

reghao 1 rok pred
rodič
commit
1ee6f628ec

+ 35 - 54
src/api/exam.js

@@ -1,89 +1,70 @@
 import { delete0, get, post } from '@/utils/request'
 
 const examApi = {
-  getExamSubject: '/api/content/exam/subject',
-  getExamSubjectKV: '/api/content/exam/subject/kv',
-  getExamQuestion: '/api/content/exam/question',
-  getExamQuestion1: '/api/content/exam/question/1',
-  getExamQuestionType: '/api/content/exam/question/type',
-  postExamQuestion: '/api/content/exam/question',
-  postExamPaper: '/api/content/exam/paper/submit1',
-  getExamPapers: '/api/content/exam/start',
-  getExamResult: '/api/content/exam/result',
-  getExamPaperScore: '/api/content/exam/paper/score',
-  getExam: '/api/content/exam',
+  getSubject: '/api/content/exam/subject',
+  getSubjectKV: '/api/content/exam/subject/kv',
+  getQuestionType: '/api/content/exam/question/type',
+  getQuestion: '/api/content/exam/question',
+  addQuestion: '/api/content/exam/question',
   getPaper: '/api/content/exam/paper',
-  postPaper: '/api/content/exam/paper'
+  addPaper: '/api/content/exam/paper',
+  startExam: '/api/content/exam/start',
+  submitExam: '/api/content/exam/submit',
+  getExamResult: '/api/content/exam/result'
 }
 
-export function getExamSubject() {
-  return get(examApi.getExamSubject)
+export function getSubject() {
+  return get(examApi.getSubject)
 }
 
-export function getExamSubjectKV() {
-  return get(examApi.getExamSubjectKV)
+export function getSubjectKV() {
+  return get(examApi.getSubjectKV)
 }
 
-export function getExamQuestionType() {
-  return get(examApi.getExamQuestionType)
+export function getQuestionType() {
+  return get(examApi.getQuestionType)
 }
 
-export function getExamQuestionPage(param) {
-  return get(examApi.getExamQuestion1, param)
+export function getQuestions(param) {
+  return get(examApi.getQuestion, param)
 }
 
-export function deleteExamQuestion(questionId) {
-  return delete0(examApi.getExamQuestion + '/' + questionId)
+export function deleteQuestion(questionId) {
+  return delete0(examApi.getQuestion + '/' + questionId)
 }
 
-export function getExamQuestion1(questionId) {
-  return get(examApi.getExamQuestion1 + '/' + questionId)
+export function getQuestion(questionId) {
+  return get(examApi.getQuestion + '/' + questionId)
 }
 
-export function postExamQuestion(data) {
-  return post(examApi.postExamQuestion, data)
+export function addQuestion(data) {
+  return post(examApi.addQuestion, data)
 }
 
-export function getExams(pageNumber) {
-  return get(examApi.getExam)
+export function getPapers(param) {
+  return get(examApi.getPaper, param)
 }
 
-export function getExam(paperId) {
-  return get(examApi.getExam + '/' + paperId)
+export function getPaper(examId) {
+  return get(examApi.getPaper + '/' + examId)
 }
 
-export function getExamInfoById(paperId) {
-  return get(examApi.getExamPapers + '/' + paperId)
+export function addPaper(data) {
+  return post(examApi.addPaper, data)
 }
 
-export function getQuestionByIds(data) {
-  return get(examApi.getExamQuestion, data)
+export function getExamInfo(paperId) {
+  return get(examApi.startExam + '/' + paperId)
 }
 
-export function getQuestionByPaperId(paperId) {
-  return get('/api/content/exam/paperquestion' + '/' + paperId)
+export function getPaperQuestions(paperId) {
+  return get('/api/content/exam/paper/' + paperId + '/question')
 }
 
-export function submitExamPaper(data) {
-  return post(examApi.postExamPaper, data)
+export function submitExam(data) {
+  return post(examApi.submitExam, data)
 }
 
 export function getExamResult(examId) {
   return get(examApi.getExamResult + '/' + examId)
 }
-
-export function getExamPaperScore(examId) {
-  return get(examApi.getExamPaperScore + '/' + examId)
-}
-
-export function postPaper(data) {
-  return post(examApi.postPaper, data)
-}
-
-export function getPapers(param) {
-  return get(examApi.getPaper, param)
-}
-
-export function getPaper(examId) {
-  return get(examApi.getPaper + '/' + examId)
-}

+ 4 - 4
src/views/exam/ExamCard.vue

@@ -287,7 +287,7 @@
 </template>
 
 <script>
-import { submitExamPaper, getExamInfoById, getQuestionByPaperId } from '@/api/exam'
+import { submitExam, getExamInfo, getPaperQuestions } from '@/api/exam'
 
 export default {
   name: 'ExamCard',
@@ -459,7 +459,7 @@ export default {
     // 查询当前考试的信息
     getExamInfo() {
       const paperId = this.$route.params.paperId
-      getExamInfoById(paperId).then((resp) => {
+      getExamInfo(paperId).then((resp) => {
         if (resp.code === 0) {
           this.examInfo = resp.data
           // 设置定时(秒)
@@ -487,7 +487,7 @@ export default {
     },
     // 查询考试的题目信息
     async getQuestionInfo1(paperId) {
-      await getQuestionByPaperId(paperId).then(resp => {
+      await getPaperQuestions(paperId).then(resp => {
         if (resp.code === 0) {
           this.questionList = resp.data || []
           // 重置问题的顺序 单选 多选 判断 简答
@@ -708,7 +708,7 @@ export default {
       userPayload.examId = parseInt(this.$route.params.paperId)
       userPayload.questionIds = userPayload.questionIds.join(',')
       userPayload.creditImgUrl = this.takePhotoUrl.join(',')
-      submitExamPaper(payload).then((resp) => {
+      submitExam(payload).then((resp) => {
         if (resp.code === 0) {
           this.$notify({
             title: 'Tips',

+ 59 - 50
src/views/exam/ExamIndex.vue

@@ -1,15 +1,25 @@
 <template>
-  <el-row>
-    <el-row>
-      <el-form :inline="true" :model="searchForm" class="demo-form-inline">
-        <el-form-item>
-          <el-select v-model="searchForm.type" placeholder="查询类型">
-            <el-option label="待完成" value="1" />
-            <el-option label="已完成" value="2" />
-            <el-option label="全部" value="3" />
-          </el-select>
-        </el-form-item>
-      </el-form>
+  <el-container>
+    <el-header height="220">
+      <el-row>
+        <el-select
+          v-model="queryInfo.subjectId"
+          clearable
+          placeholder="请选择科目"
+          style="margin-left: 5px"
+          @change="subjectChange"
+        >
+          <el-option
+            v-for="item in allSubject"
+            :key="item.key"
+            :label="item.value"
+            :value="item.key"
+          />
+        </el-select>
+      </el-row>
+    </el-header>
+
+    <el-main>
       <el-table
         :data="dataList"
         border
@@ -23,14 +33,22 @@
         <el-table-column
           prop="examName"
           label="考试名称"
+          width="150"
+        />
+        <el-table-column
+          prop="type"
+          label="考试类型"
+          width="90"
         />
         <el-table-column
           prop="startTime"
           label="考试时间"
+          width="150"
         />
         <el-table-column
           prop="duration"
           label="考试时长(分钟)"
+          width="150"
         />
         <el-table-column
           prop="totalScore"
@@ -54,8 +72,6 @@
           </template>
         </el-table-column>
       </el-table>
-    </el-row>
-    <el-row>
       <el-pagination
         background
         :small="screenWidth <= 768"
@@ -67,7 +83,7 @@
         @prev-click="handleCurrentChange"
         @next-click="handleCurrentChange"
       />
-    </el-row>
+    </el-main>
 
     <el-dialog
       title="考试提示"
@@ -98,11 +114,11 @@
         <el-button type="primary" @click="startExam(currentSelectedExam.examId)">开始考试</el-button>
       </span>
     </el-dialog>
-  </el-row>
+  </el-container>
 </template>
 
 <script>
-import {getExamPapers, getExams} from '@/api/exam'
+import { getSubjectKV, getPapers } from '@/api/exam'
 
 export default {
   name: 'ExamIndex',
@@ -115,11 +131,12 @@ export default {
       totalSize: 0,
       dataList: [],
       // **********************************************************************
-      searchForm: {
-        page: 1,
-        type: '1',
-        content: null
+      queryInfo: {
+        subjectId: null,
+        pageNumber: 1,
+        pageSize: 10
       },
+      allSubject: [],
       // 开始考试的提示框
       startExamDialog: false,
       // 当前选中的考试的信息
@@ -129,19 +146,22 @@ export default {
     }
   },
   created() {
-    document.title = '试卷列表'
-    this.getData(this.searchForm)
+    document.title = '我的试卷'
+    this.getData(this.queryInfo)
+    this.getSubjects()
+    // this.getQuestionTypes()
   },
   methods: {
     handleCurrentChange(pageNumber) {
       this.currentPage = pageNumber
-      this.getData(this.searchForm)
+      this.queryInfo.pageNumber = this.currentPage
+      this.queryInfo.pageSize = this.pageSize
+      this.getData(this.queryInfo)
       // 回到顶部
       scrollTo(0, 0)
     },
-    getData(searchForm) {
-      this.dataList = []
-      getExams(this.currentPage).then(resp => {
+    getData(queryInfo) {
+      getPapers(queryInfo).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize
@@ -161,28 +181,21 @@ export default {
           duration: 3000
         })
       })
-
-      getExamPapers(this.currentPage).then(resp => {
+    },
+    getSubjects() {
+      getSubjectKV().then((resp) => {
         if (resp.code === 0) {
-          // this.dataList = resp.data.list
-          // this.totalSize = resp.data.totalSize
-        } else {
-          this.$notify({
-            title: '提示',
-            message: resp.msg,
-            type: 'warning',
-            duration: 3000
-          })
+          this.allSubject = resp.data
         }
-      }).catch(error => {
-        this.$notify({
-          title: '提示',
-          message: error.message,
-          type: 'error',
-          duration: 3000
-        })
       })
     },
+    // 题库变化
+    subjectChange(val) {
+      this.queryInfo.subjectId = val
+      this.queryInfo.pageNumber = this.currentPage
+      this.queryInfo.pageSize = this.pageSize
+      this.getData(this.queryInfo)
+    },
     prepareExam(index, row) {
       row.password = 12345678
       row.type = 1
@@ -205,13 +218,9 @@ export default {
       }
     },
     startExam(paperId) {
-      const path = '/exam/paper/' + paperId
+      const path = '/exam/start/' + paperId
       console.log(path)
-      this.$router.push('/exam/paper/' + paperId)
-    },
-    search() {
-      this.currentPage = 1
-      this.getData(this.searchForm)
+      this.$router.push('/exam/start/' + paperId)
     }
   }
 }

+ 2 - 2
src/views/exam/ExamMarker.vue

@@ -115,7 +115,7 @@
 </template>
 
 <script>
-import {getExamPapers, getExams} from '@/api/exam'
+import {getExam, getExamPapers, getExams} from '@/api/exam'
 
 export default {
   name: 'ExamMarker',
@@ -154,7 +154,7 @@ export default {
     },
     getData(searchForm) {
       this.dataList = []
-      getExams(this.currentPage).then(resp => {
+      getExam(this.currentPage).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize

+ 20 - 131
src/views/exam/ExamPaper.vue

@@ -16,21 +16,6 @@
             :value="item.key"
           />
         </el-select>
-        <el-select v-model="queryInfo.type" clearable placeholder="请选择试题类型" @change="typeChange">
-          <el-option
-            v-for="item in allType"
-            :key="item.key"
-            :label="item.value"
-            :value="item.key"
-          />
-        </el-select>
-        <el-input
-          v-model="queryInfo.questionContent"
-          placeholder="题目内容"
-          style="margin-left: 5px;width: 220px"
-          prefix-icon="el-icon-search"
-          @blur="getQuestionInfo"
-        />
       </el-row>
       <el-row style="margin-top: 10px">
         <el-button type="plain" icon="el-icon-plus" @click="addExamPaper">添加</el-button>
@@ -50,12 +35,12 @@
         />
         <el-table-column
           prop="examName"
-          label="试名称"
+          label="试名称"
           width="150"
         />
         <el-table-column
           prop="type"
-          label="考试类型"
+          label="所属科目"
           width="90"
         />
         <el-table-column
@@ -76,6 +61,10 @@
           prop="passScore"
           label="及格分数"
         />
+        <el-table-column
+          prop="passScore"
+          label="试卷状态"
+        />
         <el-table-column
           fixed="right"
           label="操作"
@@ -85,8 +74,8 @@
             <el-button
               size="mini"
               type="warning"
-              @click="prepareExam(scope.$index, scope.row)"
-            >去考试</el-button>
+              @click="previewPaper(scope.$index, scope.row)"
+            >预览</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -102,41 +91,11 @@
         @next-click="handleCurrentChange"
       />
     </el-main>
-
-    <el-dialog
-      title="考试提示"
-      :visible.sync="startExamDialog"
-      center
-      width="50%"
-    >
-      <el-alert
-        title="点击`开始考试`后将自动进入考试,请诚信考试,考试过程中可能会对用户行为、用户视频进行截图采样,请知悉!"
-        type="error"
-      />
-      <el-card style="margin-top: 25px">
-        <span>考试名称:</span>{{ currentSelectedExam.examName }}
-        <br>
-        <span>考试描述:</span>{{ currentSelectedExam.examDesc }}
-        <br>
-        <span>考试时长:</span>{{ currentSelectedExam.duration + '分钟' }}
-        <br>
-        <span>试卷总分:</span>{{ currentSelectedExam.totalScore }}分
-        <br>
-        <span>及格分数:</span>{{ currentSelectedExam.passScore }}分
-        <br>
-        <span>开放类型:</span> {{ currentSelectedExam.type === 2 ? '需要密码' : '完全公开' }}
-        <br>
-      </el-card>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="startExamDialog = false">返 回</el-button>
-        <el-button type="primary" @click="startExam(currentSelectedExam.examId)">开始考试</el-button>
-      </span>
-    </el-dialog>
   </el-container>
 </template>
 
 <script>
-import {getExamPapers, getExamQuestionType, getExams, getExamSubjectKV, getPapers} from '@/api/exam'
+import { getSubjectKV, getPapers } from '@/api/exam'
 
 export default {
   name: 'ExamPaper',
@@ -149,47 +108,31 @@ export default {
       totalSize: 0,
       dataList: [],
       // **********************************************************************
-      searchForm: {
-        page: 1,
-        type: '1',
-        content: null
-      },
       queryInfo: {
         subjectId: null,
-        type: null,
-        level: null,
         pageNumber: 1,
         pageSize: 10
       },
-      allSubject: [],
-      allType: [],
-      // 开始考试的提示框
-      startExamDialog: false,
-      // 当前选中的考试的信息
-      currentSelectedExam: {
-        examId: 114511
-      }
+      allSubject: []
     }
   },
   created() {
     document.title = '试卷管理'
-    this.getData(this.searchForm)
+    this.getData(this.queryInfo)
     this.getSubjects()
     this.getQuestionTypes()
   },
   methods: {
     handleCurrentChange(pageNumber) {
       this.currentPage = pageNumber
-      this.getData(this.searchForm)
+      this.queryInfo.pageNumber = this.currentPage
+      this.queryInfo.pageSize = this.pageSize
+      this.getData(this.queryInfo)
       // 回到顶部
       scrollTo(0, 0)
     },
-    getData(searchForm) {
-      this.dataList = []
-      var param = {}
-      param.pageNumber = this.currentPage
-      param.pageSize = this.pageSize
-      getPapers(param).then(resp => {
+    getData(queryInfo) {
+      getPapers(queryInfo).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize
@@ -210,76 +153,22 @@ export default {
         })
       })
     },
-    getQuestionTypes() {
-      getExamQuestionType().then((resp) => {
-        if (resp.code === 0) {
-          this.allType = resp.data
-        } else {
-          this.$notify({
-            title: 'Tips',
-            message: resp.message,
-            type: 'error',
-            duration: 2000
-          })
-        }
-      })
-    },
-    // 获取所有的题库信息
     getSubjects() {
-      getExamSubjectKV().then((resp) => {
+      getSubjectKV().then((resp) => {
         if (resp.code === 0) {
           this.allSubject = resp.data
         }
       })
     },
-    // 试题类型变化
-    typeChange(val) {
-      this.queryInfo.type = val
-      this.queryInfo.pageNumber = this.currentPage
-      this.queryInfo.pageSize = this.pageSize
-      this.getQuestionInfo()
-    },
     // 题库变化
     subjectChange(val) {
       this.queryInfo.subjectId = val
       this.queryInfo.pageNumber = this.currentPage
       this.queryInfo.pageSize = this.pageSize
-      this.getQuestionInfo()
-    },
-    // 试题名字筛选
-    contentChange() {
-      // 发送查询试题总数的请求
-      this.getQuestionInfo()
-    },
-    prepareExam(index, row) {
-      row.password = 12345678
-      row.type = 1
-      if (row.type === 2) {
-        this.$prompt('请提供考试密码', 'Tips', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }).then(({ value }) => {
-          if (value === row.password) {
-            this.startExamDialog = true
-            this.currentSelectedExam = row
-          } else {
-            this.$message.error('密码错误o(╥﹏╥)o')
-          }
-        }).catch(() => {
-        })
-      } else {
-        this.startExamDialog = true
-        this.currentSelectedExam = row
-      }
-    },
-    startExam(paperId) {
-      const path = '/exam/start/' + paperId
-      console.log(path)
-      this.$router.push('/exam/start/' + paperId)
+      this.getData(this.queryInfo)
     },
-    search() {
-      this.currentPage = 1
-      this.getData(this.searchForm)
+    previewPaper(index, row) {
+      this.$message('预览试卷')
     },
     addExamPaper() {
       this.$router.push('/exam/paper/add')

+ 5 - 5
src/views/exam/ExamPaperAdd.vue

@@ -280,7 +280,7 @@
 </template>
 
 <script>
-import { getExamQuestionPage, getExamQuestionType, getExamSubjectKV, postPaper } from '@/api/exam'
+import { getQuestions, getQuestionType, getSubjectKV, addPaper } from '@/api/exam'
 import { validFormAndInvoke } from '@/utils/util'
 
 export default {
@@ -397,7 +397,7 @@ export default {
     },
     // 获取所有的题库信息
     getSubjects() {
-      getExamSubjectKV().then((resp) => {
+      getSubjectKV().then((resp) => {
         if (resp.code === 0) {
           this.allSubject = resp.data
         } else {
@@ -411,7 +411,7 @@ export default {
       })
     },
     getQuestionTypes() {
-      getExamQuestionType().then((resp) => {
+      getQuestionType().then((resp) => {
         if (resp.code === 0) {
           this.allType = resp.data
         } else {
@@ -473,7 +473,7 @@ export default {
     // 获取题目信息
     getQuestionInfo() {
       this.dataList = []
-      getExamQuestionPage(this.queryInfo).then(resp => {
+      getQuestions(this.queryInfo).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize
@@ -591,7 +591,7 @@ export default {
       }, '请检查考试规则设置是否完整')
     },
     addExamPaper(examInfo) {
-      postPaper(examInfo).then(resp => {
+      addPaper(examInfo).then(resp => {
         if (resp.code === 0) {
           this.$notify({
             title: '提示',

+ 13 - 13
src/views/exam/ExamQuestion.vue

@@ -430,11 +430,11 @@
 
 <script>
 import {
-  getExamSubjectKV,
-  postExamQuestion,
-  getExamQuestion1,
-  deleteExamQuestion,
-  getExamQuestionPage, getExamQuestionType
+  getSubjectKV,
+  addQuestion,
+  getQuestion1,
+  deleteQuestion,
+  getQuestions, getQuestionType, getQuestion
 } from '@/api/exam'
 import { validFormAndInvoke } from '@/utils/util'
 
@@ -681,7 +681,7 @@ export default {
     },
     getData() {
       this.dataList = []
-      getExamQuestionPage(this.queryInfo).then(resp => {
+      getQuestions(this.queryInfo).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize
@@ -703,7 +703,7 @@ export default {
       })
     },
     getQuestionTypes() {
-      getExamQuestionType().then((resp) => {
+      getQuestionType().then((resp) => {
         if (resp.code === 0) {
           this.allType = resp.data
         } else {
@@ -718,7 +718,7 @@ export default {
     },
     // 获取所有的题库信息
     getSubjects() {
-      getExamSubjectKV().then((resp) => {
+      getSubjectKV().then((resp) => {
         if (resp.code === 0) {
           this.allSubject = resp.data
         }
@@ -995,7 +995,7 @@ export default {
     addQuestion() {
       this.$refs['addQuForm'].validate((valid) => {
         if (valid && this.addQuForm.options.some(item => item.correct) && this.addQuForm.questionType !== 4) { // 单选或者多选或者判断
-          postExamQuestion(this.addQuForm).then((resp) => {
+          addQuestion(this.addQuForm).then((resp) => {
             if (resp.code === 0) {
               this.addQuTableVisible = false
               this.getData(this.searchForm)
@@ -1013,7 +1013,7 @@ export default {
         } else if (valid && this.addQuForm.questionType >= 5 && this.addQuForm.questionType <= 7) { // 简答题 无标准答案直接发请求
           // 当是简答题的时候需要清除answer
           this.addQuForm.options = []
-          postExamQuestion(this.addQuForm).then((resp) => {
+          addQuestion(this.addQuForm).then((resp) => {
             if (resp.code === 0) {
               this.addQuTableVisible = false
               this.getQuestionInfo()
@@ -1028,7 +1028,7 @@ export default {
         } else if (this.addQuForm.questionType > 7) { // 組题
           // 当是简答题的时候需要清除answer
           this.addQuForm.options = []
-          postExamQuestion(this.addQuForm).then((resp) => {
+          addQuestion(this.addQuForm).then((resp) => {
             if (resp.code === 0) {
               this.addQuTableVisible = false
               this.getQuestionInfo()
@@ -1117,7 +1117,7 @@ export default {
       })
     },
     viewDetail(questionId) {
-      getExamQuestion1(questionId).then(resp => {
+      getQuestion(questionId).then(resp => {
         if (resp.code === 0) {
           this.questionDetail = resp.data
           this.questionDetailDialog = true
@@ -1133,7 +1133,7 @@ export default {
       })
     },
     onDeleteQuestion(questionId) {
-      deleteExamQuestion(questionId).then(resp => {
+      deleteQuestion(questionId).then(resp => {
         if (resp.code === 0) {
           this.$notify({
             title: 'Tips',

+ 3 - 3
src/views/exam/ExamQuestionAdd.vue

@@ -292,7 +292,7 @@
 </template>
 
 <script>
-import { getExamSubjectKV, postExamQuestion } from '@/api/exam'
+import { getSubjectKV, addQuestion } from '@/api/exam'
 import tinymce from 'tinymce/tinymce'
 import 'tinymce/themes/silver/theme'
 import Editor from '@tinymce/tinymce-vue'
@@ -448,7 +448,7 @@ export default {
     },
     // 获取所有的题库信息
     getQuestionBankInfo() {
-      getExamSubjectKV().then((resp) => {
+      getSubjectKV().then((resp) => {
         if (resp.code === 0) {
           this.allSubject = resp.data
         }
@@ -576,7 +576,7 @@ export default {
       })
     },
     submitExamQuestion() {
-      postExamQuestion(this.addQuForm).then((resp) => {
+      addQuestion(this.addQuForm).then((resp) => {
         if (resp.code === 0) {
           this.resetAddQuForm()
           this.$notify({

+ 2 - 14
src/views/exam/ExamResult.vue

@@ -122,7 +122,7 @@
 </template>
 
 <script>
-import { getExamResult, getQuestionByIds, getQuestionByPaperId } from '@/api/exam'
+import { getExamResult, getQuestionByIds, getPaperQuestions } from '@/api/exam'
 
 export default {
   name: 'ExamResult',
@@ -186,20 +186,8 @@ export default {
         }
       })
     },
-    // 根据ids查询题目信息
-    async getQuestionInfoByIds(questionIds) {
-      await getQuestionByIds({ ids: questionIds }).then((resp) => {
-        if (resp.code === 0) {
-          this.questionInfo = resp.data || []
-          // 重置问题的顺序 单选 多选 判断 简答
-          this.questionInfo = this.questionInfo.sort(function(a, b) {
-            return a.questionType - b.questionType
-          })
-        }
-      })
-    },
     async getPaperQuestions(paperId) {
-      await getQuestionByPaperId(paperId).then((resp) => {
+      await getPaperQuestions(paperId).then((resp) => {
         if (resp.code === 0) {
           this.questionInfo = resp.data || []
           // 重置问题的顺序 单选 多选 判断 简答

+ 2 - 2
src/views/exam/ExamResults.vue

@@ -106,7 +106,7 @@
 </template>
 
 <script>
-import {getExamPapers, getExams} from '@/api/exam'
+import {getExam, getExamPapers, getExams} from '@/api/exam'
 
 export default {
   name: 'ExamResults',
@@ -145,7 +145,7 @@ export default {
     },
     getData(searchForm) {
       this.dataList = []
-      getExams(this.currentPage).then(resp => {
+      getExam(this.currentPage).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize

+ 2 - 2
src/views/exam/ExamSubject.vue

@@ -70,7 +70,7 @@
 </template>
 
 <script>
-import { getExamSubject } from '@/api/exam'
+import { getSubject } from '@/api/exam'
 
 export default {
   name: 'ExamSubject',
@@ -98,7 +98,7 @@ export default {
     },
     getData() {
       this.dataList = []
-      getExamSubject(this.currentPage).then(resp => {
+      getSubject(this.currentPage).then(resp => {
         if (resp.code === 0) {
           this.dataList = resp.data.list
           this.totalSize = resp.data.totalSize