@@ -16,7 +16,7 @@ |
||
16 | 16 | Display::display_reduced_header(); |
17 | 17 | |
18 | 18 | if (isset($_GET['error'])) { |
19 | - switch ($_GET['error']){ |
|
19 | + switch ($_GET['error']) { |
|
20 | 20 | case 'document_deleted': |
21 | 21 | echo '<br /><br />'; |
22 | 22 | Display::display_error_message(get_lang('DocumentHasBeenDeleted')); |
@@ -458,8 +458,8 @@ |
||
458 | 458 | } else if(param == 'cmi.core.student_name'){ |
459 | 459 | // ---- cmi.core.student_name |
460 | 460 | <?php |
461 | - $who = addslashes($user['complete_name']); |
|
462 | - echo "result='$who';"; |
|
461 | + $who = addslashes($user['complete_name']); |
|
462 | + echo "result='$who';"; |
|
463 | 463 | ?> |
464 | 464 | } else if(param == 'cmi.core.lesson_location'){ |
465 | 465 | // ---- cmi.core.lesson_location |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | require_once '../inc/global.inc.php'; |
27 | 27 | |
28 | -$file = (empty($_SESSION['file'])?'':$_SESSION['file']); |
|
28 | +$file = (empty($_SESSION['file']) ? '' : $_SESSION['file']); |
|
29 | 29 | /** @var learnpath $oLP */ |
30 | 30 | $oLP = unserialize($_SESSION['lpobject']); |
31 | 31 | /** @var learnpathItem $oItem */ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | header('Content-type: text/javascript'); |
43 | 43 | |
44 | -?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame |
|
44 | +?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin())) ? '0' : '3'); ?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame |
|
45 | 45 | var lms_logs = 0; //debug log level for LMS actions. 0=none, 1=light, 2=a lot, 3=all |
46 | 46 | |
47 | 47 | // API Object initialization (eases access later on) |
@@ -144,25 +144,25 @@ discard block |
||
144 | 144 | olms.statusSignalReceived = 0; |
145 | 145 | |
146 | 146 | // Strictly scorm variables |
147 | -olms.score=<?php echo $oItem->get_score();?>; |
|
148 | -olms.max='<?php echo $oItem->get_max();?>'; |
|
149 | -olms.min='<?php echo $oItem->get_min();?>'; |
|
150 | -olms.lesson_status='<?php echo $oItem->get_status();?>'; |
|
151 | -olms.session_time='<?php echo $oItem->get_scorm_time('js');?>'; |
|
152 | -olms.suspend_data = '<?php echo $oItem->get_suspend_data();?>'; |
|
153 | -olms.lesson_location = '<?php echo $oItem->get_lesson_location();?>'; |
|
154 | -olms.total_time = '<?php echo $oItem->get_scorm_time('js');?>'; |
|
155 | -olms.mastery_score = '<?php echo $oItem->get_mastery_score();?>'; |
|
147 | +olms.score=<?php echo $oItem->get_score(); ?>; |
|
148 | +olms.max='<?php echo $oItem->get_max(); ?>'; |
|
149 | +olms.min='<?php echo $oItem->get_min(); ?>'; |
|
150 | +olms.lesson_status='<?php echo $oItem->get_status(); ?>'; |
|
151 | +olms.session_time='<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
152 | +olms.suspend_data = '<?php echo $oItem->get_suspend_data(); ?>'; |
|
153 | +olms.lesson_location = '<?php echo $oItem->get_lesson_location(); ?>'; |
|
154 | +olms.total_time = '<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
155 | +olms.mastery_score = '<?php echo $oItem->get_mastery_score(); ?>'; |
|
156 | 156 | olms.launch_data = '<?php echo $oItem->get_launch_data(); ?>'; |
157 | -olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed();?>'; |
|
158 | -olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array();?>); |
|
157 | +olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed(); ?>'; |
|
158 | +olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array(); ?>); |
|
159 | 159 | olms.item_objectives = new Array(); |
160 | 160 | olms.info_lms_item = new Array(); |
161 | 161 | |
162 | 162 | // Chamilo internal variables (not SCORM) |
163 | 163 | // olms.saved_lesson_status = 'not attempted'; |
164 | -olms.lms_lp_id = <?php echo $oLP->get_id();?>; |
|
165 | -olms.lms_item_id = <?php echo $oItem->get_id();?>; |
|
164 | +olms.lms_lp_id = <?php echo $oLP->get_id(); ?>; |
|
165 | +olms.lms_item_id = <?php echo $oItem->get_id(); ?>; |
|
166 | 166 | olms.lms_initialized = 0; |
167 | 167 | // switch_finished indicates if the switch process is finished (if it has gone |
168 | 168 | // through LMSInitialize() for the new item. Until then, all LMSSetValue() |
@@ -171,26 +171,26 @@ discard block |
||
171 | 171 | olms.switch_finished = 0; |
172 | 172 | |
173 | 173 | //olms.lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>; |
174 | -//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>; |
|
175 | -//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>'; |
|
174 | +//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>; |
|
175 | +//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>'; |
|
176 | 176 | //if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';} |
177 | 177 | |
178 | -olms.lms_view_id = '<?php echo $oLP->get_view();?>'; |
|
178 | +olms.lms_view_id = '<?php echo $oLP->get_view(); ?>'; |
|
179 | 179 | if(olms.lms_view_id == ''){ olms.lms_view_id = 1;} |
180 | -olms.lms_user_id = '<?php echo $userId;?>'; |
|
181 | -olms.lms_next_item = '<?php echo $oLP->get_next_item_id();?>'; |
|
182 | -olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>'; |
|
183 | -olms.lms_lp_type = '<?php echo $oLP->get_type();?>'; |
|
184 | -olms.lms_item_type = '<?php echo $oItem->get_type();?>'; |
|
185 | -olms.lms_item_credit = '<?php echo $oItem->get_credit();?>'; |
|
186 | -olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode();?>'; |
|
187 | -olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data());?>'; |
|
188 | -olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit();?>'; |
|
180 | +olms.lms_user_id = '<?php echo $userId; ?>'; |
|
181 | +olms.lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>'; |
|
182 | +olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>'; |
|
183 | +olms.lms_lp_type = '<?php echo $oLP->get_type(); ?>'; |
|
184 | +olms.lms_item_type = '<?php echo $oItem->get_type(); ?>'; |
|
185 | +olms.lms_item_credit = '<?php echo $oItem->get_credit(); ?>'; |
|
186 | +olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode(); ?>'; |
|
187 | +olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data()); ?>'; |
|
188 | +olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit(); ?>'; |
|
189 | 189 | olms.lms_course_id = '<?php echo $oLP->get_course_int_id(); ?>'; |
190 | 190 | olms.lms_session_id = '<?php echo api_get_session_id(); ?>'; |
191 | 191 | olms.lms_course_code = '<?php echo $oLP->getCourseCode(); ?>'; |
192 | 192 | olms.lms_course_id = '<?php echo $oLP->get_course_int_id(); ?>'; |
193 | -<?php echo $oLP->get_items_details_as_js('olms.lms_item_types');?> |
|
193 | +<?php echo $oLP->get_items_details_as_js('olms.lms_item_types'); ?> |
|
194 | 194 | |
195 | 195 | // Following definition of cmi.core.score.raw in SCORM 1.2, "LMS should |
196 | 196 | // initialize this to an empty string ("") upon initial launch of a SCO. The |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | logit_scorm('Other SCORM calls are shown in orange.', 1); |
228 | 228 | logit_lms('To add new messages to these logs, use logit_lms() or logit_scorm().'); |
229 | 229 | |
230 | - olms.info_lms_item[0] = '<?php echo $oItem->get_id();?>'; |
|
231 | - olms.info_lms_item[1] = '<?php echo $oItem->get_id();?>'; |
|
230 | + olms.info_lms_item[0] = '<?php echo $oItem->get_id(); ?>'; |
|
231 | + olms.info_lms_item[1] = '<?php echo $oItem->get_id(); ?>'; |
|
232 | 232 | |
233 | 233 | $("#content_id").load(function() { |
234 | 234 | logit_lms('#content_id load event starts'); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | result = 'id,score,status'; |
500 | 500 | } else if(param == 'cmi.objectives._count'){ |
501 | 501 | // ---- cmi.objectives._count |
502 | - //result='<?php echo $oItem->get_view_count();?>'; |
|
502 | + //result='<?php echo $oItem->get_view_count(); ?>'; |
|
503 | 503 | result = olms.item_objectives.length; |
504 | 504 | } else if(param.substring(0,15)== 'cmi.objectives.'){ |
505 | 505 | var myres = ''; |
@@ -13,11 +13,11 @@ |
||
13 | 13 | 'Accent', |
14 | 14 | 'Accenture', |
15 | 15 | 'ADLNet', |
16 | - 'Articulate', |
|
17 | - 'ATutor', |
|
18 | - 'Blackboard', |
|
19 | - 'Calfat', |
|
20 | - 'Captivate', |
|
16 | + 'Articulate', |
|
17 | + 'ATutor', |
|
18 | + 'Blackboard', |
|
19 | + 'Calfat', |
|
20 | + 'Captivate', |
|
21 | 21 | 'Chamilo', |
22 | 22 | 'Chamilo 2', |
23 | 23 | 'Claroline', |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | $myistring = substr($myistring, 1); |
85 | 85 | } |
86 | 86 | |
87 | - // Obtention des donnees d'objectifs |
|
88 | - $mycoursedb = Database::get_course_table(TABLE_LP_IV_OBJECTIVE); |
|
87 | + // Obtention des donnees d'objectifs |
|
88 | + $mycoursedb = Database::get_course_table(TABLE_LP_IV_OBJECTIVE); |
|
89 | 89 | $course_id = api_get_course_int_id(); |
90 | - $mylp_iv_id = $mylpi->db_item_view_id; |
|
90 | + $mylp_iv_id = $mylpi->db_item_view_id; |
|
91 | 91 | |
92 | 92 | $phpobjectives = array(); |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $phpobjectives[] = $row; |
102 | 102 | } |
103 | 103 | } |
104 | - $myobjectives = json_encode($phpobjectives); |
|
104 | + $myobjectives = json_encode($phpobjectives); |
|
105 | 105 | |
106 | 106 | $return .= |
107 | 107 | "olms.score=".$myscore.";" . |
@@ -101,21 +101,21 @@ discard block |
||
101 | 101 | $myobjectives = json_encode($phpobjectives); |
102 | 102 | |
103 | 103 | $return .= |
104 | - "olms.score=".$myscore.";" . |
|
105 | - "olms.max=".$mymax.";" . |
|
106 | - "olms.min=".$mymin.";" . |
|
107 | - "olms.lesson_status='".$mylesson_status."';" . |
|
108 | - "olms.lesson_location='".$mylesson_location."';" . |
|
109 | - "olms.session_time='".$mysession_time."';" . |
|
110 | - "olms.suspend_data='".$mysuspend_data."';" . |
|
111 | - "olms.total_time = '".$mytotal_time."';" . |
|
112 | - "olms.mastery_score = '".$mymastery_score."';" . |
|
113 | - "olms.max_time_allowed = '".$mymax_time_allowed."';" . |
|
114 | - "olms.launch_data = '".$mylaunch_data."';" . |
|
115 | - "olms.interactions = new Array(".$myistring.");" . |
|
104 | + "olms.score=".$myscore.";". |
|
105 | + "olms.max=".$mymax.";". |
|
106 | + "olms.min=".$mymin.";". |
|
107 | + "olms.lesson_status='".$mylesson_status."';". |
|
108 | + "olms.lesson_location='".$mylesson_location."';". |
|
109 | + "olms.session_time='".$mysession_time."';". |
|
110 | + "olms.suspend_data='".$mysuspend_data."';". |
|
111 | + "olms.total_time = '".$mytotal_time."';". |
|
112 | + "olms.mastery_score = '".$mymastery_score."';". |
|
113 | + "olms.max_time_allowed = '".$mymax_time_allowed."';". |
|
114 | + "olms.launch_data = '".$mylaunch_data."';". |
|
115 | + "olms.interactions = new Array(".$myistring.");". |
|
116 | 116 | //"olms.item_objectives = new Array();" . |
117 | - "olms.item_objectives = ".$myobjectives.";" . |
|
118 | - "olms.G_lastError = 0;" . |
|
117 | + "olms.item_objectives = ".$myobjectives.";". |
|
118 | + "olms.G_lastError = 0;". |
|
119 | 119 | "olms.G_LastErrorMessage = 'No error';". |
120 | 120 | "olms.finishSignalReceived = 0;"; |
121 | 121 | /* |
@@ -144,22 +144,22 @@ discard block |
||
144 | 144 | $mycore_exit = $mylpi->get_core_exit(); |
145 | 145 | |
146 | 146 | $return .= |
147 | - "olms.lms_lp_id=".$lp_id.";" . |
|
148 | - "olms.lms_item_id=".$next_item.";" . |
|
149 | - "olms.lms_old_item_id=0;" . |
|
150 | - "olms.lms_initialized=0;" . |
|
151 | - "olms.lms_view_id=".$view_id.";" . |
|
152 | - "olms.lms_user_id=".$user_id.";" . |
|
153 | - "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings. |
|
154 | - "olms.lms_next_item=".$mynext.";" . |
|
155 | - "olms.lms_previous_item=".$myprevious.";" . |
|
156 | - "olms.lms_item_type = '".$myitemtype."';" . |
|
157 | - "olms.lms_item_credit = '".$mycredit."';" . |
|
158 | - "olms.lms_item_lesson_mode = '".$mylesson_mode."';" . |
|
159 | - "olms.lms_item_launch_data = '".$mylaunch_data."';" . |
|
160 | - "olms.lms_item_interactions_count = '".$myinteractions_count."';" . |
|
161 | - "olms.lms_item_objectives_count = '".$myinteractions_count."';" . |
|
162 | - "olms.lms_item_core_exit = '".$mycore_exit."';" . |
|
147 | + "olms.lms_lp_id=".$lp_id.";". |
|
148 | + "olms.lms_item_id=".$next_item.";". |
|
149 | + "olms.lms_old_item_id=0;". |
|
150 | + "olms.lms_initialized=0;". |
|
151 | + "olms.lms_view_id=".$view_id.";". |
|
152 | + "olms.lms_user_id=".$user_id.";". |
|
153 | + "olms.next_item=".$next_item.";".// This one is very important to replace possible literal strings. |
|
154 | + "olms.lms_next_item=".$mynext.";". |
|
155 | + "olms.lms_previous_item=".$myprevious.";". |
|
156 | + "olms.lms_item_type = '".$myitemtype."';". |
|
157 | + "olms.lms_item_credit = '".$mycredit."';". |
|
158 | + "olms.lms_item_lesson_mode = '".$mylesson_mode."';". |
|
159 | + "olms.lms_item_launch_data = '".$mylaunch_data."';". |
|
160 | + "olms.lms_item_interactions_count = '".$myinteractions_count."';". |
|
161 | + "olms.lms_item_objectives_count = '".$myinteractions_count."';". |
|
162 | + "olms.lms_item_core_exit = '".$mycore_exit."';". |
|
163 | 163 | "olms.asset_timer = 0;"; |
164 | 164 | |
165 | 165 | $mylp->set_error_msg(''); |
@@ -15,52 +15,52 @@ |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | switch ($_REQUEST['action']) { |
18 | - case "get": |
|
19 | - print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | - break; |
|
21 | - case "set": |
|
22 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | - print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | - } |
|
25 | - break; |
|
26 | - case "getall": |
|
27 | - print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | - break; |
|
29 | - case "stackpush": |
|
30 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | - print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | - } |
|
33 | - break; |
|
34 | - case "stackpop": |
|
35 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | - print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | - } |
|
38 | - break; |
|
39 | - case "stacklength": |
|
40 | - print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | - break; |
|
42 | - case "stackclear": |
|
43 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | - print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | - } |
|
46 | - break; |
|
47 | - case "stackgetall": |
|
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | - break; |
|
51 | - case "getposition": |
|
52 | - print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | - break; |
|
54 | - case "getleaders": |
|
55 | - print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | - break; |
|
57 | - case "usersgetall": |
|
58 | -// security issue |
|
59 | - print "NOT allowed, security issue, see sources"; |
|
60 | -// print storage_get_all_users(); |
|
61 | - break; |
|
62 | - default: |
|
63 | - // Do nothing |
|
18 | + case "get": |
|
19 | + print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | + break; |
|
21 | + case "set": |
|
22 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | + print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | + } |
|
25 | + break; |
|
26 | + case "getall": |
|
27 | + print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | + break; |
|
29 | + case "stackpush": |
|
30 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | + print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | + } |
|
33 | + break; |
|
34 | + case "stackpop": |
|
35 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | + print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | + } |
|
38 | + break; |
|
39 | + case "stacklength": |
|
40 | + print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | + break; |
|
42 | + case "stackclear": |
|
43 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | + print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | + } |
|
46 | + break; |
|
47 | + case "stackgetall": |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + break; |
|
51 | + case "getposition": |
|
52 | + print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | + break; |
|
54 | + case "getleaders": |
|
55 | + print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | + break; |
|
57 | + case "usersgetall": |
|
58 | + // security issue |
|
59 | + print "NOT allowed, security issue, see sources"; |
|
60 | + // print storage_get_all_users(); |
|
61 | + break; |
|
62 | + default: |
|
63 | + // Do nothing |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | function storage_can_set($sv_user) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | and sco_id = '$sv_sco' |
104 | 104 | and course_id = '$sv_course' |
105 | 105 | and sv_key = '$sv_key' |
106 | - order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length"; |
|
106 | + order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length"; |
|
107 | 107 | // $sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value |
108 | 108 | // from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv |
109 | 109 | // where sv.user_id in (select u2.user_id from ($sql_leaders) u2) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | and search.sco_id = '$sv_sco' |
136 | 136 | and search.course_id = '$sv_course' |
137 | 137 | and search.sv_key = '$sv_key' |
138 | - and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value |
|
138 | + and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value |
|
139 | 139 | and list.sco_id = search.sco_id |
140 | 140 | and list.course_id = search.course_id |
141 | 141 | and list.sv_key = search.sv_key |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | break; |
47 | 47 | case "stackgetall": |
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + } |
|
50 | 51 | break; |
51 | 52 | case "getposition": |
52 | 53 | print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
@@ -87,8 +88,7 @@ discard block |
||
87 | 88 | } else { |
88 | 89 | return $row['sv_value']; |
89 | 90 | } |
90 | - } |
|
91 | - else { |
|
91 | + } else { |
|
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | } |
@@ -144,8 +144,7 @@ discard block |
||
144 | 144 | if (Database::num_rows($res) > 0) { |
145 | 145 | $row = Database::fetch_assoc($res); |
146 | 146 | return $row['position']; |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | return null; |
150 | 149 | } |
151 | 150 | } |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | if ($resorder && $resinsert) { |
199 | 198 | Database::query("commit"); |
200 | 199 | return 1; |
201 | - } |
|
202 | - else { |
|
200 | + } else { |
|
203 | 201 | Database::query("rollback"); |
204 | 202 | return 0; |
205 | 203 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | // Define the 'doc.inc.php' as language file. |
107 | 107 | $nameTools = $_SESSION['oLP']->get_name(); |
108 | 108 | $interbreadcrumb[] = array( |
109 | - 'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_list.php?'.api_get_cidreq(), |
|
109 | + 'url' => api_get_path(WEB_CODE_PATH).'lp/lp_list.php?'.api_get_cidreq(), |
|
110 | 110 | 'name' => get_lang('Doc'), |
111 | 111 | ); |
112 | 112 | // Update global setting to avoid displaying right menu. |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | break; |
102 | 102 | case 'item': |
103 | - $oItem = new scormItem('manifest',$child); |
|
103 | + $oItem = new scormItem('manifest', $child); |
|
104 | 104 | if ($oItem->identifier != '') { |
105 | 105 | $this->sub_items[$oItem->identifier] = $oItem; |
106 | 106 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $attributes = $element->attributes; |
120 | 120 | //$keep_href = ''; |
121 | 121 | foreach ($attributes as $attrib) { |
122 | - switch($attrib->name){ |
|
122 | + switch ($attrib->name) { |
|
123 | 123 | case 'identifier': |
124 | 124 | $this->identifier = $attrib->value; |
125 | 125 | break; |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | ); |
173 | 173 | $abs_order++; |
174 | 174 | $i = 1; |
175 | - foreach($this->sub_items as $id => $dummy) { |
|
176 | - $oSubitem =& $this->sub_items[$id]; |
|
175 | + foreach ($this->sub_items as $id => $dummy) { |
|
176 | + $oSubitem = & $this->sub_items[$id]; |
|
177 | 177 | $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); |
178 | 178 | $i++; |
179 | 179 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | parent::save($from_outside, $prereqs_complete); |
189 | 189 | // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent. |
190 | 190 | $this->scorm_contact = true; |
191 | - if (!$this->scorm_contact){ |
|
191 | + if (!$this->scorm_contact) { |
|
192 | 192 | //error_log('New LP - was expecting SCORM message but none received', 0); |
193 | 193 | } |
194 | 194 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // View |
108 | 108 | $interbreadcrumb[] = [ |
109 | - 'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq(), |
|
109 | + 'url' => api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq(), |
|
110 | 110 | 'name' => get_lang('LearningPaths') |
111 | 111 | ]; |
112 | 112 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | array(), |
118 | 118 | ICON_SIZE_MEDIUM |
119 | 119 | ), |
120 | - api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq() |
|
120 | + api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq() |
|
121 | 121 | ); |
122 | 122 | |
123 | 123 | $template = new Template(get_lang('StudentScore')); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | default: |
49 | 49 | //if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function |
50 | 50 | foreach ($params as $a => $value) { |
51 | - switch ($a) { |
|
51 | + switch ($a) { |
|
52 | 52 | case 'system_id': |
53 | 53 | $this->identifier = Database::escape_string(strtolower($value)); |
54 | 54 | break; |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | case 'web_launch': |
83 | 83 | $this->parameters = Database::escape_string($value); |
84 | 84 | break; |
85 | - } |
|
86 | - } |
|
85 | + } |
|
86 | + } |
|
87 | 87 | |
88 | 88 | return true; |
89 | 89 | } |
@@ -117,7 +117,7 @@ |
||
117 | 117 | $abs_order++; |
118 | 118 | $i = 1; |
119 | 119 | foreach ($this->sub_items as $id => $dummy) { |
120 | - $oSubitem =& $this->sub_items[$id]; |
|
120 | + $oSubitem = & $this->sub_items[$id]; |
|
121 | 121 | $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); |
122 | 122 | $i++; |
123 | 123 | } |