fix: quiz timer issues
This commit is contained in:
@@ -20,10 +20,8 @@ class Quiz {
|
||||
}
|
||||
|
||||
make(data) {
|
||||
if (data.duration) {
|
||||
const timer_display = document.createElement("div");
|
||||
timer_display.classList.add("lms-timer", "float-right", "font-weight-bold");
|
||||
document.getElementsByClassName("lms-title")[0].appendChild(timer_display);
|
||||
if (data.is_time_bound) {
|
||||
$(".lms-timer").removeClass("hide")
|
||||
if (!data.activity || (data.activity && !data.activity.is_complete)) {
|
||||
this.initialiseTimer(data.duration);
|
||||
this.is_time_bound = true;
|
||||
@@ -118,7 +116,7 @@ class Quiz {
|
||||
quiz_response: this.get_selected(),
|
||||
course: this.course,
|
||||
program: this.program,
|
||||
time_taken: this.is_time_bound ? this.time_taken : ""
|
||||
time_taken: this.is_time_bound ? this.time_taken : 0
|
||||
}).then(res => {
|
||||
this.submit_btn.remove()
|
||||
if (!res.message) {
|
||||
@@ -237,4 +235,4 @@ class Question {
|
||||
this.options = option_list
|
||||
this.wrapper.appendChild(options_wrapper)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user