From b2a7feee42f0d588547ef325324ca33f2b21d1ca Mon Sep 17 00:00:00 2001 From: Jonathan Putney Date: Mon, 30 Dec 2019 14:52:55 -0500 Subject: [PATCH] Checking for existence of value instead of null --- src/Scorm2004API.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Scorm2004API.js b/src/Scorm2004API.js index 1524cf2..72dc6fc 100644 --- a/src/Scorm2004API.js +++ b/src/Scorm2004API.js @@ -507,16 +507,19 @@ export default class Scorm2004API extends BaseAPI { if (this.cmi.credit === 'credit') { if (this.cmi.completion_threshold && this.cmi.progress_measure) { if (this.cmi.progress_measure >= this.cmi.completion_threshold) { + console.debug('Setting Completion Status: Completed'); this.cmi.completion_status = 'completed'; } else { + console.debug('Setting Completion Status: Incomplete'); this.cmi.completion_status = 'incomplete'; } } - if (this.cmi.scaled_passing_score !== null && - this.cmi.score.scaled !== '') { + if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { + console.debug('Setting Success Status: Passed'); this.cmi.success_status = 'passed'; } else { + console.debug('Setting Success Status: Failed'); this.cmi.success_status = 'failed'; } }