dusenyao преди 1 година
родител
ревизия
fdcf5ff8a9
променени са 2 файла, в които са добавени 24 реда и са изтрити 4 реда
  1. 23 4
      src/views/exercise_questions/answer/index.vue
  2. 1 0
      src/views/exercise_questions/preview/ReadPreview.vue

+ 23 - 4
src/views/exercise_questions/answer/index.vue

@@ -7,6 +7,7 @@
       </div>
       <div class="question-info">
         <el-popover
+          v-if="!isStart && !isSubmit"
           v-model="isShowQuestionList"
           :width="200"
           :disabled="isStart"
@@ -15,13 +16,13 @@
         >
           <ul class="question-list">
             <li
-              v-for="({ id, type: question_type }, i) in questionList"
+              v-for="({ id, type: question_type, additional_type }, i) in questionList"
               :key="id"
               :class="[{ active: i === curQuestionIndex }]"
               @click="selectQuestion(i)"
             >
               <span>{{ i + 1 }}.</span>
-              <span>{{ exerciseNames[question_type] }}</span>
+              <span>{{ getExerciseName('list', question_type, additional_type) }}</span>
             </li>
           </ul>
 
@@ -32,7 +33,7 @@
           >
             <SvgIcon icon-class="list" />
             <span>{{ curQuestionIndex + 1 }} / {{ questionList.length }}</span>
-            <span>{{ curQuestionIndex < 0 ? '' : exerciseNames[questionList[curQuestionIndex].type] }}</span>
+            <span>{{ getExerciseName('cur') }}</span>
           </div>
         </el-popover>
         <div v-if="!isTeacherAnnotations" class="round primary">
@@ -316,10 +317,10 @@ export default {
             this.time = answer_time_limit_minute * 60;
             this.correct_answer_show_mode = correct_answer_show_mode;
             this.loading = false;
+            this.answer_mode = answer_mode;
             // 如果已经存在答题记录,则直接显示答题报告
             if (this.user_answer_record_info.is_exist_answer_record === 'true') {
               this.answer_record_id = this.user_answer_record_info.answer_record_id;
-              this.answer_mode = answer_mode;
               this.isSubmit = true;
             }
             if (!this.isTeacher) {
@@ -558,6 +559,7 @@ export default {
         .then(() => {
           this.isSubmit = true;
           this.curQuestionIndex = -1;
+          this.user_answer_record_info.is_exist_answer_record = 'true';
         })
         .catch(() => {});
     },
@@ -593,6 +595,23 @@ export default {
         this.isPopover = false;
       });
     },
+    getExerciseName(type, question_type, additional_type) {
+      if (type === 'cur') {
+        if (this.curQuestionIndex < 0) return '';
+        let { type: _type, additional_type: _additional_type } = this.questionList[this.curQuestionIndex];
+        if (_type === 'select') {
+          return _additional_type === 'single' ? '单选题' : '多选题';
+        }
+        return this.exerciseNames[_type];
+      }
+
+      if (type === 'list') {
+        if (question_type === 'select') {
+          return additional_type === 'single' ? '单选题' : '多选题';
+        }
+        return this.exerciseNames[question_type];
+      }
+    },
   },
 };
 </script>

+ 1 - 0
src/views/exercise_questions/preview/ReadPreview.vue

@@ -131,6 +131,7 @@ export default {
     showAnswer(isJudgingRightWrong, isShowRightAnswer, userAnswer, disabled) {
       this.isJudgingRightWrong = isJudgingRightWrong;
       this.isShowRightAnswer = isShowRightAnswer;
+      this.disabled = disabled;
       if (userAnswer) this.answer = userAnswer;
       if (this.question_list.length === this.answer.question_list.length) {
         return this.fillAnswer(isJudgingRightWrong, isShowRightAnswer, disabled);