|
@@ -139,13 +139,14 @@ export default {
|
|
|
name: 'ExerciseAnswerUserList',
|
|
|
mixins: [PreviewQuestionTypeMixin],
|
|
|
data() {
|
|
|
- const { share_record_id, question_id, exercise_id, search_exercise_id } = this.$route.query;
|
|
|
+ const { share_record_id, question_id, exercise_id, search_exercise_id, question_type } = this.$route.query;
|
|
|
|
|
|
return {
|
|
|
share_record_id,
|
|
|
question_id,
|
|
|
exercise_id, // 练习id
|
|
|
search_exercise_id, // 搜索练习id
|
|
|
+ question_type, // 题目类型
|
|
|
exerciseNames,
|
|
|
scoreTypeList,
|
|
|
isTeacher: this.$store.getters.isTeacher, // 是否是教师
|
|
@@ -220,20 +221,24 @@ export default {
|
|
|
},
|
|
|
// 得到答题记录题目信息
|
|
|
getQuestionInfo_AnswerRecord() {
|
|
|
- const type = this.questionList[this.curQuestionIndex].type;
|
|
|
+ const type = this.question_type;
|
|
|
+ let answer = {
|
|
|
+ answer_list: [],
|
|
|
+ };
|
|
|
+ if (type === 'activity') {
|
|
|
+ answer.answer_list.push({
|
|
|
+ accessory_file_id_list: [],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (type === 'answer_question') {
|
|
|
+ answer.answer_list.push({
|
|
|
+ audio_file_id: '',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (type === 'read') {
|
|
|
+ answer.question_list = [];
|
|
|
+ }
|
|
|
if (type !== 'read') {
|
|
|
- let answer = {
|
|
|
- answer_list: [],
|
|
|
- };
|
|
|
- if (type === 'activity') {
|
|
|
- answer = {
|
|
|
- answer_list: [
|
|
|
- {
|
|
|
- accessory_file_id_list: [],
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- }
|
|
|
this.$refs.exercise?.[0].showAnswer(false, false, answer, true);
|
|
|
}
|
|
|
GetQuestionInfo_AnswerRecord({
|
|
@@ -257,27 +262,18 @@ export default {
|
|
|
if (question.content) {
|
|
|
this.currentQuestion = JSON.parse(question.content);
|
|
|
if (!this.curQuestionPage) {
|
|
|
- this.curQuestionPage = this.previewComponents[this.questionList[this.curQuestionIndex].type];
|
|
|
+ this.curQuestionPage = this.previewComponents[this.question_type];
|
|
|
}
|
|
|
}
|
|
|
this.is_objective = is_objective === 'true';
|
|
|
this.user_answer.answer_status = answer_status;
|
|
|
- console.log(JSON.parse(content));
|
|
|
// 如果已经填写过答案,直接显示答案
|
|
|
if (is_fill_answer === 'true') {
|
|
|
this.$nextTick().then(() => {
|
|
|
this.$refs.exercise?.[0].showAnswer(true, true, content.length > 0 ? JSON.parse(content) : null, true);
|
|
|
});
|
|
|
} else {
|
|
|
- this.$refs.exercise?.[0].showAnswer(
|
|
|
- false,
|
|
|
- false,
|
|
|
- {
|
|
|
- answer: '',
|
|
|
- answer_list: [],
|
|
|
- },
|
|
|
- true,
|
|
|
- );
|
|
|
+ this.$refs.exercise?.[0].showAnswer(false, false, answer, true);
|
|
|
}
|
|
|
});
|
|
|
},
|