projects
/
qomet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix timing when reloading exam
[qomet.git]
/
public
/
javascripts
/
assessment.js
diff --git
a/public/javascripts/assessment.js
b/public/javascripts/assessment.js
index
1d62894
..
d0567d5
100644
(file)
--- a/
public/javascripts/assessment.js
+++ b/
public/javascripts/assessment.js
@@
-281,7
+281,8
@@
new Vue({
$("#leftButton, #rightButton").hide();
if (assessment.time > 0)
{
$("#leftButton, #rightButton").hide();
if (assessment.time > 0)
{
- this.remainingTime = assessment.time * 60 - (!!paper ? paper.startTime/1000 : 0);
+ const deltaTime = !!paper ? Date.now() - paper.startTime : 0;
+ this.remainingTime = assessment.time * 60 - Math.round(deltaTime / 1000);
this.runTimer();
}
// Initialize structured answer(s) based on questions type and nesting (TODO: more general)
this.runTimer();
}
// Initialize structured answer(s) based on questions type and nesting (TODO: more general)