|
@@ -176,9 +176,8 @@ export default {
|
|
|
: `${window.location.origin}/GCLS-Learn/#/main?tab=ExerciseList`, // 返回链接
|
|
|
secondFormatConversion,
|
|
|
isTeacher: this.$store.getters.isTeacher, // 是否是教师
|
|
|
- user_answer_record_info: {
|
|
|
- correct_answer_show_mode: 1, // 正确答案显示模式
|
|
|
- }, // 当前用户的答题记录信息
|
|
|
+ user_answer_record_info: {}, // 当前用户的答题记录信息
|
|
|
+ correct_answer_show_mode: 1,
|
|
|
// 问题列表
|
|
|
questionList: [],
|
|
|
// 当前问题
|
|
@@ -193,7 +192,7 @@ export default {
|
|
|
answer_time_limit_minute: 30, // 答题时间限制
|
|
|
time: 1800,
|
|
|
isSubmit: false,
|
|
|
- isView: false, // 练习模式下是否查看
|
|
|
+ isView: false, // 是否从答题报告跳转到题目
|
|
|
curQuestionPage: '', // 当前问题页面
|
|
|
remark: {
|
|
|
is_remarked: 'false',
|
|
@@ -264,12 +263,16 @@ export default {
|
|
|
if (this.share_record_id && !this.exercise_id) {
|
|
|
this.loading = true;
|
|
|
GetShareRecordInfo({ share_record_id: this.share_record_id }).then(
|
|
|
- ({ user_answer_record_info, share_record: { exercise_id, answer_mode, answer_time_limit_minute } }) => {
|
|
|
+ ({
|
|
|
+ user_answer_record_info,
|
|
|
+ share_record: { exercise_id, answer_mode, answer_time_limit_minute, correct_answer_show_mode },
|
|
|
+ }) => {
|
|
|
this.user_answer_record_info = user_answer_record_info;
|
|
|
this.exercise_id = exercise_id;
|
|
|
this.getExerciseQuestionIndexList();
|
|
|
this.answer_time_limit_minute = answer_time_limit_minute;
|
|
|
this.time = answer_time_limit_minute * 60;
|
|
|
+ this.correct_answer_show_mode = correct_answer_show_mode;
|
|
|
this.loading = false;
|
|
|
// 如果已经存在答题记录,则直接显示答题报告
|
|
|
if (this.user_answer_record_info.is_exist_answer_record === 'true') {
|
|
@@ -291,7 +294,6 @@ export default {
|
|
|
.then(({ answer_record, question_list }) => {
|
|
|
if (answer_record.is_remarked === 'true') {
|
|
|
this.isSubmit = true;
|
|
|
- this.curQuestionIndex = 0;
|
|
|
}
|
|
|
this.recordReport = {
|
|
|
answer_record,
|
|
@@ -398,11 +400,7 @@ export default {
|
|
|
if (type === 'pre') return this.preQuestion();
|
|
|
if (type === 'next') return this.nextQuestion();
|
|
|
}
|
|
|
- // 显示答案
|
|
|
- this.$refs.exercise[0].showAnswer(
|
|
|
- this.answer_mode === 1 || this.isTeacherAnnotations,
|
|
|
- this.user_answer_record_info.correct_answer_show_mode === 1 || this.isTeacherAnnotations,
|
|
|
- );
|
|
|
+ this.$refs.exercise[0].showAnswer(this.answer_mode === 1, this.correct_answer_show_mode === 1, null, true);
|
|
|
});
|
|
|
},
|
|
|
getQuestionInfo() {
|
|
@@ -440,10 +438,45 @@ export default {
|
|
|
// 如果已经填写过答案,直接显示答案
|
|
|
if (is_fill_answer === 'true') {
|
|
|
this.$nextTick().then(() => {
|
|
|
+ /**
|
|
|
+ * 是否判断对错
|
|
|
+ * 1. 答题模式为练习模式
|
|
|
+ * 2. 教师批改
|
|
|
+ * 3. 答题模式为考试模式,且已经批改过
|
|
|
+ * 4. 从答题报告跳转到题目
|
|
|
+ */
|
|
|
+ let isJudgingRightWrong =
|
|
|
+ this.answer_mode === 1 ||
|
|
|
+ this.isTeacherAnnotations ||
|
|
|
+ (this.isExamMode && this.recordReport.answer_record.is_remarked === 'true') ||
|
|
|
+ this.isView;
|
|
|
+ /**
|
|
|
+ * 是否显示正确答案
|
|
|
+ * 1. 答题模式为练习模式,且正确答案显示模式为答题后显示
|
|
|
+ * 2. 教师批改
|
|
|
+ * 3. 从答题报告跳转到题目
|
|
|
+ */
|
|
|
+ let isShowRightAnswer =
|
|
|
+ (this.answer_mode === 1 && this.correct_answer_show_mode === 1) ||
|
|
|
+ this.isTeacherAnnotations ||
|
|
|
+ this.isView;
|
|
|
+ /**
|
|
|
+ * 是否禁用答题
|
|
|
+ * 1. 教师批改
|
|
|
+ * 2. 答题模式为练习模式,且正确答案显示模式为答题后显示
|
|
|
+ * 3. 教师已经批改过
|
|
|
+ * 4. 从测试报告跳转到题目
|
|
|
+ */
|
|
|
+ let disabled =
|
|
|
+ this.isTeacherAnnotations ||
|
|
|
+ (this.answer_mode === 1 && this.correct_answer_show_mode === 1) ||
|
|
|
+ this.recordReport.answer_record.is_remarked === 'true' ||
|
|
|
+ this.isView;
|
|
|
this.$refs.exercise?.[0].showAnswer(
|
|
|
- this.answer_mode === 1 || this.isTeacherAnnotations,
|
|
|
- this.user_answer_record_info.correct_answer_show_mode === 1 || this.isTeacherAnnotations,
|
|
|
+ isJudgingRightWrong,
|
|
|
+ isShowRightAnswer,
|
|
|
content.length > 0 ? JSON.parse(content) : null,
|
|
|
+ disabled,
|
|
|
);
|
|
|
});
|
|
|
}
|