Prechádzať zdrojové kódy

fix: fix answer and analysis check

WuXinyu 6 rokov pred
rodič
commit
f678ca3453

+ 2 - 2
src/views/quiz/components/ChoiceQuestionDetail.vue

@@ -17,10 +17,10 @@
     <editor-section v-if="!isEmpty(value.studentAnswer) && !fold" title="你的答案">
       {{ value.studentAnswer }}
     </editor-section>
-    <editor-section title="正确答案" v-if="!fold">
+    <editor-section title="正确答案" v-if="!fold && !isEmpty(value.answer)">
       {{ value.answer }}
     </editor-section>
-    <editor-section title="解析" v-if="!fold">
+    <editor-section title="解析" v-if="!fold && !isEmpty(value.analysis)">
       <markdown-section :raw="value.analysis"/>
     </editor-section>
   </div>

+ 1 - 1
src/views/quiz/components/MarkdownSection.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="markdown-section editor" v-html="markdownToHTML(raw)" />
+  <div class="markdown-section editor" v-html="markdownToHTML(raw || '')" />
 </template>
 
 <script>

+ 2 - 2
src/views/quiz/components/TrueFalseQuestionDetail.vue

@@ -8,11 +8,11 @@
       <span v-if="value.studentAnswer" >√</span>
       <span v-else >×</span>
     </editor-section>
-    <editor-section v-if="!fold" title="正确答案">
+    <editor-section v-if="!fold && !isEmpty(value.answer)" title="正确答案">
       <span v-if="value.answer" >√</span>
       <span v-else >×</span>
     </editor-section>
-    <editor-section title="解析" v-if="!fold">
+    <editor-section title="解析" v-if="!fold && !isEmpty(value.analysis)">
       <markdown-section :raw="value.analysis" />
     </editor-section>
   </div>