zhangjie 1 yıl önce
ebeveyn
işleme
8e6fe7fd95

+ 4 - 0
card/components/CardDesign.vue

@@ -274,6 +274,7 @@ export default {
         return {
           pages: [],
           cardConfig: {},
+          answers: {},
         };
       },
     },
@@ -514,6 +515,8 @@ export default {
               cardType: "STANDARD",
               cardConfig: this.cardConfig,
               pages: this.pages,
+              // 来自题库的试卷生成的题卡会有答案信息
+              answers: this.content.answers || {},
             },
             (k, v) => (k.startsWith("_") ? undefined : v)
           );
@@ -539,6 +542,7 @@ export default {
       this.$emit("on-submit", {
         cardConfig: this.cardConfig,
         pages: this.pages,
+        answers: this.content.answers || {},
       });
     },
     toExit() {

+ 1 - 2
src/modules/card/views/CardEdit.vue

@@ -24,7 +24,7 @@
 
 <script>
 import { cardConfigInfos, cardDetail, saveCard } from "../api";
-import CardDesign from "../../../../card/components/CardDesign";
+import CardDesign from "../../../../card/components/CardDesign.vue";
 import CardFreeDesign from "../../../../card/modules/free/components/CardFreeDesign";
 import CardPreviewDialog from "../components/CardPreviewDialog.vue";
 import { examRuleDetail } from "../../base/api";
@@ -126,7 +126,6 @@ export default {
       const detData = await cardDetail(this.cardId);
       // 可能存在题卡内容没有记录的情况
       if (detData.content || detData.stageContent) {
-        // TODO:
         const content = detData.stageContent || detData.content;
         this.cardContent = JSON.parse(content);
         this.cardName = detData.title;