This commit is contained in:
Ross
2021-12-12 19:13:22 +00:00
parent 0b2ed31598
commit 39388dc2a0
+20 -16
View File
@@ -1889,6 +1889,11 @@ function reviewQuestions() {
$("#review-overlay").hide();
});
console.log(db.user_answers)
console.log({
type: question_type,
qid: qid
})
db.user_answers
.where({
type: question_type,
@@ -1942,25 +1947,26 @@ function reviewQuestions() {
) {
if (normal) {
el.html(
"<span class='" +
c +
"'>Answer: " +
user_answer +
" (Normal)</span>"
`<span class='${c}'>Answer: ${user_answer} (Normal)</span>`
);
} else {
el.html(
"<span class='" +
c +
"'>Answer: " +
user_answer +
" (Abnormal: " +
question_answers.join(", ") +
")</span>"
`<span class='${c}'>Answer: ${user_answer} (Abnormal: ${question_answers.join(', ')})</span>`
);
}
}
function setAnatomyReviewAnswer(
el,
c,
user_answer,
question_answers
) {
el.html(
`<span class='${c}'>Answer: ${user_answer} (Correct answers: ${question_answers.join(', ')})</span>`
)
}
if (question_type == "rapid") {
// First check normal vs abnormal
if (question["normal"] == true) {
@@ -2028,20 +2034,18 @@ function reviewQuestions() {
// Anatomy answers are either correct or incorrect
if (answerInArray(question_answers, section_1_answer)) {
correct_count++;
setReviewAnswer(
setAnatomyReviewAnswer(
el,
"correct",
section_1_answer,
false,
question_answers
);
questions_correct[qid] = true;
} else {
setReviewAnswer(
setAnatomyReviewAnswer(
el,
"incorrect",
section_1_answer,
false,
question_answers
);
questions_correct[qid] = false;