Skip to content

Commit

Permalink
Fixed NaN timer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-pranav committed Sep 16, 2024
1 parent 711140e commit 17fdecf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var qsmTimerInterval = [];
// Calculates starting time.
var timerTotal = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60;
var timerStarted = localStorage.getItem('mlw_started_quiz' + quizID);
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID));
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1;
var timerRemaning = timerTotal - timerConsumed;
if ('yes' == timerStarted && 0 < timerRemaning) {
seconds = parseInt(timerRemaning);
Expand Down Expand Up @@ -357,7 +357,7 @@ var qsmTimerInterval = [];

// Calculates starting time.
let timerStarted = localStorage.getItem('mlw_started_quiz' + quizID);
let timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID));
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1;
let seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60;
let timerRemaning = seconds - timerConsumed;
if ('yes' == timerStarted && 0 < timerRemaning) {
Expand Down

0 comments on commit 17fdecf

Please sign in to comment.