Skip to content

Commit

Permalink
fix: quix show correct answers
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Feb 21, 2024
1 parent 39aa1d4 commit a5d000f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lms/lms/doctype/lms_quiz/lms_quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def check_choice_answers(question, answers):
for num in range(1, 5):
if question_details[f"option_{num}"] in answers:
is_correct.append(question_details[f"is_correct_{num}"])
elif question_details[f"is_correct_{num}"]:
is_correct.append(2)
else:
is_correct.append(0)

Expand Down
4 changes: 3 additions & 1 deletion lms/templates/quiz/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ const parse_choices = (element, is_correct) => {
? add_icon(elem, "check")
: add_icon(elem, "wrong");
} else {
add_icon(elem, "minus-circle");
if (this.show_answers && is_correct[i] == 2)
add_icon(elem, "minus-circle-green");
else add_icon(elem, "minus-circle");
}
});
};
Expand Down
11 changes: 8 additions & 3 deletions lms/www/batches/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,14 @@ const get_calendar_options = (element, calendar_id) => {
event.start.d.d
)} - ${frappe.datetime.get_time(event.end.d.d)}">
<img class='icon icon-sm pull-right ${hide}' src="/assets/lms/icons/check.svg">
<div> ${frappe.datetime.get_time(event.start.d.d)} -
${frappe.datetime.get_time(event.end.d.d)} </div>
<div class="calendar-event-title"> ${event.title} </div>
<div>
<span class="calendar-event-title"> ${event.title} </span>
<span>
${frappe.datetime.get_time(event.start.d.d)} - ${frappe.datetime.get_time(
event.end.d.d
)}
</span>
</div>
</div>`;
},
},
Expand Down

0 comments on commit a5d000f

Please sign in to comment.