|
@@ -178,11 +178,23 @@ export default {
|
|
rQuestion.number = qindex + 1;
|
|
rQuestion.number = qindex + 1;
|
|
if (question.options) {
|
|
if (question.options) {
|
|
// 选项乱序
|
|
// 选项乱序
|
|
|
|
+ let optionMap = {};
|
|
rQuestion.options = question.options.map((opNo, oindex) => {
|
|
rQuestion.options = question.options.map((opNo, oindex) => {
|
|
const rOption = { ...rQuestion.options[opNo - 1] };
|
|
const rOption = { ...rQuestion.options[opNo - 1] };
|
|
rOption.number = oindex + 1;
|
|
rOption.number = oindex + 1;
|
|
|
|
+ optionMap[opNo] = oindex + 1;
|
|
return rOption;
|
|
return rOption;
|
|
});
|
|
});
|
|
|
|
+ if (rQuestion.answer) {
|
|
|
|
+ rQuestion.answer = rQuestion.answer.map(
|
|
|
|
+ (ans) => optionMap[ans]
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ if (rQuestion.studentAnswer) {
|
|
|
|
+ rQuestion.studentAnswer = rQuestion.studentAnswer.map(
|
|
|
|
+ (ans) => optionMap[ans]
|
|
|
|
+ );
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return rQuestion;
|
|
return rQuestion;
|
|
});
|
|
});
|