Skip to content

Commit

Permalink
Fixed single page quiz timer
Browse files Browse the repository at this point in the history
  • Loading branch information
etchirag committed Nov 28, 2023
1 parent 1144fc9 commit b4991aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ var qsmTimerInterval = [];
}
var secondsRemaining = qmn_quiz_data[quizID].timerRemaning;
var secondsConsumed = qmn_quiz_data[quizID].timerConsumed;
if (localStorage.getItem('mlw_time_quiz' + quizID) != null ) {
secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed + 1;
if(secondsRemaining < 0) {
secondsRemaining = 0;
}
}
var display = QSM.secondsToTimer(secondsRemaining);
var systemTime = new Date().getTime() / 1000;
systemTime = Math.round(systemTime);
Expand Down

0 comments on commit b4991aa

Please sign in to comment.