Răsfoiți Sursa

fix调卷失败;根据获取试题内容提交答案;fix camera size

Michael Wang 6 ani în urmă
părinte
comite
37b7a321bd

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

@@ -10,11 +10,11 @@
       <QuestionView :exam-question="examQuestion()"></QuestionView>
       <ArrowNavView :previousQuestionOrder="previousQuestionOrder" :nextQuestionOrder="nextQuestionOrder"></ArrowNavView>
     </div>
-    <div class="side">
+    <div :class="['side', 'side-row-size']">
       <div class="question-nav">
         <QuestionNavView :paperStruct="paperStruct" />
       </div>
-      <div class="camera">
+      <div v-if="faceEnable" class="camera">
         <FaceRecognition v-if="faceEnable" width="100%" height="100%" :showRecognizeButton="false" />
       </div>
     </div>
@@ -392,6 +392,10 @@ export default {
   background-color: #f5f5f5;
 }
 
+.side-row-size {
+  grid-template-rows: 1fr;
+}
+
 .camera {
   align-self: flex-end;
   justify-self: flex-end;

+ 21 - 36
src/features/OnlineExam/OnlineExamOverview.vue

@@ -67,47 +67,32 @@ export default {
         `/BEFORE_EXAM_REMARK`
     );
     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.examStudentId
-      );
-      // var res = {
-      //   data: {
-      //     examRecordDataId: 7,
-      //     courseCode: "W00001",
-      //     courseName: "英语",
-      //     studentCode: "20180613",
-      //     studentName: "王章军",
-      //     duration: 120,
-      //     faceLivenessMinute: null
-      //   }
-      // };
-      if (res.status !== 200) {
-        return;
-      }
-      this.startInfo = res.data;
-      this.examRecordDataId = res.data.examRecordDataId;
-      // this.startInfo = {
-      //   id: 101436,
-      //   courseName: "计算机应用基础",
-      //   studentCode: "20180613",
-      //   studentName: "王章军",
-      //   specialtyLevel: "ALL",
-      //   paperMins: 60,
-      //   invigilatorOperation: 0,
-      //   retakeTypeId: null,
-      //   retakeDetail: null,
-      //   faceVerifyMinute: null
-      // };
-      // this.examRcordId = this.startInfo.id;
-    } catch (error) {
+    // 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.examStudentId
+    );
+    if (res.status !== 200) {
       console.log(error);
       this.$Message.error(error.message);
       this.$router.back();
       return;
     }
+    this.startInfo = res.data;
+    this.examRecordDataId = res.data.examRecordDataId;
+    // this.startInfo = {
+    //   id: 101436,
+    //   courseName: "计算机应用基础",
+    //   studentCode: "20180613",
+    //   studentName: "王章军",
+    //   specialtyLevel: "ALL",
+    //   paperMins: 60,
+    //   invigilatorOperation: 0,
+    //   retakeTypeId: null,
+    //   retakeDetail: null,
+    //   faceVerifyMinute: null
+    // };
+    // this.examRcordId = this.startInfo.id;
     const paperStruct = await this.$http.get(
       "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
         this.examRecordDataId

+ 4 - 3
src/store.js

@@ -51,7 +51,7 @@ const examingHomeModule = {
     },
     updateExamQuestion(
       state,
-      { order, studentAnswer, isSign, audioPlayTimes }
+      { order, studentAnswer, isSign, audioPlayTimes, getQuestionContent }
     ) {
       const examQuestionList = state.examQuestionList.map(eq => {
         // console.log(eq.order, order);
@@ -59,10 +59,11 @@ const examingHomeModule = {
           return Object.assign(
             {},
             eq,
-            { dirty: true },
+            getQuestionContent === undefined && { dirty: true }, // 仅设置getQuestionContent时,不更新dirty
             studentAnswer !== undefined && { studentAnswer },
             audioPlayTimes !== undefined && { audioPlayTimes },
-            isSign !== undefined && { isSign }
+            isSign !== undefined && { isSign },
+            getQuestionContent !== undefined && { getQuestionContent }
           );
         }
         return eq;