Browse Source

可配置表格和表头分离表格录入和预览修改增加答案配置,正确错误统计,正确错误增加标识,
连线带图片bug,图片模板输入修改为按空计算

qinpeng 2 years ago
parent
commit
37a60fddd5

+ 15 - 2
src/components/Adult/inputModules/ConfigurableTable/components/CellEdit.vue

@@ -34,7 +34,12 @@
       </el-form-item>
     </el-form>
     <div class="dialog-container">
-      <el-input v-if="cellData.type === 'content'" v-model="cellData.text" />
+      <template v-if="cellData.type === 'content'">
+        <div>内容</div>
+        <el-input v-model="cellData.text" />
+        <div>答案</div>
+        <el-input v-model="cellData.answer" />
+      </template>
 
       <sentence-segword-chs
         v-else-if="cellData.type === 'pinyin'"
@@ -51,6 +56,9 @@
         <el-input v-model="cellData.text">
           <template slot="prepend">内容</template>
         </el-input>
+         <el-input v-model="cellData.answer">
+          <template slot="prepend">答案</template>
+        </el-input>
       </template>
 
       <template v-else-if="cellData.type === 'twoAnnotation'">
@@ -76,6 +84,10 @@
           :is-hide-py-position="true"
         />
       </template>
+      <template v-if="cellData.isCross">
+        <div>勾叉答案</div>
+        <CrossTick :cellData="cellData" />
+      </template>
     </div>
     <div slot="footer">
       <el-button type="primary" @click="confirm">确定</el-button>
@@ -85,9 +97,10 @@
 
 <script>
 import SentenceSegwordChs from "@/components/Adult/inputModules/SentenceSegwordChs/index.vue";
+import CrossTick from "./CrossTick.vue";
 
 export default {
-  components: { SentenceSegwordChs },
+  components: { SentenceSegwordChs, CrossTick },
   props: {
     visible: {
       type: Boolean,

+ 46 - 0
src/components/Adult/inputModules/ConfigurableTable/components/CrossTick.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="cross-tick" @click="toggle">
+    <i
+      :class="[
+        { 'el-icon-check': status === statusList[1] },
+        { 'el-icon-close': status === statusList[2] },
+      ]"
+    />
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["cellData"],
+  data() {
+    return {
+      status: "normal",
+      statusList: ["normal", "tick", "cross"],
+    };
+  },
+  methods: {
+    toggle() {
+      const index = this.statusList.findIndex((item) => this.status === item);
+      this.status =
+        index === this.statusList.length - 1
+          ? this.statusList[0]
+          : this.statusList[index + 1];
+      this.cellData.CrossAnswer = this.status;
+      this.$forceUpdate();
+    },
+  },
+  created() {
+    this.status = this.cellData.CrossAnswer;
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.cross-tick {
+  height: 18px;
+  min-width: 18px;
+  width: 18px;
+  border: 1px solid #999;
+  cursor: pointer;
+}
+</style>

+ 2 - 0
src/components/Adult/inputModules/ConfigurableTable/index.vue

@@ -147,6 +147,8 @@ export default {
                     isUnderline: false,
                     background: "#fff",
                     isCross: false,
+                    answer: "",
+                    CrossAnswer: "normal",
                     rowspan: 1,
                     colspan: 1,
                     sentence_data: {

+ 13 - 2
src/components/Adult/inputModules/HeaderSeparate/components/CellEdit.vue

@@ -34,7 +34,12 @@
       </el-form-item>
     </el-form>
     <div class="dialog-container">
-      <el-input v-show="cellData.type === 'content'" v-model="cellData.text" />
+      <template v-if="cellData.type === 'content'">
+        <div>内容</div>
+        <el-input v-model="cellData.text" />
+        <div>答案</div>
+        <el-input v-model="cellData.answer" />
+      </template>
 
       <SentenceSegwordChs
         v-if="cellData.type === 'pinyin'"
@@ -59,6 +64,11 @@
           :is-hide-py-position="true"
         />
       </template>
+
+      <template v-if="cellData.isCross">
+        <div>勾叉答案</div>
+        <CrossTick :cellData="cellData" />
+      </template>
     </div>
     <div slot="footer">
       <el-button type="primary" @click="confirm">确定</el-button>
@@ -68,9 +78,10 @@
 
 <script>
 import SentenceSegwordChs from "@/components/Adult/inputModules/SentenceSegwordChs/index.vue";
+import CrossTick from "./CrossTick.vue";
 
 export default {
-  components: { SentenceSegwordChs },
+  components: { SentenceSegwordChs, CrossTick },
   props: {
     visible: {
       type: Boolean,

+ 46 - 0
src/components/Adult/inputModules/HeaderSeparate/components/CrossTick.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="cross-tick" @click="toggle">
+    <i
+      :class="[
+        { 'el-icon-check': status === statusList[1] },
+        { 'el-icon-close': status === statusList[2] },
+      ]"
+    />
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["cellData"],
+  data() {
+    return {
+      status: "normal",
+      statusList: ["normal", "tick", "cross"],
+    };
+  },
+  methods: {
+    toggle() {
+      const index = this.statusList.findIndex((item) => this.status === item);
+      this.status =
+        index === this.statusList.length - 1
+          ? this.statusList[0]
+          : this.statusList[index + 1];
+      this.cellData.CrossAnswer = this.status;
+      this.$forceUpdate();
+    },
+  },
+  created() {
+    this.status = this.cellData.CrossAnswer;
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.cross-tick {
+  height: 18px;
+  min-width: 18px;
+  width: 18px;
+  border: 1px solid #999;
+  cursor: pointer;
+}
+</style>

+ 6 - 0
src/components/Adult/inputModules/HeaderSeparate/index.vue

@@ -141,6 +141,8 @@ export default {
                     isUnderline: false, // 下划线
                     background: "#fff", // 背景色
                     isCross: false, // 勾叉
+                    answer: "",
+                    CrossAnswer: "normal",
                     rowspan: 1,
                     colspan: 1,
                     sentence_data: {
@@ -161,6 +163,8 @@ export default {
                     isUnderline: false,
                     background: "#fff",
                     isCross: false,
+                    answer: "",
+                    CrossAnswer: "normal",
                     rowspan: 1,
                     colspan: 1,
                     sentence_data: {
@@ -181,6 +185,8 @@ export default {
                     isUnderline: false,
                     background: "#fff",
                     isCross: false,
+                    answer: "",
+                    CrossAnswer: "normal",
                     rowspan: 1,
                     colspan: 1,
                     sentence_data: {

+ 166 - 20
src/components/Adult/preview/ConfigurableTable.vue

@@ -1,5 +1,22 @@
 <template>
-  <div class="config-table">
+  <div
+    class="config-table"
+    v-if="judgeAnswer == 'standardAnswer' ? (userError ? true : false) : true"
+  >
+    <h6
+      v-if="judgeAnswer == 'userAnswer' || judgeAnswer == 'studentAnswer'"
+      class="standardTitle"
+      style="margin: 10px 0 8px 24px"
+    >
+      {{ judgeAnswer == "userAnswer" ? "Your answer" : "Student answers" }}
+    </h6>
+    <h6
+      v-else-if="judgeAnswer == 'standardAnswer'"
+      class="standardTitle"
+      style="margin: 10px 0 8px 24px"
+    >
+      Standard answer
+    </h6>
     <table
       :style="{
         'box-shadow': `${
@@ -55,7 +72,16 @@
               :key="`td-${i}-${j}`"
               :colspan="col.colspan"
               :rowspan="col.rowspan"
-              :class="[{ underline: col.isUnderline }]"
+              :class="[
+                { underline: col.isUnderline },
+                judgeAnswer == 'standardAnswer' ? 'correct' : '',
+                judgeAnswer == 'studentAnswer'
+                  ? curQue.Bookanswer[i].content[j].userAnswerJudge ==
+                    '[JUDGE##T##JUDGE]'
+                    ? 'correct'
+                    : 'error'
+                  : '',
+              ]"
               :style="{ 'background-color': `${col.background}` }"
             >
               <div class="cell-wrap">
@@ -65,12 +91,16 @@
                   </span>
                   <template v-else>
                     <el-input
-                      v-model="col.answer"
+                      v-model="
+                        judgeAnswer == 'standardAnswer'
+                          ? col.answer
+                          : curQue.Bookanswer[i].content[j].answer
+                      "
                       type="textarea"
                       :placeholder="`${isAnswerMode ? '' : '输入'}`"
                       :disabled="isAnswerMode"
                       :autosize="{ minRows: 1, maxRows: 6 }"
-                      @input="enterAnswer(i, j, $event)"
+                      @input="enterAnswer(i, j, 'input')"
                     />
                   </template>
                 </template>
@@ -82,12 +112,16 @@
                   </template>
                   <template v-else>
                     <el-input
-                      v-model="col.answer"
+                      v-model="
+                        judgeAnswer == 'standardAnswer'
+                          ? col.answer
+                          : curQue.Bookanswer[i].content[j].answer
+                      "
                       type="textarea"
                       :placeholder="`${isAnswerMode ? '' : '输入'}`"
                       :disabled="isAnswerMode"
                       :autosize="{ minRows: 1, maxRows: 6 }"
-                      @input="enterAnswer(i, j, $event)"
+                      @input="enterAnswer(i, j, 'input')"
                     />
                   </template>
                 </div>
@@ -201,7 +235,18 @@
                   </div>
                 </div>
 
-                <CrossTick v-if="col.isCross" />
+                <CrossTick
+                  v-if="col.isCross"
+                  :index="i"
+                  :indexs="j"
+                  :data="
+                    judgeAnswer == 'standardAnswer'
+                      ? col
+                      : curQue.Bookanswer[i].content[j]
+                  "
+                  :isAnswerMode="isAnswerMode"
+                  @enterAnswer="enterAnswer"
+                />
               </div>
             </td>
           </template>
@@ -225,10 +270,14 @@ export default {
       type: String,
       required: true,
     },
+    judgeAnswer: {
+      type: String,
+    },
   },
   data() {
     return {
       isAnswerMode: false,
+      userError: false,
     };
   },
   computed: {
@@ -260,24 +309,89 @@ export default {
     },
   },
   created() {
-    const Bookanswer = this.curQue.Bookanswer;
-    if (Bookanswer) {
+    if (this.judgeAnswer) {
       this.isAnswerMode = true;
-      for (const key in Bookanswer) {
-        let { col, row, value } = Bookanswer[key];
-        this.curQue.tableData.body[col].content[row].answer = value;
-      }
+    }
+    if (!this.curQue.Bookanswer) {
+      let arr = [];
+      this.curQue.tableData.body.forEach((item, i) => {
+        arr.push({
+          content: [],
+        });
+        item.content.forEach((items) => {
+          arr[i].content.push({
+            answer: "",
+            CrossAnswer: "",
+            userAnswerJudge:
+              items.answer || items.isCross ? "[JUDGE##F##JUDGE]" : "",
+          });
+        });
+      });
+      this.$set(this.curQue, "Bookanswer", arr);
     } else {
-      this.$set(this.curQue, "Bookanswer", {});
+      this.curQue.Bookanswer.forEach((item) => {
+        item.content.forEach((item) => {
+          if (item.userAnswerJudge == "[JUDGE##F##JUDGE]") {
+            this.userError = true;
+            return;
+          }
+        });
+      });
     }
   },
   methods: {
-    enterAnswer(i, j, value) {
-      this.curQue.Bookanswer[`${i}-${j}`] = {
-        col: i,
-        row: j,
-        value,
-      };
+    enterAnswer(i, j, type) {
+      if (type == "input") {
+        if (
+          this.curQue.Bookanswer[i].content[j].answer ==
+          this.curQue.tableData.body[i].content[j].answer
+        ) {
+          if (this.curQue.tableData.body[i].content[j].isCross) {
+            if (
+              this.curQue.Bookanswer[i].content[j].CrossAnswer ==
+              this.curQue.tableData.body[i].content[j].CrossAnswer
+            ) {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##T##JUDGE]";
+            } else {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##F##JUDGE]";
+            }
+          } else {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##T##JUDGE]";
+          }
+        } else {
+          if (this.curQue.tableData.body[i].content[j].answer) {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##F##JUDGE]";
+          }
+        }
+      } else {
+        if (
+          this.curQue.Bookanswer[i].content[j].CrossAnswer ==
+          this.curQue.tableData.body[i].content[j].CrossAnswer
+        ) {
+          if (this.curQue.tableData.body[i].content[j].answer) {
+            if (
+              this.curQue.Bookanswer[i].content[j].answer ==
+              this.curQue.tableData.body[i].content[j].answer
+            ) {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##T##JUDGE]";
+            } else {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##F##JUDGE]";
+            }
+          } else {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##T##JUDGE]";
+          }
+        } else {
+          this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+            "[JUDGE##F##JUDGE]";
+        }
+      }
     },
     // th 是否生成
     thIsShow(i, j) {
@@ -442,3 +556,35 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+.config-table {
+  .correct {
+    .el-textarea.is-disabled .el-textarea__inner {
+      color: #2ca767 !important;
+    }
+    .cross-tick {
+      border-color: #2ca767 !important;
+      .el-icon-check:before {
+        color: #2ca767 !important;
+      }
+      .el-icon-close:before {
+        color: #2ca767 !important;
+      }
+    }
+  }
+  .error {
+    .el-textarea.is-disabled .el-textarea__inner {
+      color: #ed342d !important;
+    }
+    .cross-tick {
+      border-color: #ed342d !important;
+      .el-icon-check:before {
+        color: #ed342d !important;
+      }
+      .el-icon-close:before {
+        color: #ed342d !important;
+      }
+    }
+  }
+}
+</style>

+ 9 - 0
src/components/Adult/preview/HeaderSparate/CrossTick.vue

@@ -11,6 +11,7 @@
 
 <script>
 export default {
+  props: ["data", "index", "indexs", "isAnswerMode"],
   data() {
     return {
       status: "normal",
@@ -19,13 +20,21 @@ export default {
   },
   methods: {
     toggle() {
+      if (this.isAnswerMode) {
+        return;
+      }
       const index = this.statusList.findIndex((item) => this.status === item);
       this.status =
         index === this.statusList.length - 1
           ? this.statusList[0]
           : this.statusList[index + 1];
+      this.data.CrossAnswer = this.status;
+      this.$emit("enterAnswer", this.index, this.indexs, "Cross");
     },
   },
+  created() {
+    this.status = this.data.CrossAnswer;
+  },
 };
 </script>
 

+ 157 - 17
src/components/Adult/preview/HeaderSparate/index.vue

@@ -1,5 +1,22 @@
 <template>
-  <div class="header-separate">
+  <div
+    class="header-separate"
+    v-if="judgeAnswer == 'standardAnswer' ? (userError ? true : false) : true"
+  >
+    <h6
+      v-if="judgeAnswer == 'userAnswer' || judgeAnswer == 'studentAnswer'"
+      class="standardTitle"
+      style="margin: 10px 0 8px 24px"
+    >
+      {{ judgeAnswer == "userAnswer" ? "Your answer" : "Student answers" }}
+    </h6>
+    <h6
+      v-else-if="judgeAnswer == 'standardAnswer'"
+      class="standardTitle"
+      style="margin: 10px 0 8px 24px"
+    >
+      Standard answer
+    </h6>
     <table>
       <colgroup>
         <col
@@ -40,6 +57,13 @@
               :class="[
                 { underline: col.isUnderline },
                 `${curQue.firstColAligin === 'center' ? 'col-center' : ''}`,
+                judgeAnswer == 'standardAnswer' ? 'correct' : '',
+                judgeAnswer == 'studentAnswer'
+                  ? curQue.Bookanswer[i].content[j].userAnswerJudge ==
+                    '[JUDGE##T##JUDGE]'
+                    ? 'correct'
+                    : 'error'
+                  : '',
               ]"
               :style="{
                 'background-color': `${col.background}`,
@@ -53,12 +77,16 @@
                   </span>
                   <template v-else>
                     <el-input
-                      v-model="col.answer"
+                      v-model="
+                        judgeAnswer == 'standardAnswer'
+                          ? col.answer
+                          : curQue.Bookanswer[i].content[j].answer
+                      "
                       type="textarea"
                       :placeholder="`${isAnswerMode ? '' : '输入'}`"
                       :disabled="isAnswerMode"
                       :autosize="{ minRows: 1, maxRows: 6 }"
-                      @input="enterAnswer(i, j, $event)"
+                      @input="enterAnswer(i, j, 'input')"
                     />
                   </template>
                 </template>
@@ -156,7 +184,18 @@
                     </span>
                   </div>
                 </div>
-                <CrossTick v-if="col.isCross" />
+                <CrossTick
+                  v-if="col.isCross"
+                  :index="i"
+                  :indexs="j"
+                  :data="
+                    judgeAnswer == 'standardAnswer'
+                      ? col
+                      : curQue.Bookanswer[i].content[j]
+                  "
+                  :isAnswerMode="isAnswerMode"
+                  @enterAnswer="enterAnswer"
+                />
               </div>
             </td>
           </template>
@@ -180,10 +219,14 @@ export default {
       type: String,
       required: true,
     },
+    judgeAnswer: {
+      type: String,
+    },
   },
   data() {
     return {
       isAnswerMode: false,
+      userError: false,
     };
   },
   computed: {
@@ -240,24 +283,89 @@ export default {
     },
   },
   created() {
-    const Bookanswer = this.curQue.Bookanswer;
-    if (Bookanswer) {
+    if (this.judgeAnswer) {
       this.isAnswerMode = true;
-      for (const key in Bookanswer) {
-        let { col, row, value } = Bookanswer[key];
-        this.curQue.tableData.body[col].content[row].answer = value;
-      }
+    }
+    if (!this.curQue.Bookanswer) {
+      let arr = [];
+      this.curQue.tableData.body.forEach((item, i) => {
+        arr.push({
+          content: [],
+        });
+        item.content.forEach((items) => {
+          arr[i].content.push({
+            answer: "",
+            CrossAnswer: "",
+            userAnswerJudge:
+              items.answer || items.isCross ? "[JUDGE##F##JUDGE]" : "",
+          });
+        });
+      });
+      this.$set(this.curQue, "Bookanswer", arr);
     } else {
-      this.$set(this.curQue, "Bookanswer", {});
+      this.curQue.Bookanswer.forEach((item) => {
+        item.content.forEach((item) => {
+          if (item.userAnswerJudge == "[JUDGE##F##JUDGE]") {
+            this.userError = true;
+            return;
+          }
+        });
+      });
     }
   },
   methods: {
-    enterAnswer(i, j, value) {
-      this.curQue.Bookanswer[`${i}-${j}`] = {
-        col: i,
-        row: j,
-        value,
-      };
+    enterAnswer(i, j, type) {
+      if (type == "input") {
+        if (
+          this.curQue.Bookanswer[i].content[j].answer ==
+          this.curQue.tableData.body[i].content[j].answer
+        ) {
+          if (this.curQue.tableData.body[i].content[j].isCross) {
+            if (
+              this.curQue.Bookanswer[i].content[j].CrossAnswer ==
+              this.curQue.tableData.body[i].content[j].CrossAnswer
+            ) {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##T##JUDGE]";
+            } else {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##F##JUDGE]";
+            }
+          } else {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##T##JUDGE]";
+          }
+        } else {
+          if (this.curQue.tableData.body[i].content[j].answer) {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##F##JUDGE]";
+          }
+        }
+      } else {
+        if (
+          this.curQue.Bookanswer[i].content[j].CrossAnswer ==
+          this.curQue.tableData.body[i].content[j].CrossAnswer
+        ) {
+          if (this.curQue.tableData.body[i].content[j].answer) {
+            if (
+              this.curQue.Bookanswer[i].content[j].answer ==
+              this.curQue.tableData.body[i].content[j].answer
+            ) {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##T##JUDGE]";
+            } else {
+              this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+                "[JUDGE##F##JUDGE]";
+            }
+          } else {
+            this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+              "[JUDGE##T##JUDGE]";
+          }
+        } else {
+          this.curQue.Bookanswer[i].content[j].userAnswerJudge =
+            "[JUDGE##F##JUDGE]";
+        }
+      }
     },
     // 控制首尾表格显隐
     tdHeaderIsNone(i, j) {
@@ -472,3 +580,35 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+.header-separate {
+  .correct {
+    .el-textarea.is-disabled .el-textarea__inner {
+      color: #2ca767 !important;
+    }
+    .cross-tick {
+      border-color: #2ca767 !important;
+      .el-icon-check:before {
+        color: #2ca767 !important;
+      }
+      .el-icon-close:before {
+        color: #2ca767 !important;
+      }
+    }
+  }
+  .error {
+    .el-textarea.is-disabled .el-textarea__inner {
+      color: #ed342d !important;
+    }
+    .cross-tick {
+      border-color: #ed342d !important;
+      .el-icon-check:before {
+        color: #ed342d !important;
+      }
+      .el-icon-close:before {
+        color: #ed342d !important;
+      }
+    }
+  }
+}
+</style>

+ 9 - 0
src/components/Adult/preview/Ligature.vue

@@ -480,6 +480,15 @@ export default {
           }
         });
       }
+      this.clearLine();
+      if (this.data.data.length > 0) {
+        this.data.data.forEach((item) => {
+          this.jsPlumb.connect({
+            source: item.source,
+            target: item.target,
+          });
+        });
+      }
     },
     // 判断是否全对
     changeAllCorrect() {

+ 49 - 27
src/components/Adult/preview/Picture.vue

@@ -525,23 +525,37 @@ export default {
           //单输入
           if (_this.ChildType == "image_input") {
             let obj = {
-              input: [{ value: "" }],
-              userAnswerJudge:
-                item.input[0] || item.input[0] === 0 ? "[JUDGE##F##JUDGE]" : "",
+              input: [
+                {
+                  value: "",
+                  userAnswerJudge:
+                    item.input[0] || item.input[0] === 0
+                      ? "[JUDGE##F##JUDGE]"
+                      : "",
+                },
+              ],
             };
             _this.userAnswer.input = JSON.parse(JSON.stringify(obj));
           }
           //双输入
           if (_this.ChildType == "image_dobleinput") {
             let obj = {
-              input: [{ value: "" }, { value: "" }],
-              userAnswerJudge:
-                item.input[0] ||
-                item.input[0] === 0 ||
-                item.input[1] ||
-                item.input[1] === 0
-                  ? "[JUDGE##F##JUDGE]"
-                  : "",
+              input: [
+                {
+                  value: "",
+                  userAnswerJudge:
+                    item.input[0] || item.input[0] === 0
+                      ? "[JUDGE##F##JUDGE]"
+                      : "",
+                },
+                {
+                  value: "",
+                  userAnswerJudge:
+                    item.input[1] || item.input[1] === 0
+                      ? "[JUDGE##F##JUDGE]"
+                      : "",
+                },
+              ],
             };
             this.userAnswer.input = JSON.parse(JSON.stringify(obj));
           }
@@ -623,26 +637,34 @@ export default {
           let answer = this.curQue.Bookanswer[0][key].input[index].value;
           if (item) {
             if (item != answer) {
-              hasError = true;
+              this.$set(
+                this.curQue.Bookanswer[0][key].input[index],
+                "userAnswerJudge",
+                "[JUDGE##F##JUDGE]"
+              );
             } else {
-              hasRight = true;
+              this.$set(
+                this.curQue.Bookanswer[0][key].input[index],
+                "userAnswerJudge",
+                "[JUDGE##T##JUDGE]"
+              );
             }
           }
         });
-        if (hasError) {
-          this.$set(
-            this.curQue.Bookanswer[0][key],
-            "userAnswerJudge",
-            "[JUDGE##F##JUDGE]"
-          );
-        }
-        if (!hasError && hasRight) {
-          this.$set(
-            this.curQue.Bookanswer[0][key],
-            "userAnswerJudge",
-            "[JUDGE##T##JUDGE]"
-          );
-        }
+        // if (hasError) {
+        //   this.$set(
+        //     this.curQue.Bookanswer[0][key],
+        //     "userAnswerJudge",
+        //     "[JUDGE##F##JUDGE]"
+        //   );
+        // }
+        // if (!hasError && hasRight) {
+        //   this.$set(
+        //     this.curQue.Bookanswer[0][key],
+        //     "userAnswerJudge",
+        //     "[JUDGE##T##JUDGE]"
+        //   );
+        // }
       } else {
         this.curQue.Bookanswer[0][key] = this.curQue.Bookanswer[0][key].trim();
       }

+ 2 - 2
src/views/courseView.vue

@@ -56,7 +56,7 @@
           :is-show-title="true"
           :book-answer-content="bookAnswerContent"
           :task-model="TaskModel"
-          :is-show-save="false"
+          :is-show-save="true"
           @finishTaskMaterial="finishTaskMaterial"
         />
       </div>
@@ -109,7 +109,7 @@ export default {
           ],
         },
       ],
-      bookAnswerContent: '',
+      bookAnswerContent: '[{"table_list":[[{"data":{"Bookanswer":[{"input":{"input":[{"value":"picture","userAnswerJudge":"[JUDGE##T##JUDGE]"}]},"judge":[],"single":[],"checkBox":[],"recordList":[]}]}}],[{"data":{"Bookanswer":[{"input":{"input":[{"value":"","userAnswerJudge":""}]},"judge":[],"single":[],"checkBox":[],"recordList":[]}]}}],[{"data":{"Bookanswer":[{"input":{"input":[{"value":"","userAnswerJudge":"[JUDGE##F##JUDGE]"}]},"judge":[],"single":[],"checkBox":[],"recordList":[]}]}}],[{"data":{"Bookanswer":[{"input":{"input":[{"value":"您","userAnswerJudge":"[JUDGE##T##JUDGE]"},{"value":"不好","userAnswerJudge":"[JUDGE##F##JUDGE]"}]},"judge":[],"single":[],"checkBox":[],"recordList":[]}]}}]]}]',
       TaskModel: "", // TEST 考试模式; PRACTICE 练习模式; ANSWER 查看答案模式; 空 预览模式
       category: "",
       FatherTreeData: null,