Browse Source

fix: 修改判断题的选项值(和eval统一)

Leonezhurui 3 years ago
parent
commit
65abc6129d

+ 1 - 1
src/components/QuestionCreater.vue

@@ -245,7 +245,7 @@
                 this.question.knowledgeId.push(this.myknowledgeId);
                 this.question.createdTime = new Date();
                 this.question.state = "CHECKING";
-                this.question.checkedUserId = 364; //这里是审核人的ID
+                this.question.checkedUserId = 364; //TODO 这里是审核人的ID
                 this.question.savedUserId = store.state.user.id;
                 let record = {
                     userId: store.state.user.id,

+ 11 - 4
src/components/QuestionCreator/SingleQuestionCreator.vue

@@ -57,7 +57,7 @@
           </template>
         </el-input>
         <el-radio v-for="option in trueFalse_options" v-if="form.type === 5" v-model="form.answer" :label="option" border>
-          {{option}}
+          {{formatTrueFalse(option)}}
         </el-radio>
       </el-form-item>
       <el-form-item label="解析">
@@ -146,9 +146,9 @@ export default {
         tags: "",
         keyPoints: "",
       },
-      trueFalse_options: [
-          "正确",
-          "错误",
+      trueFalse_options: [ // 和 eval 系统统一,使用 true 和 false
+          "true",
+          "false",
       ],
       knowledgeIdOptions: knowledgeData,
       dialogVisible: false,
@@ -531,6 +531,13 @@ export default {
         keyPoints: questionVO.keyPoints,
       }
     },
+    formatTrueFalse(option) {
+      if (option === 'true') {
+        return '正确';
+      } else {
+        return '错误';
+      }
+    }
   },
   watch: {
     'form.type': function (){