|
@@ -118,13 +118,11 @@ export default {
|
|
const studentAnsMap = {};
|
|
const studentAnsMap = {};
|
|
examStudentAnswerJson.forEach((question) => {
|
|
examStudentAnswerJson.forEach((question) => {
|
|
const k = `${question.mainNumber}-${question.subNumber}`;
|
|
const k = `${question.mainNumber}-${question.subNumber}`;
|
|
- if (question.subQuestions) {
|
|
|
|
- question.subQuestions.forEach((sq) => {
|
|
|
|
- studentAnsMap[`${k}-${sq.number}`] = {
|
|
|
|
- answer: JSON.parse(sq.answer),
|
|
|
|
- score: sq.score,
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
|
|
+ if (question.subIndex !== null) {
|
|
|
|
+ studentAnsMap[`${k}-${question.subIndex}`] = {
|
|
|
|
+ answer: JSON.parse(question.answer),
|
|
|
|
+ score: question.score,
|
|
|
|
+ };
|
|
} else {
|
|
} else {
|
|
studentAnsMap[k] = {
|
|
studentAnsMap[k] = {
|
|
answer: JSON.parse(question.answer),
|
|
answer: JSON.parse(question.answer),
|
|
@@ -139,9 +137,12 @@ export default {
|
|
let k = `${detail.number}-${question.number}`;
|
|
let k = `${detail.number}-${question.number}`;
|
|
if (question.subQuestions) {
|
|
if (question.subQuestions) {
|
|
question.subQuestions.forEach((sq) => {
|
|
question.subQuestions.forEach((sq) => {
|
|
- k += `-${sq.number}`;
|
|
|
|
- sq.answer = answerMap[k];
|
|
|
|
- const stdAns = studentAnsMap[k] || { answer: null, score: null };
|
|
|
|
|
|
+ const sqk = `${k}-${sq.number}`;
|
|
|
|
+ sq.answer = answerMap[sqk];
|
|
|
|
+ const stdAns = studentAnsMap[sqk] || {
|
|
|
|
+ answer: null,
|
|
|
|
+ score: null,
|
|
|
|
+ };
|
|
sq.studentAnswer = stdAns.answer;
|
|
sq.studentAnswer = stdAns.answer;
|
|
sq.studentScore = stdAns.score;
|
|
sq.studentScore = stdAns.score;
|
|
});
|
|
});
|
|
@@ -263,6 +264,7 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
|
|
+ // console.log(question.studentAnswer);
|
|
contents.push({
|
|
contents.push({
|
|
cls: "topic-answer std-answer",
|
|
cls: "topic-answer std-answer",
|
|
type: "json",
|
|
type: "json",
|