Explorar o código

优化“试题标记”的提交

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
c1d8ffbc1c

+ 8 - 5
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -174,11 +174,14 @@ export default {
     },
     async answerAllQuestions() {
       const answers = this.examQuestionList.filter(eq => eq.dirty).map(eq => {
-        return {
-          order: eq.order,
-          studentAnswer: eq.studentAnswer,
-          audioPlayTimes: eq.audioPlayTimes
-        };
+        return Object.assign(
+          {
+            order: eq.order,
+            studentAnswer: eq.studentAnswer
+          },
+          eq.audioPlayTimes && { audioPlayTimes: eq.audioPlayTimes },
+          eq.isSign && { isSign: eq.isSign }
+        );
       });
       if (answers.length > 0) {
         await this.$http.post(

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

@@ -8,7 +8,7 @@
     <div v-for="(option, index) in newQuestionOptions" :key="index" class="option" @click="toggleAnswer(option.oldIndex)">
       <input type="checkbox" name="question" value="option.oldIndex" :checked="studentAnswer && studentAnswer.includes(option.oldIndex)" />
       <span style="padding: 0 10px;">{{optionName[index]}}: </span>
-      <span class="question-options" v-html="option.value.body"></span>
+      <span class="question-options" v-if="option.value" v-html="option.value.body"></span>
     </div>
     <div class="reset">
       <i-button type="warning" size="large" @click="() => answerQuestion(null)">重置答案</i-button>

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

@@ -138,7 +138,9 @@ export default {
   color: white;
 }
 .current-question {
-  box-shadow: 0 0 15px;
+  box-shadow: 0 0 15px gold;
+  background-color: #a8bcf7;
+  transform: scale(1.2);
 }
 .current-question > a {
   color: black;

+ 9 - 21
src/features/OnlineExam/Examing/QuestionView.vue

@@ -116,18 +116,6 @@ export default {
         ) {
           initQuestion(question.questionUnitList[j]);
         }
-        // 对子题进行排序
-        // if (question.questionUnitList && question.questionUnitList.length > 0) {
-        //   question.questionUnitList.sort(function(a, b) {
-        //     if (a.quesNumber > b.quesNumber) {
-        //       return 1;
-        //     } else if (a.quesNumber < b.quesNumber) {
-        //       return -1;
-        //     } else {
-        //       return 0;
-        //     }
-        //   });
-        // }
         this.parentQuestionBody = question.body;
       } else {
         this.parentQuestionBody = null;
@@ -140,15 +128,15 @@ export default {
         question.questionUnitList[this.examQuestion.subNumber - 1];
     },
     async toggleSign() {
-      await this.$http.post(
-        "/api/ecs_oe_student/examQuestion/submitQuestionAnswer",
-        [
-          {
-            order: this.examQuestion.order,
-            isSign: !this.examQuestion.isSign
-          }
-        ]
-      );
+      // await this.$http.post(
+      //   "/api/ecs_oe_student/examQuestion/submitQuestionAnswer",
+      //   [
+      //     {
+      //       order: this.examQuestion.order,
+      //       isSign: !this.examQuestion.isSign
+      //     }
+      //   ]
+      // );
       this.updateExamQuestion({
         order: this.$route.params.order,
         isSign: !this.examQuestion.isSign

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

@@ -8,7 +8,7 @@
     <div v-for="(option, index) in newQuestionOptions" :key="index" class="option" @click="() => {answerQuestion(option.oldIndex);}">
       <input type="radio" name="question" :value="option.oldIndex" :checked="studentAnswer === option.oldIndex" />
       <span style="padding: 0 10px;">{{optionName[index]}}: </span>
-      <span class="question-options" v-html="option.value.body"></span>
+      <span class="question-options" v-if="option.value" v-html="option.value.body"></span>
     </div>
     <div class="reset">
       <i-button type="warning" size="large" @click="() => answerQuestion(null)">重置答案</i-button>