diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index 7001d77d..4e4498a7 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -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() {