|
@@ -223,7 +223,7 @@ export default {
|
|
this.transformRichImg(item.body);
|
|
this.transformRichImg(item.body);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // this.transformRichImg(question.quesAnswer);
|
|
|
|
|
|
+ question.quesAnswer = this.transformQuestionAnser(question.quesAnswer);
|
|
},
|
|
},
|
|
transformRichImg(richText) {
|
|
transformRichImg(richText) {
|
|
if (isAnEmptyRichText(richText)) return;
|
|
if (isAnEmptyRichText(richText)) return;
|
|
@@ -237,6 +237,20 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ transformQuestionAnser(quesAnswer) {
|
|
|
|
+ let qAnswer = null;
|
|
|
|
+ try {
|
|
|
|
+ qAnswer = quesAnswer ? JSON.parse(quesAnswer) : null;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ }
|
|
|
|
+ if (!qAnswer || objTypeOf(qAnswer) !== "array") return quesAnswer;
|
|
|
|
+
|
|
|
|
+ qAnswer.forEach((item) => {
|
|
|
|
+ this.transformRichImg(item);
|
|
|
|
+ });
|
|
|
|
+ return JSON.stringify(qAnswer);
|
|
|
|
+ },
|
|
initData() {
|
|
initData() {
|
|
this.paperData = [];
|
|
this.paperData = [];
|
|
this.paperRichJson = { sections: [] };
|
|
this.paperRichJson = { sections: [] };
|