// Cliquer sur le bouton suivant
$(document).on("click", ".next .action", function () {
- if ($this.currentQuestionAnswers.length === 0) {
+ console.log("countdown_enable",parseInt($this.quiz.question.current().countdown_enable))
+ console.log("intervalCountDown",$this.intervalCountDown)
+ if (($this.currentQuestionAnswers.length === 0 && !parseInt($this.quiz.question.current().countdown_enable))
+ || (parseInt($this.quiz.question.current().countdown_enable) && $this.intervalCountDown !== 0 && $this.currentQuestionAnswers.length === 0)) {
alert('Please select at least one answer');
return false;
}
$this.quiz.progressbar.update();
// if countdown enable
- if(parseInt($this.quiz.question.current().countdown_enable)) {
- $this.countdown()
+ if($this.quiz.question.current() !== undefined) {
+ if (parseInt($this.quiz.question.current().countdown_enable)) {
+ $this.countdown()
+ }
}
if (screen === 'outro') {
document.documentElement.style.setProperty("--width-bg-countdown", value + "%")
if(value <= 0) {
clearInterval($this.intervalCountDown)
+ $this.intervalCountDown = 0;
+ $this.currentQuestionAnswers = []
/**
*
* provisoire