diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 89c3611eb..af8382bde 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -169,6 +169,7 @@ var qsmTimerInterval = []; } var secondsRemaining = qmn_quiz_data[quizID].timerRemaning; var secondsConsumed = qmn_quiz_data[quizID].timerConsumed; + jQuery(document).trigger('qmn_timer_consumed_seconds', [quizID, qmn_quiz_data, qsm_timer_consumed_obj]); if (localStorage.getItem('mlw_time_quiz' + quizID) != null ) { secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed + 1; if(secondsRemaining < 0) { @@ -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) { @@ -2079,4 +2083,7 @@ jQuery(document).keydown(function(event) { } jQuery(document).trigger('qsm_keyboard_quiz_action_end', event); } -}); \ No newline at end of file +}); +const qsm_timer_consumed_obj = { + qmn_count_upward_status : false +} \ No newline at end of file