Skip to content

Commit

Permalink
fix advance timer issues with qsm timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mann47 committed Oct 7, 2024
1 parent d752d13 commit 71dab31
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ var qsmTimerInterval = [];
* @param int quizID The ID of the quiz.
*/
timer: function (quizID) {
jQuery(document).trigger('qmn_timer_consumed_seconds', [quizID, qmn_quiz_data, qsm_timer_consumed_obj]);
qmn_quiz_data[quizID].timerRemaning -= 1;
qmn_quiz_data[quizID].timerConsumed += 1;
if (0 > qmn_quiz_data[quizID].timerRemaning) {
Expand All @@ -176,6 +177,9 @@ var qsmTimerInterval = [];
}
}
var display = QSM.secondsToTimer(secondsRemaining);
if(qsm_timer_consumed_obj.qmn_count_upward_status == true){
display = QSM.secondsToTimer(secondsConsumed);
}
var systemTime = new Date().getTime() / 1000;
systemTime = Math.round(systemTime);
if ('1' === qmn_quiz_data[quizID].not_allow_after_expired_time && systemTime > qmn_quiz_data[quizID].scheduled_time_end) {
Expand Down Expand Up @@ -2079,4 +2083,7 @@ jQuery(document).keydown(function(event) {
}
jQuery(document).trigger('qsm_keyboard_quiz_action_end', event);
}
});
});
const qsm_timer_consumed_obj = {
qmn_count_upward_status : false
}

0 comments on commit 71dab31

Please sign in to comment.