fix: banner style and page exit condition

This commit is contained in:
Jannat Patel
2022-05-17 17:29:11 +05:30
parent 1ef70dd4e4
commit cd56fc6179
2 changed files with 7 additions and 16 deletions

View File

@@ -51,11 +51,10 @@ frappe.ready(() => {
mark_active_question();
});
if ($("#quiz-form").length) {
if ($("#quiz-title").data("max-attempts") && $(".active-question").length) {
window.addEventListener("beforeunload", (e) => {
e.preventDefault();
if ($("#quiz-title").data("max-attempts") && $(".active-question").length)
quiz_summary();
quiz_summary();
e.returnValue = '';
});
}