dsy 20 timmar sedan
förälder
incheckning
4b7a9191be
20 ändrade filer med 193 tillägg och 159 borttagningar
  1. 1 11
      src/components/CommonPreview.vue
  2. 0 14
      src/courseware_preview/index.vue
  3. 12 8
      src/views/book/courseware/preview/common/AnswerCorrect.vue
  4. 19 5
      src/views/book/courseware/preview/common/PreviewOperation.vue
  5. 5 1
      src/views/book/courseware/preview/components/character/CharacterPreview.vue
  6. 4 1
      src/views/book/courseware/preview/components/character_structure/CharacterStructurePreview.vue
  7. 12 3
      src/views/book/courseware/preview/components/common/PreviewMixin.js
  8. 70 82
      src/views/book/courseware/preview/components/fill/FillPreview.vue
  9. 9 1
      src/views/book/courseware/preview/components/image_text/ImageTextPreview.vue
  10. 4 1
      src/views/book/courseware/preview/components/input/InputPreview.vue
  11. 4 1
      src/views/book/courseware/preview/components/judge/JudgePreview.vue
  12. 4 1
      src/views/book/courseware/preview/components/matching/MatchingPreview.vue
  13. 4 1
      src/views/book/courseware/preview/components/newWord_template/NewWordTemplatePreview.vue
  14. 5 1
      src/views/book/courseware/preview/components/pinyin_base/PinyinBasePreview.vue
  15. 4 0
      src/views/book/courseware/preview/components/record_input/RecordInputPreview.vue
  16. 4 1
      src/views/book/courseware/preview/components/select/SelectPreview.vue
  17. 4 1
      src/views/book/courseware/preview/components/sort/SortPreview.vue
  18. 23 10
      src/views/book/courseware/preview/components/table/TablePreview.vue
  19. 4 1
      src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue
  20. 1 15
      src/web_preview/index.vue

+ 1 - 11
src/components/CommonPreview.vue

@@ -11,7 +11,6 @@
         <div class="group">
           <el-checkbox v-model="isShowGroup">显示分组</el-checkbox>
           <el-checkbox v-model="groupShowAll">分组显示全部</el-checkbox>
-          <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
         </div>
         <span class="link">
           <el-select v-model="lang" placeholder="请选择语言" size="mini" class="lang-select">
@@ -284,7 +283,6 @@ export default {
       langList: [],
       lang: 'ZH',
       chinese: 'zh-Hans',
-      isJudgeCorrect: false,
     };
   },
   computed: {
@@ -295,11 +293,7 @@ export default {
       return this.file_list.length >= this.total_count && this.total_count > 0;
     },
   },
-  watch: {
-    isJudgeCorrect(newVal) {
-      this.simulateAnswer(newVal);
-    },
-  },
+  watch: {},
   created() {
     if (this.id) {
       this.getBookCoursewareInfo(this.id);
@@ -605,10 +599,6 @@ export default {
       }
       return text;
     },
-
-    simulateAnswer(disabled = true) {
-      this.$refs.courseware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
-    },
   },
 };
 </script>

+ 0 - 14
src/courseware_preview/index.vue

@@ -24,7 +24,6 @@
         <img class="fullscreen" :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" @click="fullScreen" />
         <div class="operator">
           <slot name="operator" :courseware="courseware_info"></slot>
-          <el-checkbox v-model="isJudgeCorrect" :disabled="!permissionControl.can_judge_correct">判断对错</el-checkbox>
           <span class="link" @click="confirmAnswer()">提交答案</span>
           <span class="link" @click="getAnswer()">读取答案</span>
           <span class="link" @click="confirmCorrect()">提交批改</span>
@@ -240,7 +239,6 @@ export default {
       langList: [],
       lang: 'ZH',
       chinese: 'zh-Hans',
-      isJudgeCorrect: false,
       unified_attrib: {},
       curSelectId: this.id,
       sidebarShow: true,
@@ -302,9 +300,6 @@ export default {
     },
   },
   watch: {
-    isJudgeCorrect() {
-      this.simulateAnswer();
-    },
     curSelectId() {
       if (this.curToolbarIcon === 'note') {
         this.getNote();
@@ -802,14 +797,6 @@ export default {
     },
 
     /**
-     * 模拟答题
-     * @param {boolean} [disabled=true] - 是否禁用
-     */
-    simulateAnswer(disabled = true) {
-      this.$refs.courseware.simulateAnswer(this.isJudgeCorrect, false, disabled);
-    },
-
-    /**
      * 选择节点
      * @param {string} nodeId - 节点ID
      * @param {boolean} isLeaf - 是否是叶子节点
@@ -1062,7 +1049,6 @@ export default {
     },
     getAnswer() {
       this.$refs.courseware.getAnswer({ task_id: this.task_id, user_id: this.user_id, courseware_id: this.id });
-      this.isJudgeCorrect = true;
     },
     confirmCorrect() {
       this.$refs.courseware.saveAnswerMarking({

+ 12 - 8
src/views/book/courseware/preview/common/AnswerCorrect.vue

@@ -2,19 +2,14 @@
 <template>
   <el-dialog
     v-dialogDrag
-    title="批改"
+    :title="title"
     custom-class="answer-correct-dialog"
     :visible="visible"
     width="40vw"
     :close-on-click-modal="false"
     :before-close="handleClose"
   >
-    <RichText
-      v-if="!permissionControl.can_check_correct"
-      ref="richText"
-      v-model="correct"
-      placeholder="请输入批改内容"
-    />
+    <RichText v-if="!isCheckCorrect" ref="richText" v-model="correct" placeholder="请输入批改内容" />
     <div v-else class="rich-text" v-html="sanitizeHTML(correct)"></div>
 
     <div slot="footer" class="dialog-footer">
@@ -44,6 +39,10 @@ export default {
       type: String,
       default: '',
     },
+    isCheckCorrect: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -55,6 +54,9 @@ export default {
     permissionControl() {
       return this.getPermissionControl();
     },
+    title() {
+      return this.isCheckCorrect ? '查看批改' : '批改';
+    },
   },
   watch: {
     answerCorrect: {
@@ -69,7 +71,9 @@ export default {
       this.$emit('update:visible', false);
     },
     confirm() {
-      this.$emit('closeAnswerCorrect', this.correct);
+      if (!this.isCheckCorrect) {
+        this.$emit('closeAnswerCorrect', this.correct);
+      }
       this.handleClose();
     },
   },

+ 19 - 5
src/views/book/courseware/preview/common/PreviewOperation.vue

@@ -1,16 +1,19 @@
 <template>
   <div class="operation">
+    <!-- 重做 -->
     <div v-show="permissionControl.can_answer" class="button retry" @click="retry()"></div>
-    <div
-      v-show="permissionControl.can_correct || permissionControl.can_check_correct"
-      class="button correct"
-      @click="openAnswerCorrect()"
-    ></div>
+    <!-- 判断对错 -->
+    <div v-show="permissionControl.can_judge_correct" class="button correct" @click="judgeCorrect"></div>
+    <!-- 查看答案 -->
     <div
       v-show="permissionControl.can_show_answer && isShowAnswer"
       class="button answer"
       @click="showAnswerAnalysis()"
     ></div>
+    <!-- 批改 -->
+    <div v-show="permissionControl.can_correct" class="button remark" @click="openAnswerCorrect(false)"></div>
+    <!-- 查看批改 -->
+    <div v-show="permissionControl.can_check_correct" class="button view-remark" @click="openAnswerCorrect(true)"></div>
   </div>
 </template>
 
@@ -46,6 +49,9 @@ export default {
     retry() {
       this.$emit('retry');
     },
+    judgeCorrect() {
+      this.$emit('judgeCorrect');
+    },
   },
 };
 </script>
@@ -78,6 +84,14 @@ export default {
     &.answer {
       background: url('@/assets/component/component-answer.png') no-repeat center;
     }
+
+    &.remark {
+      background: url('@/assets/component/component-remark.png') no-repeat center;
+    }
+
+    &.view-remark {
+      background: url('@/assets/component/component-view-remark.png') no-repeat center;
+    }
   }
 }
 </style>

+ 5 - 1
src/views/book/courseware/preview/components/character/CharacterPreview.vue

@@ -421,13 +421,15 @@
       />
       <PreviewOperation
         v-if="data.property.model === 'miao'"
+        :is-show-answer="isShowAnswers"
         @showAnswerAnalysis="showAnswerAnalysis"
+        @judgeCorrect="judgeCorrect"
         @retry="retry"
-        :isShowAnswer="isShowAnswers"
       />
       <AnswerCorrect
         :answer-correct="data?.answer_correct"
         :visible.sync="visibleAnswerCorrect"
+        :is-check-correct="isCheckCorrect"
         @closeAnswerCorrect="closeAnswerCorrect"
       />
       <AnswerAnalysis
@@ -638,6 +640,8 @@ export default {
     retry() {
       this.handleData();
       this.handleWav([]);
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.$refs.record.handleReset();
     },
     /**

+ 4 - 1
src/views/book/courseware/preview/components/character_structure/CharacterStructurePreview.vue

@@ -161,10 +161,11 @@
           </div>
         </div>
       </div>
-      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
       <AnswerCorrect
         :answer-correct="data?.answer_correct"
         :visible.sync="visibleAnswerCorrect"
+        :is-check-correct="isCheckCorrect"
         @closeAnswerCorrect="closeAnswerCorrect"
       />
       <AnswerAnalysis
@@ -399,6 +400,8 @@ export default {
     },
     // 重做
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.handleData([]);
     },
     /**

+ 12 - 3
src/views/book/courseware/preview/components/common/PreviewMixin.js

@@ -23,11 +23,12 @@ const mixin = {
       visibleAnswerAnalysis: false, // 是否显示答案解析弹窗
       answerAnalysisState: null, // 答案解析弹窗前的状态快照
       visibleAnswerCorrect: false, // 是否显示批改弹窗
+      isCheckCorrect: false, // 是否查看批改信息
     };
   },
   provide() {
     return {
-      openAnswerCorrect: () => this.openAnswerCorrect(),
+      openAnswerCorrect: (isCheckCorrect) => this.openAnswerCorrect(isCheckCorrect),
     };
   },
   inject: ['getLang', 'getChinese', 'convertText', 'getTitleList', 'getPermissionControl'],
@@ -146,6 +147,10 @@ const mixin = {
       this.disabled = disabled;
       if (userAnswer) this.answer = userAnswer;
     },
+    judgeCorrect() {
+      this.isJudgingRightWrong = true;
+      this.isShowRightAnswer = false;
+    },
     /**
      * 获取批改信息
      * @returns {string} 批改信息
@@ -283,9 +288,13 @@ const mixin = {
         this.isShowRightAnswer = false;
       }
     },
-    // 显示批改页面
-    openAnswerCorrect() {
+    /**
+     * 显示批改页面
+     * @param {boolean} isCheckCorrect 是否查看批改
+     */
+    openAnswerCorrect(isCheckCorrect) {
       this.visibleAnswerCorrect = true;
+      this.isCheckCorrect = isCheckCorrect;
     },
     /**
      * @description 关闭批改页面,并传递批改信息

+ 70 - 82
src/views/book/courseware/preview/components/fill/FillPreview.vue

@@ -10,25 +10,25 @@
         :file-id="data.audio_file_id"
       />
       <div class="fill-wrapper">
-        <p v-for="(item, i) in modelEssay" :key="i">
-          <template v-for="(li, j) in item">
+        <p>
+          <template v-for="(li, i) in modelEssay">
             <template v-if="li.type === 'text'">
               <PinyinText
                 v-if="isEnable(data.property.view_pinyin)"
-                :key="`${i}-${j}`"
+                :key="`text-${i}`"
                 class="content"
                 :paragraph-list="li.paragraph_list"
                 :rich-text-list="li.rich_text_list"
                 :pinyin-position="data.property.pinyin_position"
                 :is-preview="true"
               />
-              <span v-else :key="j" class="html-content" v-html="convertText(sanitizeHTML(li.content))"></span>
+              <span v-else :key="`text-${i}`" class="html-content" v-html="renderTextBlockContent(li)"></span>
             </template>
             <template v-if="li.type === 'input'">
               <!-- 输入填空 -->
               <template v-if="data.property.fill_type === fillTypeList[0].value">
                 <el-input
-                  :key="j"
+                  :key="`input-${i}`"
                   :ref="`input-${li.mark}`"
                   v-model="li.input"
                   :disabled="disabled"
@@ -45,7 +45,7 @@
 
               <!-- 选词填空 -->
               <template v-else-if="data.property.fill_type === fillTypeList[1].value">
-                <el-popover :key="j" placement="top" trigger="click">
+                <el-popover :key="`popover-${i}`" placement="top" trigger="click">
                   <div class="word-list">
                     <span
                       v-for="{ content, mark } in data.word_list"
@@ -68,7 +68,7 @@
 
               <!-- 手写填空 -->
               <template v-else-if="data.property.fill_type === fillTypeList[2].value">
-                <span :key="j" class="write-click" @click="handleWriteClick(li.mark)">
+                <span :key="`write-${i}`" class="write-click" @click="handleWriteClick(li.mark)">
                   <img
                     v-show="li.write_base64"
                     style="background-color: #f4f4f4"
@@ -82,7 +82,7 @@
               <template v-else-if="data.property.fill_type === fillTypeList[3].value">
                 <SoundRecordBox
                   ref="record"
-                  :key="j"
+                  :key="`record-${i}`"
                   type="mini"
                   :many-times="false"
                   class="record-box"
@@ -112,8 +112,12 @@
     </div>
 
     <WriteDialog :visible.sync="writeVisible" @confirm="handleWriteConfirm" />
-    <PreviewOperation :is-show-answer="isShowAnswer" @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
-    <AnswerCorrect :visible.sync="visibleAnswerCorrect" @closeAnswerCorrect="closeAnswerCorrect" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
+    <AnswerCorrect
+      :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
+      @closeAnswerCorrect="closeAnswerCorrect"
+    />
     <AnswerAnalysis
       :visible.sync="visibleAnswerAnalysis"
       :answer-list="data.answer_list"
@@ -121,22 +125,22 @@
       @closeAnswerAnalysis="closeAnswerAnalysis"
     >
       <div slot="right-answer" class="fill-wrapper">
-        <p v-for="(item, i) in modelEssay" :key="i">
-          <template v-for="(li, j) in item">
+        <p>
+          <template v-for="(li, i) in modelEssay">
             <template v-if="li.type === 'text'">
               <PinyinText
                 v-if="isEnable(data.property.view_pinyin)"
-                :key="`${i}-${j}`"
+                :key="`answer-text-${i}`"
                 class="content"
                 :paragraph-list="li.paragraph_list"
                 :rich-text-list="li.rich_text_list"
                 :pinyin-position="data.property.pinyin_position"
                 :is-preview="true"
               />
-              <span v-else :key="j" v-html="convertText(sanitizeHTML(li.content))"></span>
+              <span v-else :key="`answer-text-${i}`" class="html-content" v-html="renderTextBlockContent(li)"></span>
             </template>
             <template v-if="li.type === 'input'">
-              <span v-show="computedAnswerText(li.mark).length > 0" :key="`answer-${j}`" class="right-answer">
+              <span v-show="computedAnswerText(li.mark).length > 0" :key="`answer-${i}`" class="right-answer">
                 {{ computedAnswerText(li.mark) }}
               </span>
             </template>
@@ -176,36 +180,13 @@ export default {
       writeMark: '',
     };
   },
-  computed: {
-    isShowAnswer() {
-      return (
-        (Array.isArray(this.data.answer_list) && this.data.answer_list.length > 0) ||
-        (Array.isArray(this.data.analysis_list) && this.data.analysis_list.length > 0)
-      );
-    },
-  },
   watch: {
     'data.model_essay': {
       handler(list) {
         if (!list || !Array.isArray(list)) return;
 
         this.modelEssay = JSON.parse(JSON.stringify(list));
-        this.answer.answer_list = list
-          .map((item) => {
-            return item
-              .map(({ type, content, audio_answer_list, mark }) => {
-                if (type === 'input') {
-                  return {
-                    value: content,
-                    mark,
-                    audio_answer_list,
-                    write_base64: '',
-                  };
-                }
-              })
-              .filter((item) => item);
-          })
-          .flat();
+        this.syncAnswerList(list);
       },
       deep: true,
       immediate: true,
@@ -214,22 +195,7 @@ export default {
       handler(list) {
         if (!list || !Array.isArray(list)) return;
 
-        this.answer.answer_list = list
-          .map((item) => {
-            return item
-              .map(({ type, input, audio_answer_list, mark }) => {
-                if (type === 'input') {
-                  return {
-                    value: input,
-                    mark,
-                    audio_answer_list,
-                    write_base64: '',
-                  };
-                }
-              })
-              .filter((item) => item);
-          })
-          .flat();
+        this.syncAnswerList(list);
       },
       deep: true,
       immediate: true,
@@ -238,13 +204,10 @@ export default {
       if (!val) return;
 
       this.answer.answer_list.forEach(({ mark, value }) => {
-        this.modelEssay.forEach((item) => {
-          item.forEach((li) => {
-            if (li.mark === mark) {
-              li.input = value;
-            }
-          });
-        });
+        const li = this.modelEssay.find((item) => item.mark === mark);
+        if (li) {
+          li.input = value;
+        }
       });
 
       this.handleWav(this.answer.record_list);
@@ -257,6 +220,36 @@ export default {
     handleWav(data) {
       this.data.record_list = data;
     },
+    renderContent(content) {
+      return this.convertText(this.sanitizeHTML(content));
+    },
+    /**
+     * 渲染文本块内容
+     * @param {Object} textBlock 文本块对象,包含纯文本内容和富文本内容
+     */
+    renderTextBlockContent(textBlock) {
+      const richTextList = textBlock?.rich_text_list;
+      if (Array.isArray(richTextList) && richTextList.length > 0) {
+        const richHtml = richTextList.map((item) => item?.text || '').join('');
+        return this.renderContent(richHtml);
+      }
+      return this.renderContent(textBlock?.content || '');
+    },
+    syncAnswerList(list) {
+      this.answer.answer_list = list
+        .map(({ type, input, audio_answer_list, mark }) => {
+          if (type === 'input') {
+            return {
+              value: input,
+              mark,
+              audio_answer_list,
+              write_base64: '',
+            };
+          }
+          return null;
+        })
+        .filter((item) => item);
+    },
     /**
      * 处理小音频录音
      * @param {Object} data 音频数据
@@ -264,12 +257,9 @@ export default {
      */
     handleMiniWav(data, mark) {
       if (!data || !mark) return;
-      for (const item of this.modelEssay) {
-        const li = item.find((li) => li?.mark === mark);
-        if (li) {
-          this.$set(li, 'audio_answer_list', data);
-          break;
-        }
+      const li = this.modelEssay.find((item) => item?.mark === mark);
+      if (li) {
+        this.$set(li, 'audio_answer_list', data);
       }
     },
     /**
@@ -290,12 +280,9 @@ export default {
      */
     handleWriteConfirm(data) {
       if (!data) return;
-      for (const item of this.modelEssay) {
-        const li = item.find((li) => li?.mark === this.writeMark);
-        if (li) {
-          this.$set(li, 'write_base64', data);
-          break;
-        }
+      const li = this.modelEssay.find((item) => item?.mark === this.writeMark);
+      if (li) {
+        this.$set(li, 'write_base64', data);
       }
     },
     handleWriteClick(mark) {
@@ -382,7 +369,7 @@ export default {
       }
       let selectOption = this.answer.answer_list.find((item) => item.mark === mark);
       let answerOption = this.data.answer.answer_list.find((item) => item.mark === mark);
-      if (!selectOption) return '';
+      if (!selectOption || !answerOption) return '';
       let selectValue = selectOption.value;
       let answerValue = answerOption.value;
       let answerType = answerOption.type;
@@ -404,20 +391,21 @@ export default {
      */
     computedAnswerText(mark) {
       let answerOption = this.data.answer.answer_list.find((item) => item.mark === mark);
+      if (!answerOption) return '';
       let answerValue = answerOption.value;
       return `${answerValue}`;
     },
     // 重做
     retry() {
-      this.modelEssay.forEach((item) => {
-        item.forEach((li) => {
-          if (li.type === 'input') {
-            li.input = '';
-            li.write_base64 = '';
-          }
-        });
+      this.modelEssay.forEach((li) => {
+        if (li.type === 'input') {
+          li.input = '';
+          li.write_base64 = '';
+        }
       });
       this.selectedWordList = [];
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.handleWav([]);
     },
     /**

+ 9 - 1
src/views/book/courseware/preview/components/image_text/ImageTextPreview.vue

@@ -58,10 +58,16 @@
         />
       </div>
     </div>
-    <PreviewOperation v-if="data.input_list.length > 0" @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation
+      v-if="data.input_list.length > 0"
+      @showAnswerAnalysis="showAnswerAnalysis"
+      @judgeCorrect="judgeCorrect"
+      @retry="retry"
+    />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -283,6 +289,8 @@ export default {
     },
     // 重做
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.initData();
     },
     /**

+ 4 - 1
src/views/book/courseware/preview/components/input/InputPreview.vue

@@ -28,10 +28,11 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -107,6 +108,8 @@ export default {
       };
     },
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.data.answer.text = '';
     },
   },

+ 4 - 1
src/views/book/courseware/preview/components/judge/JudgePreview.vue

@@ -62,10 +62,11 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -215,6 +216,8 @@ export default {
       return isCorrectType ? 'answer-right' : '';
     },
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.answer.answer_list = [];
     },
 

+ 4 - 1
src/views/book/courseware/preview/components/matching/MatchingPreview.vue

@@ -40,10 +40,11 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -518,6 +519,8 @@ export default {
       return isRight ? 'right' : 'wrong';
     },
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.clearLine();
       this.$set(
         this,

+ 4 - 1
src/views/book/courseware/preview/components/newWord_template/NewWordTemplatePreview.vue

@@ -216,10 +216,11 @@
         </div>
       </div>
     </div>
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -555,6 +556,8 @@ export default {
     },
     // 重做
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.handleData();
       if (this.$refs.editDiv) {
         if (this.$refs.editDiv.length > 0) {

+ 5 - 1
src/views/book/courseware/preview/components/pinyin_base/PinyinBasePreview.vue

@@ -148,13 +148,15 @@
           data.property.fun_type !== 'show' ||
           (data.property.fun_type === 'show' && isEnable(data.property.is_enable_voice_answer))
         "
+        :is-show-answer="isShowAnswers"
         @showAnswerAnalysis="showAnswerAnalysis"
+        @judgeCorrect="judgeCorrect"
         @retry="retry"
-        :isShowAnswer="isShowAnswers"
       />
       <AnswerCorrect
         :answer-correct="data?.answer_correct"
         :visible.sync="visibleAnswerCorrect"
+        :is-check-correct="isCheckCorrect"
         @closeAnswerCorrect="closeAnswerCorrect"
       />
       <AnswerAnalysis
@@ -766,6 +768,8 @@ export default {
     },
     // 重做
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.handleData();
       if (this.data.property.fun_type !== 'mark' && this.isEnable(this.data.property.is_enable_voice_answer)) {
         this.$refs.record.handleReset();

+ 4 - 0
src/views/book/courseware/preview/components/record_input/RecordInputPreview.vue

@@ -31,11 +31,13 @@
         :is-show-answer="isShowAnswers"
         :is-show-retry="isEnable(data.is_enable_input)"
         @showAnswerAnalysis="showAnswerAnalysis"
+        @judgeCorrect="judgeCorrect"
         @retry="retry"
       />
       <AnswerCorrect
         :answer-correct="data?.answer_correct"
         :visible.sync="visibleAnswerCorrect"
+        :is-check-correct="isCheckCorrect"
         @closeAnswerCorrect="closeAnswerCorrect"
       />
       <AnswerAnalysis
@@ -100,6 +102,8 @@ export default {
     },
     // 重做
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.data.answer.answer_list.input = '';
       this.data.answer.answer_list.answer_record_list = [];
       this.$refs.record.handleReset();

+ 4 - 1
src/views/book/courseware/preview/components/select/SelectPreview.vue

@@ -44,7 +44,7 @@
         </li>
       </ul>
 
-      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     </div>
 
     <AnswerCorrect
@@ -56,6 +56,7 @@
       :visible.sync="visibleAnswerAnalysis"
       :answer-list="data.answer_list"
       :analysis-list="data.analysis_list"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerAnalysis="closeAnswerAnalysis"
     >
       <ul
@@ -190,6 +191,8 @@ export default {
     },
 
     retry() {
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
       this.answer.answer_list = [];
     },
 

+ 4 - 1
src/views/book/courseware/preview/components/sort/SortPreview.vue

@@ -40,12 +40,13 @@
           </transition-group>
         </draggable>
       </ul>
-      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     </div>
 
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -202,6 +203,8 @@ export default {
           : optionList.sort(() => Math.random() - 0.5);
       this.answer.answer_list = [];
       this.is_all_right = false;
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
     },
 
     /**

+ 23 - 10
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -57,7 +57,7 @@
                         <div
                           v-for="(item, index) in col.rich_text_list"
                           :key="index"
-                          class="pinyin-text"
+                          class="pinyin-text pinyin-text-sentence"
                           :class="[
                             index === 0 ? 'pinyin-text-left' : '',
                             item.type === 'audio' ? 'pinyin-text-audio' : '',
@@ -203,7 +203,7 @@
                           <!-- 换行符 -->
                           <br v-else-if="item.type === 'newline'" :key="'newline-' + index" />
 
-                          <!-- 
+                          <!--
                         <template v-else>
                           <span v-if="data.property.pinyin_position === 'top'" class="pinyin">
                             {{ item.pinyin.replace(/\s+/g, '') }}
@@ -294,14 +294,14 @@
 
                   <i
                     v-if="col.cell.isCross"
-                    @click="toggle(col)"
                     :class="[
                       { 'el-icon-check': col.crossAnswer === statusList[1] },
                       { 'el-icon-close': col.crossAnswer === statusList[2] },
                       ...computedAnswerCrossClass(col, i, j),
                     ]"
                     :style="{ display: 'block', width: '18px', height: '18px', border: '1px solid #000' }"
-                  />
+                    @click="toggle(col)"
+                  ></i>
                 </div>
                 <span v-if="showLang" class="multilingual" :style="[tdStyle, computedRichStyle(col.content)]">
                   {{
@@ -317,10 +317,16 @@
           </tr>
         </table>
       </div>
-      <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" v-if="isHasInput" />
+      <PreviewOperation
+        v-if="isHasInput"
+        @showAnswerAnalysis="showAnswerAnalysis"
+        @judgeCorrect="judgeCorrect"
+        @retry="retry"
+      />
       <AnswerCorrect
         :answer-correct="data?.answer_correct"
         :visible.sync="visibleAnswerCorrect"
+        :is-check-correct="isCheckCorrect"
         @closeAnswerCorrect="closeAnswerCorrect"
       />
       <AnswerAnalysis
@@ -387,7 +393,7 @@
                           <div
                             v-for="(item, index) in col.rich_text_list"
                             :key="index"
-                            class="pinyin-text"
+                            class="pinyin-text pinyin-text-sentence"
                             :class="[
                               index === 0 ? 'pinyin-text-left' : '',
                               item.type === 'audio' ? 'pinyin-text-audio' : '',
@@ -425,9 +431,9 @@
                                 <template v-else-if="word.type === 'input'">
                                   <span v-if="data.property.pinyin_position === 'top'" class="pinyin">&nbsp;</span>
                                   <span
+                                    v-show="computedAnswerText(word, i, j).length > 0"
                                     :key="`answer-${j}`"
                                     class="right-answer"
-                                    v-show="computedAnswerText(word, i, j).length > 0"
                                   >
                                     {{ convertText(computedAnswerText(word, i, j)) }}
                                   </span>
@@ -561,9 +567,9 @@
                           </template> -->
 
                             <span
+                              v-show="computedAnswerText(item, i, j).length > 0"
                               :key="`answer-${j}`"
                               class="right-answer"
-                              v-show="computedAnswerText(item, i, j).length > 0"
                             >
                               {{ convertText(computedAnswerText(item, i, j)) }}
                             </span>
@@ -578,7 +584,7 @@
                         { 'el-icon-close': data.answer_lists[i][j].crossAnswer === statusList[2] },
                       ]"
                       style="display: block; width: 18px; height: 18px; border: 1px solid #30a47d"
-                    />
+                    ></i>
                   </div>
                   <span v-if="showLang" class="multilingual" :style="[tdStyle, computedRichStyle(col.content)]">
                     {{
@@ -754,7 +760,12 @@ export default {
         } else if (item.text && typeof item.text === 'string' && item.text.includes('<audio')) {
           blocks.push(this.parseAudioBlock(item, tagStack));
         } else if (item.is_style === 'true' || item.is_style === true) {
-          this.handleStyleTag(item, tagStack);
+          if (item.text.includes('<br')) {
+            blocks.push({ type: 'newline' });
+            paragraphIndex += 1;
+          } else {
+            this.handleStyleTag(item, tagStack);
+          }
         } else if (item.text === '\n') {
           blocks.push({ type: 'newline' });
           paragraphIndex += 1;
@@ -1243,6 +1254,8 @@ export default {
           this.$refs.record.handleReset();
         }
       }
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
     },
     /**
      * 获取无文本内容的数据结构,用于保存为个人模板时的样式模板

+ 4 - 1
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -208,10 +208,11 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @judgeCorrect="judgeCorrect" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
+      :is-check-correct="isCheckCorrect"
       @closeAnswerCorrect="closeAnswerCorrect"
     />
     <AnswerAnalysis
@@ -589,6 +590,8 @@ export default {
       this.matrixSelectLrc = null;
       this.data.record_list = [];
       this.$refs.luyin?.handleReset();
+      this.isJudgingRightWrong = false;
+      this.isShowRightAnswer = false;
     },
 
     /**

+ 1 - 15
src/web_preview/index.vue

@@ -8,9 +8,7 @@
         <span class="name-path">{{ courseware_info.name_path }}</span>
         <span class="flow-nodename">{{ courseware_info.cur_audit_flow_node_name }}</span>
         <slot name="middle" :courseware="courseware_info"></slot>
-        <div class="group">
-          <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
-        </div>
+        <div class="group"></div>
         <div v-if="isShowGroup">
           <span class="link" @click="isShowGroup = false">取消显示分组</span>
           <span
@@ -575,7 +573,6 @@ export default {
       lang: 'ZH',
       chinese: 'zh-Hans',
       showPinYin: 'false',
-      isJudgeCorrect: false,
       unified_attrib: {},
       curSelectId: this.id,
       navigationShow: true,
@@ -636,9 +633,6 @@ export default {
     },
   },
   watch: {
-    isJudgeCorrect() {
-      this.simulateAnswer();
-    },
     curSelectId() {
       if (this.curToolbarIcon === 'note') {
         this.getNote();
@@ -1146,14 +1140,6 @@ export default {
     },
 
     /**
-     * 模拟答题
-     * @param {boolean} [disabled=true] - 是否禁用
-     */
-    simulateAnswer(disabled = true) {
-      this.$refs.courseware.simulateAnswer(this.isJudgeCorrect, false, disabled);
-    },
-
-    /**
      * 选择节点
      * @param {string} nodeId - 节点ID
      * @param {boolean} isLeaf - 是否是叶子节点