浏览代码

接口调试

Michael Wang 6 年之前
父节点
当前提交
51f61b76af

+ 1 - 1
src/features/OfflineExam/OfflineExamHome.vue

@@ -29,7 +29,7 @@ export default {
       const res = await this.$http.get("/api/offline_exam/getOfflineCourse");
 
       this.courses = res.data.map(c => ({
-        examRecordId: c.examRecordId,
+        examRecordDataId: c.examRecordDataId,
         courseName: c.courseName,
         specialtyName: c.specialtyName,
         orgName: c.orgName,

+ 1 - 1
src/features/OfflineExam/OfflineExamUpload.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <Upload :headers="headers" :data="{fileType: fileType}" :before-upload="handleBeforeUpload" :action="'/api/offline_exam/'+course.examRecordId+'/submit'" :max-size="1024*30" :format="['pdf','zip']" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :on-success="handleSuccess" :on-error="handleError" :show-upload-list="false">
+    <Upload :headers="headers" :data="{fileType: fileType}" :before-upload="handleBeforeUpload" :action="'/api/offline_exam/'+course.examRecordDataId+'/submit'" :max-size="1024*30" :format="['pdf','zip']" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :on-success="handleSuccess" :on-error="handleError" :show-upload-list="false">
       <Button type="ghost" icon="ios-cloud-upload-outline" class="qm-primary-button" style="width: 100%;">上传作答</Button>
     </Upload>
     <div v-if="file !== null">待上传文件: {{ file.name }}

+ 4 - 4
src/features/OnlineExam/Examing/ArrowNavView.vue

@@ -2,7 +2,7 @@
   <div class="arrow-container">
     <div class="prev">
       <template v-if="previousExamQuestion">
-        <router-link class="qm-primary-button" :to="{ path: '/online-exam/exam/' + this.$route.params.examId, query: { 'examRecordId': this.$route.query.examRecordId, 'examQuestionId': previousExamQuestion.id }}">上一题</router-link>
+        <router-link class="qm-primary-button" :to="{ path: '/online-exam/exam/' + this.$route.params.examId, query: { 'examRecordDataId': this.$route.query.examRecordDataId, 'examQuestionId': previousExamQuestion.id }}">上一题</router-link>
       </template>
 
       <template v-else>
@@ -14,7 +14,7 @@
     </div>
     <div class="next">
       <template v-if="nextExamQuestion">
-        <router-link class="qm-primary-button" :to="{ path: '/online-exam/exam/' + this.$route.params.examId, query: { 'examRecordId': this.$route.query.examRecordId, 'examQuestionId': nextExamQuestion.id }}">下一题</router-link>
+        <router-link class="qm-primary-button" :to="{ path: '/online-exam/exam/' + this.$route.params.examId, query: { 'examRecordDataId': this.$route.query.examRecordDataId, 'examQuestionId': nextExamQuestion.id }}">下一题</router-link>
       </template>
 
       <template v-else>
@@ -64,7 +64,7 @@ export default {
       this.$router.push({
         path: "/online-exam/exam/" + this.$route.params.examId,
         query: {
-          examRecordId: this.$route.query.examRecordId,
+          examRecordDataId: this.$route.query.examRecordDataId,
           examQuestionId: this.nextExamQuestion.id
         }
       });
@@ -73,7 +73,7 @@ export default {
       this.$router.push({
         path: "/online-exam/exam/" + this.$route.params.examId,
         query: {
-          examRecordId: this.$route.query.examRecordId,
+          examRecordDataId: this.$route.query.examRecordDataId,
           examQuestionId: this.previousExamQuestion.id
         }
       });

+ 2 - 3
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -55,12 +55,11 @@ export default {
       );
       const paperStruct = await this.$http.get(
         "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
-          this.$route.query.examRecordId
+          this.$route.query.examRecordDataId
       );
 
       const examQuestionList = await this.$http.get(
-        "/api/ecs_oe_student/examQuestion/findExamQuestionList?examRecordDataId=" +
-          this.$route.query.examRecordId
+        "/api/ecs_oe_student/examQuestion/findExamQuestionList"
       );
 
       this.updateExamState({

+ 1 - 1
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -13,7 +13,7 @@ export default {
   },
   props: {
     questionBody: String,
-    examQuestionId: Number
+    examQuestionId: String
   },
   mounted() {
     const audio = document.getElementsByTagName("audio")[0];

+ 1 - 1
src/features/OnlineExam/Examing/QuestionNavView.vue

@@ -8,7 +8,7 @@
             <template v-for="(_, index2) in sectionQuestions(index1)">
               <template v-if="isSelectedQuestion(index1, index2)">
                 <div :key="index2" :class="itemClass(index1, index2)">
-                  <router-link :to="{ path: '/online-exam/exam/' + $route.params.examId, query: { 'examRecordId': $route.query.examRecordId, 'examStudentId': $route.query.examStudentId, 'order': getQuestionNum(index1, index2).order }}">{{index2+1}}</router-link>
+                  <router-link :to="{ path: '/online-exam/exam/' + $route.params.examId, query: { 'examRecordDataId': $route.query.examRecordDataId, 'examStudentId': $route.query.examStudentId, 'order': getQuestionNum(index1, index2).order }}">{{index2+1}}</router-link>
                 </div>
               </template>
             </template>

+ 1 - 3
src/features/OnlineExam/Examing/QuestionView.vue

@@ -52,9 +52,7 @@ export default {
         return;
       }
       const res = await this.$http.get(
-        "/api/ecs_oe_student/examQuestion/getQuestionStructure?examStudentId=" +
-          this.$route.query.examStudentId +
-          "&questionId=" +
+        "/api/ecs_oe_student/examQuestion/getQuestionContent?questionId=" +
           this.examQuestion.questionId
       );
       const question = res.data;

+ 1 - 1
src/features/OnlineExam/Examing/SingleQuestionView.vue

@@ -55,7 +55,7 @@ export default {
       ) {
         if (
           ["KeyA", "KeyB", "KeyC", "KeyD", "KeyE", "KeyF", "KeyG"]
-            .slice(0, this.question.options.length)
+            .slice(0, this.question.questionOptionList.length)
             .includes(e.code)
         ) {
           this.stuAnswer = e.code[3];

+ 2 - 2
src/features/OnlineExam/OnlineExamFaceCheckModal.vue

@@ -92,7 +92,7 @@ export default {
             "我承诺由本人参加考试,并且同意接受考试监控系统信息审核,一经发现作弊,立即取消本门课程考试成绩。",
           onOk: () =>
             this.$router.push(
-              `/online-exam/exam/${this.course.examId}/overview?stuExamInfoId=${
+              `/online-exam/exam/${this.course.examId}/overview?examStudentId=${
                 this.course.examStudentId
               }`
             )
@@ -100,7 +100,7 @@ export default {
         return;
       }
       this.$router.push(
-        `/online-exam/exam/${this.course.examId}/overview?stuExamInfoId=${
+        `/online-exam/exam/${this.course.examId}/overview?examStudentId=${
           this.course.examStudentId
         }`
       );

+ 13 - 0
src/features/OnlineExam/OnlineExamHome.vue

@@ -27,6 +27,19 @@ export default {
     // go to /online-exam/exam/:id/start
     // Promise.all
 
+    const examingRes = (await this.$http.get(
+      "/api/ecs_oe_student/examControl/checkExamInProgress"
+    )).data;
+
+    if (examingRes) {
+      this.$router.push(
+        `/online-exam/exam/${examingRes.examId}/?examRecordDataId=${
+          examingRes.examRecordDataId
+        }&order=1`
+      );
+      return;
+    }
+
     const res = await this.$http.get(
       "/api/ecs_oe_student/examControl/queryExamList"
     );

+ 22 - 23
src/features/OnlineExam/OnlineExamOverview.vue

@@ -7,7 +7,7 @@
         <p v-html="beforeExamRemark"></p>
         <!-- <p>{{"测试".repeat(500)}}</p> -->
       </div>
-      <!-- data-ui-sref="exam.start({examRecordId: startInfo.id,stuExamInfoId:stateParams.stuExamInfoId,examMins:startInfo.paperMins,examId:examInfo.id,faceVerifyMinute:startInfo.faceVerifyMinute})" -->
+      <!-- data-ui-sref="exam.start({examRecordDataId: startInfo.id,examStudentId:stateParams.examStudentId,examMins:startInfo.paperMins,examId:examInfo.id,faceVerifyMinute:startInfo.faceVerifyMinute})" -->
 
       <Button class="qm-primary-button" :disabled="remainTime > 110" @click="goToPaper" style="display: inline-block; width: 100%;">
         {{ remainTime > 110 ? '强制阅读' : '开始答题'}}(倒计时:{{remainTimeFormatted}})</Button>
@@ -58,32 +58,31 @@ export default {
       }
     }, 1000);
 
-    // FIXME: 考前说明
     const exam = await this.$http.get(
       "/api/ecs_exam_work/exam/examOrgProperty/" +
         this.$route.params.examId +
         `/BEFORE_EXAM_REMARK`
     );
-    this.beforeExamRemark = exam.data || "错误:不存在";
+    this.beforeExamRemark = exam.data || "";
     try {
       // await this.$http.get("/api/ecs_oe_student/examControl/endExam");
-      // const res = await this.$http.get(
-      //   "/api/ecs_oe_student/examControl/startExam?examStudentId=" +
-      //     this.$route.query.stuExamInfoId
-      // );
-      var res = {
-        data: {
-          examRecordDataId: 7,
-          courseCode: "W00001",
-          courseName: "英语",
-          studentCode: "20180613",
-          studentName: "王章军",
-          duration: 120,
-          faceLivenessMinute: null
-        }
-      };
+      const res = await this.$http.get(
+        "/api/ecs_oe_student/examControl/startExam?examStudentId=" +
+          this.$route.query.examStudentId
+      );
+      // var res = {
+      //   data: {
+      //     examRecordDataId: 7,
+      //     courseCode: "W00001",
+      //     courseName: "英语",
+      //     studentCode: "20180613",
+      //     studentName: "王章军",
+      //     duration: 120,
+      //     faceLivenessMinute: null
+      //   }
+      // };
       this.startInfo = res.data;
-      this.examRecordId = res.data.examRecordDataId;
+      this.examRecordDataId = res.data.examRecordDataId;
       // this.startInfo = {
       //   id: 101436,
       //   courseName: "计算机应用基础",
@@ -103,7 +102,7 @@ export default {
     }
     const paperStruct = await this.$http.get(
       "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
-        this.examRecordId
+        this.examRecordDataId
     );
     this.paperStruct = paperStruct.data;
 
@@ -173,9 +172,9 @@ export default {
   methods: {
     goToPaper: function() {
       this.$router.push(
-        `/online-exam/exam/${this.$route.params.examId}/?examRecordId=${
-          this.examRecordId
-        }&examStudentId=${this.$route.query.stuExamInfoId}`
+        `/online-exam/exam/${this.$route.params.examId}/?examRecordDataId=${
+          this.examRecordDataId
+        }&examStudentId=${this.$route.query.examStudentId}`
       );
       window.clearInterval(this.intervalId);
     }