Skip to content

Commit 7f48526

Browse files
committed
Minor - format code
1 parent 0bf462d commit 7f48526

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

main/lp/scorm_api.php

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ function Initialize() {
385385
* @return string All return values must be string (see SCORM)
386386
*/
387387
function LMSGetValue(param) {
388-
olms.G_LastError = G_NoError ;
388+
olms.G_LastError = G_NoError;
389389
olms.G_LastErrorMessage = 'No error';
390390
var result='';
391391

@@ -394,14 +394,13 @@ function LMSGetValue(param) {
394394
if (param == 'cmi.core.score.raw') {
395395
return '';
396396
}
397-
olms.G_LastError = G_NotInitialized;
397+
olms.G_LastError = G_NotInitialized;
398398
olms.G_LastErrorMessage = G_NotInitializedMessage;
399399
logit_scorm('LMSGetValue('+param+') on item id '+olms.lms_item_id+':<br />=> Error '+ G_NotInitialized + ' ' +G_NotInitializedMessage, 0);
400400
return '';
401401
}
402402

403-
//Chamilo does not support these SCO object properties
404-
403+
// Chamilo does not support these SCO object properties
405404
if (param == 'cmi.student_preference.text' ||
406405
param == 'cmi.student_preference.language' ||
407406
param == 'cmi.student_preference.speed' ||
@@ -410,8 +409,8 @@ function LMSGetValue(param) {
410409
param == 'cmi.student_data.time_limit_action' ||
411410
param == 'cmi.comments' ||
412411
param == 'cmi.comments_from_lms' ||
413-
/* The following properties were part of SCORM 1.0 or never implemented at all
414-
but seem to react badly to Captivate content producer when not defined */
412+
/* The following properties were part of SCORM 1.0 or never implemented at all
413+
but seem to react badly to Captivate content producer when not defined */
415414
param == 'cmi.student_demographics._children' ||
416415
param == 'cmi.student_demographics.city' ||
417416
param == 'cmi.student_demographics.class' ||
@@ -429,7 +428,7 @@ function LMSGetValue(param) {
429428
// the value is not supported
430429
olms.G_LastError = G_NotImplementedError ;
431430
olms.G_LastErrorString = G_NotImplementedErrorMessage;
432-
logit_scorm("LMSGetValue ('"+param+"') Error '"+G_NotImplementedErrorMessage+"'",1);
431+
logit_scorm("LMSGetValue ('"+param+"') Error '"+G_NotImplementedErrorMessage+"'",1);
433432
result = '';
434433
return result;
435434
}
@@ -449,7 +448,7 @@ function LMSGetValue(param) {
449448
} else {
450449
result='';
451450
}
452-
} else if(param == 'cmi.core.exit'){
451+
} else if(param == 'cmi.core.exit') {
453452
// ---- cmi.core.exit
454453
result='';
455454
olms.G_LastError = G_ElementIsWriteOnly;
@@ -458,8 +457,8 @@ function LMSGetValue(param) {
458457
olms.G_LastError = G_ElementIsWriteOnly;
459458
} else if(param == 'cmi.core.lesson_status'){
460459
// ---- cmi.core.lesson_status
461-
if(olms.lesson_status != '') {
462-
result=olms.lesson_status;
460+
if (olms.lesson_status != '') {
461+
result = olms.lesson_status;
463462
} else {
464463
//result='not attempted';
465464
}
@@ -637,18 +636,17 @@ function LMSSetValue(param, val) {
637636
olms.commit = true; //value has changed, need to re-commit
638637
olms.G_LastError = G_NoError ;
639638
olms.G_LastErrorMessage = 'No error';
640-
641639
return_value = 'false';
642640

643-
if ( param == "cmi.core.score.raw" ) {
641+
if (param == "cmi.core.score.raw") {
644642
olms.score= val;
645643
olms.updatable_vars_list['cmi.core.score.raw']=true;
646644
return_value='true';
647-
} else if ( param == "cmi.core.score.max" ) {
645+
} else if ( param == "cmi.core.score.max") {
648646
olms.max = val;
649647
olms.updatable_vars_list['cmi.core.score.max']=true;
650648
return_value='true';
651-
} else if ( param == "cmi.core.score.min" ) {
649+
} else if ( param == "cmi.core.score.min") {
652650
olms.min = val;
653651
olms.updatable_vars_list['cmi.core.score.min']=true;
654652
return_value='true';
@@ -681,9 +679,9 @@ function LMSSetValue(param, val) {
681679
success_status = val;
682680
olms.updatable_vars_list['cmi.success_status']=true;
683681
return_value='true'; //1.3
684-
} else if ( param == "cmi.suspend_data" ) {
682+
} else if ( param == "cmi.suspend_data") {
685683
olms.suspend_data = val;
686-
olms.updatable_vars_list['cmi.suspend_data']=true;
684+
olms.updatable_vars_list['cmi.suspend_data'] = true;
687685
return_value='true';
688686
} else if ( param == "cmi.core.exit" ) {
689687
olms.lms_item_core_exit = val;
@@ -797,11 +795,11 @@ function LMSSetValue(param, val) {
797795
if(olms.item_objectives[obj_id]==null) {
798796
olms.item_objectives[obj_id] = ['','','','',''];
799797
}
800-
if( req_type == "id" ) {
801-
//olms.item_objectives[obj_id][0] = val.substring(51,57);
802-
olms.item_objectives[obj_id][0] = val;
803-
logit_scorm("Objective "+obj_id+"'s id updated",2);
804-
return_value = 'true';
798+
if (req_type == "id") {
799+
//olms.item_objectives[obj_id][0] = val.substring(51,57);
800+
olms.item_objectives[obj_id][0] = val;
801+
logit_scorm("Objective "+obj_id+"'s id updated",2);
802+
return_value = 'true';
805803
} else if ( req_type == "score" ) {
806804
if (myres[3] == '._children'){
807805
return_value = '';
@@ -819,18 +817,18 @@ function LMSSetValue(param, val) {
819817
olms.item_objectives[obj_id][4] = val;
820818
logit_scorm("Objective "+obj_id+"'s score min updated",2);
821819
return_value = 'true';
822-
} else{
820+
} else {
823821
return_value = '';
824822
olms.G_LastError = G_NotImplementedError;
825823
olms.G_LastErrorString = 'Not implemented yet';
826824
}
827825
} else if ( req_type == "status" ) {
828-
olms.item_objectives[obj_id][1] = val;
829-
logit_scorm("Objective "+obj_id+"'s status updated",2);
830-
return_value = 'true';
826+
olms.item_objectives[obj_id][1] = val;
827+
logit_scorm("Objective "+obj_id+"'s status updated",2);
828+
return_value = 'true';
831829
} else {
832-
olms.G_LastError = G_NotImplementedError;
833-
olms.G_LastErrorString = 'Not implemented yet';
830+
olms.G_LastError = G_NotImplementedError;
831+
olms.G_LastErrorString = 'Not implemented yet';
834832
}
835833
}
836834
}
@@ -868,7 +866,6 @@ function savedata(item_id) {
868866
}
869867

870868
old_item_id = olms.info_lms_item[0];
871-
872869
var item_to_save = olms.lms_item_id;
873870
logit_lms('item_to_save (original value): ' + item_to_save, 3);
874871

@@ -981,8 +978,9 @@ function Finish(val) {
981978
* @return string Error code
982979
*/
983980
function LMSGetLastError() {
984-
logit_scorm('LMSGetLastError()',1);
985-
return(olms.G_LastError.toString());
981+
var error = olms.G_LastError.toString();
982+
logit_scorm('LMSGetLastError() returned: ' + error, 1);
983+
return error;
986984
}
987985

988986
/**

0 commit comments

Comments
 (0)