From be1c0de4c6f0e89caa371c710104009a5bdba346 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 2 Jan 2025 19:27:35 +0530 Subject: [PATCH] fix: quiz api issue --- frontend/src/components/Quiz.vue | 12 +++++++----- lms/lms/utils.py | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Quiz.vue b/frontend/src/components/Quiz.vue index 7df188b7b..70821873b 100644 --- a/frontend/src/components/Quiz.vue +++ b/frontend/src/components/Quiz.vue @@ -118,15 +118,17 @@ class="w-3.5 h-3.5 text-gray-900 rounded-sm focus:ring-gray-200" @change="markAnswer(index)" /> -
- + { selectedOptions.forEach((option, index) => { if (option) { showAnswers[index] = option && data[index] - } else if (questionDetails.data[`is_correct_${index + 1}`]) { - showAnswers[index] = 0 + } else if (data[index] == 2) { + showAnswers[index] = 2 } else { showAnswers[index] = undefined } diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 08ef84ce4..31b82f9f3 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -1327,7 +1327,6 @@ def get_question_details(question): for i in range(1, 5): fields.append(f"option_{i}") fields.append(f"explanation_{i}") - fields.append(f"is_correct_{i}") question_details = frappe.db.get_value("LMS Question", question, fields, as_dict=1) return question_details