recovered elapsedTime

This commit is contained in:
Aqqil Azman
2024-07-22 18:09:46 +08:00
parent 9070c5f0dd
commit 4289c65e4f
@@ -312,7 +312,12 @@ export default {
}
},
methods: {
startTimer() { this.timer = setInterval(() => this.elapsedTime++, this.interval); },
startTimer() {
this.timer = setInterval(() => {
this.elapsedTime++;
this.stepTime++;
}, this.interval);
},
stopTimer() { clearInterval(this.timer); this.timer = null; },
startWork() { this.startTimer(); console.log("work is started"); },
endWork() { this.stopTimer(); console.log("work is ended"); },
@@ -326,12 +331,12 @@ export default {
// call api to recorrd timestamp
var logBody = {
'node': nextQuestionId,
'seconds': this.elapsedTime,
'seconds': this.stepTime,
'userId': this.$store.getters.getUserId,
'session_id': this.sessionId,
};
this.callApi(this.route('api.admin_work_flow.add_workflow_timestamp'), 'post', 'section', logBody, false, false);
this.stepTime = 0;
if (this.questions[nextQuestionId]?.load_api) this.callApi(this.questions[nextQuestionId].load_api, 'get', 'section');
},
generateSessionId() {