Checking for existence of value instead of null
This commit is contained in:
@@ -507,16 +507,19 @@ export default class Scorm2004API extends BaseAPI {
|
|||||||
if (this.cmi.credit === 'credit') {
|
if (this.cmi.credit === 'credit') {
|
||||||
if (this.cmi.completion_threshold && this.cmi.progress_measure) {
|
if (this.cmi.completion_threshold && this.cmi.progress_measure) {
|
||||||
if (this.cmi.progress_measure >= this.cmi.completion_threshold) {
|
if (this.cmi.progress_measure >= this.cmi.completion_threshold) {
|
||||||
|
console.debug('Setting Completion Status: Completed');
|
||||||
this.cmi.completion_status = 'completed';
|
this.cmi.completion_status = 'completed';
|
||||||
} else {
|
} else {
|
||||||
|
console.debug('Setting Completion Status: Incomplete');
|
||||||
this.cmi.completion_status = 'incomplete';
|
this.cmi.completion_status = 'incomplete';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.cmi.scaled_passing_score !== null &&
|
if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {
|
||||||
this.cmi.score.scaled !== '') {
|
|
||||||
if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {
|
if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {
|
||||||
|
console.debug('Setting Success Status: Passed');
|
||||||
this.cmi.success_status = 'passed';
|
this.cmi.success_status = 'passed';
|
||||||
} else {
|
} else {
|
||||||
|
console.debug('Setting Success Status: Failed');
|
||||||
this.cmi.success_status = 'failed';
|
this.cmi.success_status = 'failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user