From 175dec5dc8b5d26e486def02702a19971f66bb7a Mon Sep 17 00:00:00 2001 From: Jonathan Putney Date: Thu, 9 Jan 2020 09:40:37 -0500 Subject: [PATCH] Fixing build --- src/Scorm2004API.js | 4 ++++ test/Scorm12API.spec.js | 2 +- test/cmi/aicc_cmi.spec.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Scorm2004API.js b/src/Scorm2004API.js index 1515f80..72dc6fc 100644 --- a/src/Scorm2004API.js +++ b/src/Scorm2004API.js @@ -473,6 +473,10 @@ export default class Scorm2004API extends BaseAPI { renderCommitCMI(terminateCommit: boolean) { const cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); + } + const result = []; const flattened = Utilities.flatten(cmiExport); switch (this.settings.dataCommitFormat) { diff --git a/test/Scorm12API.spec.js b/test/Scorm12API.spec.js index 5d741b2..8b56522 100644 --- a/test/Scorm12API.spec.js +++ b/test/Scorm12API.spec.js @@ -3,7 +3,7 @@ import {describe, it} from 'mocha'; import Scorm12API from '../src/Scorm12API'; import * as h from './api_helpers'; import {scorm12_error_codes} from '../src/constants/error_codes'; -import {scorm12_values} from '../src/constants/field_values'; +import {scorm12_values} from './field_values'; const api = (settings = {}) => { const API = new Scorm12API(settings); diff --git a/test/cmi/aicc_cmi.spec.js b/test/cmi/aicc_cmi.spec.js index c737a1a..e70e60c 100644 --- a/test/cmi/aicc_cmi.spec.js +++ b/test/cmi/aicc_cmi.spec.js @@ -520,7 +520,7 @@ describe('AICC CMI Tests', () => { ). to. equal( - '{"suspend_data":"","launch_data":"","comments":"","comments_from_lms":"","core":{"student_id":"","student_name":"","lesson_location":"","credit":"","lesson_status":"not attempted","entry":"","total_time":"00:00:00","lesson_mode":"normal","exit":"","session_time":"00:00:00","score":{"raw":"","min":"","max":"100"}},"objectives":{"0":{"id":"","status":"","score":{"raw":"","min":"","max":"100"}}},"student_data":{"mastery_score":"","max_time_allowed":"","time_limit_action":"","tries":{"0":{"status":"","time":"","score":{"raw":"","min":"","max":"100"}}}},"student_preference":{"audio":"","language":"","speed":"","text":""},"interactions":{"0":{"id":"","time":"","type":"","weighting":"","student_response":"","result":"","latency":"","objectives":{},"correct_responses":{}}},"evaluation":{"comments":{"0":{"content":"","location":"","time":""}}}}'); + '{"suspend_data":"","launch_data":"","comments":"","comments_from_lms":"","core":{"student_id":"","student_name":"","lesson_location":"","credit":"","lesson_status":"not attempted","entry":"","lesson_mode":"normal","exit":"","session_time":"00:00:00","score":{"raw":"","min":"","max":"100"}},"objectives":{"0":{"id":"","status":"","score":{"raw":"","min":"","max":"100"}}},"student_data":{"mastery_score":"","max_time_allowed":"","time_limit_action":"","tries":{"0":{"status":"","time":"","score":{"raw":"","min":"","max":"100"}}}},"student_preference":{"audio":"","language":"","speed":"","text":""},"interactions":{"0":{"id":"","time":"","type":"","weighting":"","student_response":"","result":"","latency":"","objectives":{},"correct_responses":{}}},"evaluation":{"comments":{"0":{"content":"","location":"","time":""}}}}'); }); });