Przeglądaj źródła

选择声调答案

natasha 1 rok temu
rodzic
commit
6e2e2c0762

+ 16 - 0
src/views/exercise_questions/preview/ChooseTonePreview.vue

@@ -124,6 +124,7 @@ export default {
   },
   },
   methods: {
   methods: {
     chooseTone(item, value, i) {
     chooseTone(item, value, i) {
+      if (this.isJudgingRightWrong) return;
       if ((!this.active_letter || this.select_item_index !== i) && this.data.property.answer_mode === 'label') return;
       if ((!this.active_letter || this.select_item_index !== i) && this.data.property.answer_mode === 'label') return;
       item.user_answer[item.item_active_index].select_tone = value;
       item.user_answer[item.item_active_index].select_tone = value;
       if (this.data.property.answer_mode === 'label') {
       if (this.data.property.answer_mode === 'label') {
@@ -136,6 +137,8 @@ export default {
           item.item_con[item.item_active_index] = new_con[0] + this.final_con + new_con[1];
           item.item_con[item.item_active_index] = new_con[0] + this.final_con + new_con[1];
           // this.active_letter = this.final_con;
           // this.active_letter = this.final_con;
           this.$forceUpdate();
           this.$forceUpdate();
+          this.answer.answer_list[i].value[item.item_active_index] =
+            new_con[0] + this.active_letter + value + new_con[1];
         }, 100);
         }, 100);
       } else {
       } else {
         this.active_index_str = `${i}-${item.item_active_index}`;
         this.active_index_str = `${i}-${item.item_active_index}`;
@@ -144,20 +147,26 @@ export default {
           item.item_con[item.item_active_index] = this.final_con;
           item.item_con[item.item_active_index] = this.final_con;
           this.$forceUpdate();
           this.$forceUpdate();
         }, 100);
         }, 100);
+        this.answer.answer_list[i].value[item.item_active_index] = value;
       }
       }
     },
     },
     // 处理数据
     // 处理数据
     handleData() {
     handleData() {
       this.con_preview = [];
       this.con_preview = [];
+      if (!this.isJudgingRightWrong) {
+        this.answer.answer_list = [];
+      }
       this.data.option_list.forEach((item) => {
       this.data.option_list.forEach((item) => {
         let con_arr = JSON.parse(JSON.stringify(item.content_view));
         let con_arr = JSON.parse(JSON.stringify(item.content_view));
         let user_answer = [];
         let user_answer = [];
+        let user_submit = []; // 用户提交答案
         con_arr.forEach(() => {
         con_arr.forEach(() => {
           user_answer.push({
           user_answer.push({
             select_tone: null,
             select_tone: null,
             select_letter: '',
             select_letter: '',
             select_index: '',
             select_index: '',
           });
           });
+          user_submit.push('');
         });
         });
         let obj = {
         let obj = {
           item_con: con_arr,
           item_con: con_arr,
@@ -167,6 +176,13 @@ export default {
           item_active_index: 0,
           item_active_index: 0,
           active_letter: '',
           active_letter: '',
         };
         };
+        if (!this.isJudgingRightWrong) {
+          let obj = {
+            mark: item.mark,
+            value: user_submit,
+          };
+          this.answer.answer_list.push(obj);
+        }
         this.con_preview.push(obj);
         this.con_preview.push(obj);
       });
       });
     },
     },