Browse Source

生字结构 模拟作答

natasha 3 days ago
parent
commit
3b377d8007

+ 56 - 2
src/views/book/courseware/preview/components/character_structure/CharacterStructurePreview.vue

@@ -95,7 +95,7 @@
                 </div>
                 <div
                   class="option_one"
-                  :class="[isJudgingRightWrong ? 'wrong' : '']"
+                  :class="[isJudgingRightWrong && items.answer ? 'wrong' : '']"
                   :key="row"
                   v-if="answer.answer_list[row].answer_list.length == 0"
                 ></div>
@@ -104,6 +104,60 @@
           </div>
         </div>
       </div>
+      <div v-if="isShowRightAnswer" class="right-answer">
+        <div class="title">正确答案</div>
+        <div class="one-box">
+          <div
+            v-for="(items, row) in data.option_list"
+            :key="'row' + row"
+            class="one"
+            :class="[!items.pinyin ? 'one_nopy' : '']"
+            :style="{ marginRight: (row + 1) % 3 == 0 ? '' : '16px' }"
+          >
+            <div class="number">
+              {{ row + 1 }}
+            </div>
+            <div class="hzpinyin">
+              <div class="pinyin" v-if="isEnable(data.property.is_enable_pinyin)">
+                {{ items.pinyin }}
+              </div>
+              <template v-if="items.hz_info.length > 0">
+                <div class="strockplay-newWord">
+                  <Strockplay
+                    class-name="adult-strockplay"
+                    :Book_text="items.hz_info[0].con"
+                    :play-storkes="true"
+                    :stroke-play-color="'#346CDA'"
+                    :stroke-color="'#000000'"
+                    :paly-width="'18px'"
+                    :BoxbgType="'0'"
+                    :cur-item="items.hz_info[0].hzDetail.hz_json"
+                    :target-div="'writeTops-item-right' + '-' + items.hz_info[0].con"
+                    class="writeTop-item"
+                    :style="{ borderColor: '#346CDA' }"
+                  />
+                </div>
+              </template>
+            </div>
+            <div class="image">
+              <img src="@/assets/drag-arrows.png" alt="" />
+            </div>
+            <div class="answer">
+              <div class="option_one" :class="[items.is_example ? 'option_one_example' : '']">
+                <img
+                  v-if="items.answer"
+                  :src="
+                    items.answer.length > 3
+                      ? data.file_list.find((p) => p.file_id === items.answer).file_url
+                      : require('@/assets/structure/structure-' + items.answer + '.png')
+                  "
+                  alt=""
+                />
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
@@ -199,7 +253,7 @@ export default {
             id: items.answer,
             img_list: [],
             img_url:
-              items.answer.length.length > 3
+              items.answer.length > 3
                 ? this.data.structure_select_list.find((p) => p.file_id === items.answer)
                   ? this.data.structure_select_list.find((p) => p.file_id === items.answer).value
                   : ''