From 0d0e64f93099cd91924a0a0c6721a2a3a9b90c6c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 3 Nov 2022 15:01:06 +0530 Subject: [PATCH] fix: no cache for quiz --- lms/www/batch/quiz.js | 4 ++-- lms/www/batch/quiz.py | 1 + lms/www/batch/quiz_list.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lms/www/batch/quiz.js b/lms/www/batch/quiz.js index 140d9fdf..f1b2fe75 100644 --- a/lms/www/batch/quiz.js +++ b/lms/www/batch/quiz.js @@ -22,10 +22,10 @@ frappe.ready(() => { const add_question = () => { - if ($(".new-quiz-card").length) { + /* if ($(".new-quiz-card").length) { scroll_to_question_container(); return; - } + } */ let add_after = $(".quiz-card").length ? $(".quiz-card:last") : $("#quiz-title"); let question_template = `
diff --git a/lms/www/batch/quiz.py b/lms/www/batch/quiz.py index 1dfdabed..500b6fb4 100644 --- a/lms/www/batch/quiz.py +++ b/lms/www/batch/quiz.py @@ -3,6 +3,7 @@ from frappe.utils import cstr def get_context(context): + context.no_cache = 1 quizname = frappe.form_dict["quizname"] if quizname == "new-quiz": context.quiz = frappe._dict() diff --git a/lms/www/batch/quiz_list.py b/lms/www/batch/quiz_list.py index 5dbdca66..1b7a653f 100644 --- a/lms/www/batch/quiz_list.py +++ b/lms/www/batch/quiz_list.py @@ -1,4 +1,5 @@ import frappe def get_context(context): + context.no_cache = 1 context.quiz_list = frappe.get_all("LMS Quiz", {"owner": frappe.session.user}, ["name", "title"])