fix: possible answer check
This commit is contained in:
@@ -96,7 +96,7 @@ const save_current_lesson = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const enable_check = (e) => {
|
const enable_check = (e) => {
|
||||||
if ($(".option:checked").length) {
|
if ($(".option:checked").length || $(".possibility").val().trim()) {
|
||||||
$("#check").removeAttr("disabled");
|
$("#check").removeAttr("disabled");
|
||||||
$(".custom-checkbox").removeClass("active-option");
|
$(".custom-checkbox").removeClass("active-option");
|
||||||
$(".option:checked")
|
$(".option:checked")
|
||||||
@@ -190,8 +190,15 @@ const try_quiz_again = (e) => {
|
|||||||
|
|
||||||
const check_answer = (e = undefined) => {
|
const check_answer = (e = undefined) => {
|
||||||
e && e.preventDefault();
|
e && e.preventDefault();
|
||||||
|
|
||||||
|
let answer = $(".active-question textarea");
|
||||||
|
if (answer.length && !answer.val().trim()) {
|
||||||
|
frappe.throw(__("Please enter your answer"));
|
||||||
|
}
|
||||||
|
|
||||||
clearInterval(self.timer);
|
clearInterval(self.timer);
|
||||||
$(".timer").addClass("hide");
|
$(".timer").addClass("hide");
|
||||||
|
|
||||||
let total_questions = $(".question").length;
|
let total_questions = $(".question").length;
|
||||||
let current_index = $(".active-question").attr("data-qt-index");
|
let current_index = $(".active-question").attr("data-qt-index");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user