diff --git a/lms/lms/doctype/lesson_assignment/lesson_assignment.py b/lms/lms/doctype/lesson_assignment/lesson_assignment.py index 9a22b52e..e9c62f11 100644 --- a/lms/lms/doctype/lesson_assignment/lesson_assignment.py +++ b/lms/lms/doctype/lesson_assignment/lesson_assignment.py @@ -58,4 +58,4 @@ def grade_assignment(name, result, comments): doc = frappe.get_doc("Lesson Assignment", name) doc.status = result doc.comments = comments - doc.save() + doc.save(ignore_permissions=True) diff --git a/lms/lms/doctype/lms_quiz/lms_quiz.py b/lms/lms/doctype/lms_quiz/lms_quiz.py index 3b706ffd..26da9246 100644 --- a/lms/lms/doctype/lms_quiz/lms_quiz.py +++ b/lms/lms/doctype/lms_quiz/lms_quiz.py @@ -126,7 +126,7 @@ def save_quiz(quiz_title, questions, quiz): } ) - question_doc.update({"question": row["question"]}) + question_doc.update({"question": row["question"], "multiple": row["multiple"]}) for num in range(1, 5): question_doc.update( diff --git a/lms/public/css/style.css b/lms/public/css/style.css index a32648cc..94a244cb 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -1974,4 +1974,6 @@ select { font-weight: 500; } - +.common-page-style .tooltip-content { + display: none; +} diff --git a/lms/www/batch/quiz.js b/lms/www/batch/quiz.js index 25db174e..9df71c49 100644 --- a/lms/www/batch/quiz.js +++ b/lms/www/batch/quiz.js @@ -92,7 +92,7 @@ const get_questions = () => { if (!$(el).find(".question").text()) return; let details = {}; - let one_correct_option = false; + let correct_options = 0; details["question"] = $(el).find(".question").text(); details["question_name"] = $(el).find(".question").data("question") || ""; @@ -111,7 +111,7 @@ const get_questions = () => { .find(`.option-${num} .option-checkbox`) .find("input") .prop("checked"); - if (is_correct) one_correct_option = true; + if (is_correct) correct_options += 1; details[`is_correct_${num}`] = is_correct; }); @@ -119,11 +119,12 @@ const get_questions = () => { if (!details["option_1"] || !details["option_2"]) frappe.throw(__("Each question must have at least two options.")); - if (!one_correct_option) + if (!correct_options) frappe.throw( __("Each question must have at least one correct option.") ); + details["multiple"] = correct_options > 1 ? 1 : 0; questions.push(details); });