@@ -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 | } |
@@ -163,7 +163,7 @@ |
||
163 | 163 | exit; |
164 | 164 | } else { |
165 | 165 | $headers = [get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp')]; |
166 | - $tabs = Display::tabs($headers, [$formUsers->toHtml(),$form->toHtml()]); |
|
166 | + $tabs = Display::tabs($headers, [$formUsers->toHtml(), $form->toHtml()]); |
|
167 | 167 | $tpl->assign('tabs', $tabs); |
168 | 168 | } |
169 | 169 |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | //if ($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function. |
39 | 39 | $children = $element->childNodes; |
40 | 40 | foreach ($children as $child) { |
41 | - switch ($child->nodeType) { |
|
41 | + switch ($child->nodeType) { |
|
42 | 42 | case XML_ELEMENT_NODE: |
43 | 43 | switch ($child->tagName) { |
44 | 44 | case 'item': |
45 | 45 | $oItem = new scormItem('manifest', $child); |
46 | - if ($oItem->identifier != '') { |
|
46 | + if ($oItem->identifier != '') { |
|
47 | 47 | $this->items[$oItem->identifier] = $oItem; |
48 | - } |
|
48 | + } |
|
49 | 49 | break; |
50 | 50 | case 'metadata': |
51 | 51 | $this->metadata = new scormMetadata('manifest', $child); |
@@ -58,24 +58,24 @@ discard block |
||
58 | 58 | break; |
59 | 59 | } |
60 | 60 | break; |
61 | - case XML_TEXT_NODE: |
|
61 | + case XML_TEXT_NODE: |
|
62 | 62 | break; |
63 | - } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($element->hasAttributes()) { |
67 | - $attributes = $element->attributes; |
|
68 | - //$keep_href = ''; |
|
69 | - foreach ($attributes as $attrib) { |
|
70 | - switch ($attrib->name) { |
|
71 | - case 'identifier': |
|
67 | + $attributes = $element->attributes; |
|
68 | + //$keep_href = ''; |
|
69 | + foreach ($attributes as $attrib) { |
|
70 | + switch ($attrib->name) { |
|
71 | + case 'identifier': |
|
72 | 72 | $this->identifier = $attrib->value; |
73 | - break; |
|
74 | - case 'structure': |
|
73 | + break; |
|
74 | + case 'structure': |
|
75 | 75 | $this->structure = $attrib->value; |
76 | - break; |
|
77 | - } |
|
78 | - } |
|
76 | + break; |
|
77 | + } |
|
78 | + } |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return true; |
@@ -98,7 +98,7 @@ |
||
98 | 98 | foreach ($this->items as $id => $dummy) { |
99 | 99 | $abs_order = 0; |
100 | 100 | // Passes the array as a pointer so it is modified in $list directly. |
101 | - $this->items[$id]->get_flat_list($list,$abs_order, $i, 0); |
|
101 | + $this->items[$id]->get_flat_list($list, $abs_order, $i, 0); |
|
102 | 102 | $i++; |
103 | 103 | } |
104 | 104 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
41 | 41 | error_log('New LP - User not authorized in lp_edit_item_prereq.php'); |
42 | - header('location:lp_controller.php?action=view&lp_id=' . $learnpath_id); |
|
42 | + header('location:lp_controller.php?action=view&lp_id='.$learnpath_id); |
|
43 | 43 | } |
44 | 44 | $course_id = api_get_course_int_id(); |
45 | 45 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | if (!empty($gradebook) && $gradebook == 'view') { |
57 | 57 | $interbreadcrumb[] = array( |
58 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
58 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
59 | 59 | 'name' => get_lang('ToolGradebook') |
60 | 60 | ); |
61 | 61 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | <?php |
143 | 143 | $who = addslashes(api_get_person_name($_user['firstName'], $_user['lastName'])); |
144 | 144 | echo "result='$who';"; |
145 | - ?> |
|
145 | + ?> |
|
146 | 146 | }else if(param == 'cmi.core.lesson_location'){ |
147 | 147 | result=lesson_location; |
148 | 148 | }else if(param == 'cmi.core.total_time'){ |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | <?php |
199 | 199 | $who = addslashes(api_get_person_name($_user['firstName'], $_user['lastName'])); |
200 | 200 | echo "result='$who';"; |
201 | - ?> break; |
|
201 | + ?> break; |
|
202 | 202 | case 'cmi.core.lesson_location' : |
203 | 203 | result=''; |
204 | 204 | break; |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | } |
323 | 323 | <?php |
324 | 324 | /** |
325 | - * Chamilo-specific code that deals with event handling and inter-frames |
|
326 | - * messaging/refreshing. |
|
327 | - * Note that from now on, the Chamilo JS code in this library will act as |
|
328 | - * a controller, of the MVC pattern, and receive all requests for frame |
|
329 | - * updates, then redispatch to any frame concerned. |
|
330 | - */ |
|
325 | + * Chamilo-specific code that deals with event handling and inter-frames |
|
326 | + * messaging/refreshing. |
|
327 | + * Note that from now on, the Chamilo JS code in this library will act as |
|
328 | + * a controller, of the MVC pattern, and receive all requests for frame |
|
329 | + * updates, then redispatch to any frame concerned. |
|
330 | + */ |
|
331 | 331 | ?> |
332 | 332 | /** |
333 | 333 | * Defining the AJAX-object class to be made available from other frames. |
@@ -78,33 +78,33 @@ discard block |
||
78 | 78 | var commit = false ; |
79 | 79 | |
80 | 80 | // Strictly SCORM variables. |
81 | -var score=<?php echo $oItem->get_score();?>; |
|
82 | -var max=<?php echo $oItem->get_max();?>; |
|
83 | -var min=<?php echo $oItem->get_min();?>; |
|
84 | -var lesson_status='<?php echo $oItem->get_status();?>'; |
|
85 | -var session_time='<?php echo $oItem->get_scorm_time('js');?>'; |
|
86 | -var suspend_data = '<?php echo $oItem->get_suspend_data();?>'; |
|
87 | -var lesson_location = '<?php echo $oItem->get_lesson_location();?>'; |
|
88 | -var total_time = '<?php echo $oItem->get_scorm_time('js');?>'; |
|
81 | +var score=<?php echo $oItem->get_score(); ?>; |
|
82 | +var max=<?php echo $oItem->get_max(); ?>; |
|
83 | +var min=<?php echo $oItem->get_min(); ?>; |
|
84 | +var lesson_status='<?php echo $oItem->get_status(); ?>'; |
|
85 | +var session_time='<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
86 | +var suspend_data = '<?php echo $oItem->get_suspend_data(); ?>'; |
|
87 | +var lesson_location = '<?php echo $oItem->get_lesson_location(); ?>'; |
|
88 | +var total_time = '<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
89 | 89 | |
90 | 90 | // Chamilo internal variables. |
91 | 91 | var saved_lesson_status = 'not attempted'; |
92 | -var lms_lp_id = <?php echo $oLP->get_id();?>; |
|
93 | -var lms_item_id = <?php echo $oItem->get_id();?>; |
|
92 | +var lms_lp_id = <?php echo $oLP->get_id(); ?>; |
|
93 | +var lms_item_id = <?php echo $oItem->get_id(); ?>; |
|
94 | 94 | //var lms_new_item_id = 0; //temporary value (only there between a load_item() and a LMSInitialize()) |
95 | 95 | var lms_been_synchronized = 0; |
96 | 96 | var lms_initialized = 0; |
97 | 97 | var lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>; |
98 | -var lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>; |
|
99 | -var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>'; |
|
98 | +var lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>; |
|
99 | +var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>'; |
|
100 | 100 | if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';} |
101 | -var lms_view_id = '<?php echo $oLP->get_view();?>'; |
|
101 | +var lms_view_id = '<?php echo $oLP->get_view(); ?>'; |
|
102 | 102 | if(lms_view_id == ''){ lms_view_id = 1;} |
103 | -var lms_user_id = '<?php echo $_user['user_id'];?>'; |
|
104 | -var lms_next_item = '<?php echo $oLP->get_next_item_id();?>'; |
|
105 | -var lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>'; |
|
106 | -var lms_lp_type = '<?php echo $oLP->get_type();?>'; |
|
107 | -var lms_item_type = '<?php echo $oItem->get_type();?>'; |
|
103 | +var lms_user_id = '<?php echo $_user['user_id']; ?>'; |
|
104 | +var lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>'; |
|
105 | +var lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>'; |
|
106 | +var lms_lp_type = '<?php echo $oLP->get_type(); ?>'; |
|
107 | +var lms_item_type = '<?php echo $oItem->get_type(); ?>'; |
|
108 | 108 | |
109 | 109 | // Backup for old values. |
110 | 110 | var old_score = 0; |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | }else if(param == 'cmi.core.lesson_mode'){ |
163 | 163 | result='normal'; |
164 | 164 | }else if(param == 'cmi.suspend_data'){ |
165 | - result='<?php echo $oItem->get_suspend_data();?>'; |
|
165 | + result='<?php echo $oItem->get_suspend_data(); ?>'; |
|
166 | 166 | }else if(param == 'cmi.launch_data'){ |
167 | 167 | result=''; |
168 | 168 | }else if(param == 'cmi.objectives._count'){ |
169 | - result='<?php echo $oItem->get_view_count();?>'; |
|
169 | + result='<?php echo $oItem->get_view_count(); ?>'; |
|
170 | 170 | } |
171 | 171 | /* |
172 | 172 | // Switch not working??? WTF??? |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | result='normal'; |
228 | 228 | break; |
229 | 229 | case 'cmi.suspend_data' : |
230 | - result='<?php echo $oItem->get_suspend_data();?>'; |
|
230 | + result='<?php echo $oItem->get_suspend_data(); ?>'; |
|
231 | 231 | break; |
232 | 232 | case 'cmi.launch_data' : |
233 | 233 | result=''; |
234 | 234 | break; |
235 | 235 | case 'cmi.objectives._count': |
236 | - result='<?php echo $oItem->get_view_count();?>'; |
|
236 | + result='<?php echo $oItem->get_view_count(); ?>'; |
|
237 | 237 | break; |
238 | 238 | default : |
239 | 239 | result=''; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $url = $_SERVER['HTTP_HOST'].$self; |
286 | 286 | $url = substr($url, 0, -14); // 14 is the length of this file's name (/scorm_api.php). |
287 | 287 | echo $url; |
288 | - ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + ""; |
|
288 | + ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id(); ?>&" + param + ""; |
|
289 | 289 | logit_lms('saving data (status='+lesson_status+')',1); |
290 | 290 | xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location); |
291 | 291 | //xajax_update_pgs(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | //$_user = $_SESSION['_user']; |
56 | 56 | $file = $_SESSION['file']; |
57 | 57 | $oLP = unserialize($_SESSION['lpobject']); |
58 | -$oItem =& $oLP->items[$oLP->current]; |
|
58 | +$oItem = & $oLP->items[$oLP->current]; |
|
59 | 59 | if (!is_object($oItem)) { |
60 | 60 | error_log('New LP - aicc_hacp - Could not load oItem item', 0); |
61 | 61 | exit; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | 'evaluation' => array(), |
70 | 70 | 'student_data' => array(), |
71 | 71 | ); |
72 | -$convert_enc = array('%25','%0D','%0A','%09','%20','%2D','%2F','%3B','%3F','%7B','%7D','%7C','%5C','%5E','%7E','%5B','%5D','%60','%23','%3E','%3C','%22'); |
|
73 | -$convert_dec = array('%',"\r","\n","\t",' ','-','/',';','?','{','}','|','\\','^','~','[',']','`','#','>','<','"'); |
|
72 | +$convert_enc = array('%25', '%0D', '%0A', '%09', '%20', '%2D', '%2F', '%3B', '%3F', '%7B', '%7D', '%7C', '%5C', '%5E', '%7E', '%5B', '%5D', '%60', '%23', '%3E', '%3C', '%22'); |
|
73 | +$convert_dec = array('%', "\r", "\n", "\t", ' ', '-', '/', ';', '?', '{', '}', '|', '\\', '^', '~', '[', ']', '`', '#', '>', '<', '"'); |
|
74 | 74 | $crlf = "\r\n"; |
75 | 75 | //$tab = "\t"; |
76 | 76 | $tab = ""; |
@@ -39,60 +39,60 @@ |
||
39 | 39 | case 'manifest': // Do the same as the default. |
40 | 40 | $children = $element->childNodes; |
41 | 41 | foreach ($children as $child) { |
42 | - switch ($child->nodeType) { |
|
43 | - case XML_ELEMENT_NODE: |
|
42 | + switch ($child->nodeType) { |
|
43 | + case XML_ELEMENT_NODE: |
|
44 | 44 | // Could be 'lom', 'schema', 'schemaversion' or 'location'. |
45 | 45 | switch ($child->tagName) { |
46 | - case 'lom': |
|
46 | + case 'lom': |
|
47 | 47 | $childchildren = $child->childNodes; |
48 | - foreach ($childchildren as $childchild) { |
|
49 | - $this->lom = $childchild->nodeValue; |
|
50 | - } |
|
51 | - break; |
|
52 | - case 'schema': |
|
48 | + foreach ($childchildren as $childchild) { |
|
49 | + $this->lom = $childchild->nodeValue; |
|
50 | + } |
|
51 | + break; |
|
52 | + case 'schema': |
|
53 | 53 | $childchildren = $child->childNodes; |
54 | - foreach ($childchildren as $childchild) { |
|
55 | - // There is generally only one child here. |
|
56 | - $this->schema = $childchild->nodeValue; |
|
57 | - } |
|
58 | - break; |
|
59 | - case 'schemaversion': |
|
54 | + foreach ($childchildren as $childchild) { |
|
55 | + // There is generally only one child here. |
|
56 | + $this->schema = $childchild->nodeValue; |
|
57 | + } |
|
58 | + break; |
|
59 | + case 'schemaversion': |
|
60 | 60 | $childchildren = $child->childNodes; |
61 | - foreach ($childchildren as $childchild) { |
|
62 | - // There is generally only one child here. |
|
63 | - $this->schemaversion = $childchild->nodeValue; |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'location': |
|
61 | + foreach ($childchildren as $childchild) { |
|
62 | + // There is generally only one child here. |
|
63 | + $this->schemaversion = $childchild->nodeValue; |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'location': |
|
67 | 67 | $childchildren = $child->childNodes; |
68 | - foreach ($childchildren as $childchild) { |
|
69 | - // There is generally only one child here. |
|
70 | - $this->location = $childchild->nodeValue; |
|
71 | - } |
|
72 | - break; |
|
73 | - } |
|
74 | - break; |
|
75 | - case XML_TEXT_NODE: |
|
68 | + foreach ($childchildren as $childchild) { |
|
69 | + // There is generally only one child here. |
|
70 | + $this->location = $childchild->nodeValue; |
|
71 | + } |
|
72 | + break; |
|
73 | + } |
|
74 | + break; |
|
75 | + case XML_TEXT_NODE: |
|
76 | 76 | if (trim($child->textContent) != '') { |
77 | - if (count($children == 1)) { |
|
78 | - // If this is the only child at this level and it is a content... save differently. |
|
79 | - $this->text = $child->textContent; |
|
80 | - } else { |
|
81 | - $this->text[$element->tagName] = $child->textContent; |
|
82 | - } |
|
83 | - } |
|
84 | - break; |
|
85 | - } |
|
86 | - } |
|
87 | - $attributes = $element->attributes; |
|
88 | - //$keep_href = ''; |
|
89 | - if (is_array($attributes)) { |
|
90 | - foreach ($attributes as $attrib) { |
|
91 | - if (trim($attrib->value) != ''){ |
|
92 | - $this->attribs[$attrib->name] = $attrib->value; |
|
93 | - } |
|
94 | - } |
|
95 | - } |
|
77 | + if (count($children == 1)) { |
|
78 | + // If this is the only child at this level and it is a content... save differently. |
|
79 | + $this->text = $child->textContent; |
|
80 | + } else { |
|
81 | + $this->text[$element->tagName] = $child->textContent; |
|
82 | + } |
|
83 | + } |
|
84 | + break; |
|
85 | + } |
|
86 | + } |
|
87 | + $attributes = $element->attributes; |
|
88 | + //$keep_href = ''; |
|
89 | + if (is_array($attributes)) { |
|
90 | + foreach ($attributes as $attrib) { |
|
91 | + if (trim($attrib->value) != ''){ |
|
92 | + $this->attribs[$attrib->name] = $attrib->value; |
|
93 | + } |
|
94 | + } |
|
95 | + } |
|
96 | 96 | return true; |
97 | 97 | //break; |
98 | 98 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | //$keep_href = ''; |
89 | 89 | if (is_array($attributes)) { |
90 | 90 | foreach ($attributes as $attrib) { |
91 | - if (trim($attrib->value) != ''){ |
|
91 | + if (trim($attrib->value) != '') { |
|
92 | 92 | $this->attribs[$attrib->name] = $attrib->value; |
93 | 93 | } |
94 | 94 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | if (isset($_GET['lp_item_id'])) { |
21 | 21 | |
22 | 22 | // Get parameter only came from lp_view.php. |
23 | - $lp_item_id = intval($_GET['lp_item_id']); |
|
23 | + $lp_item_id = intval($_GET['lp_item_id']); |
|
24 | 24 | if (isset($_SESSION['lpobject'])) { |
25 | 25 | $oLP = unserialize($_SESSION['lpobject']); |
26 | 26 | } |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | |
74 | 74 | $course_id = api_get_course_int_id(); |
75 | 75 | $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_id"; |
76 | -$result=Database::query($sql_query); |
|
76 | +$result = Database::query($sql_query); |
|
77 | 77 | $therow = Database::fetch_array($result); |
78 | 78 | |
79 | 79 | /* SHOWING THE ADMIN TOOLS */ |
80 | 80 | |
81 | 81 | if (api_is_in_gradebook()) { |
82 | - $interbreadcrumb[] = array ( |
|
82 | + $interbreadcrumb[] = array( |
|
83 | 83 | 'url' => api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq(), |
84 | 84 | 'name' => get_lang('ToolGradebook') |
85 | 85 | ); |
@@ -97,7 +97,7 @@ |
||
97 | 97 | // Theme calls |
98 | 98 | $show_learn_path = true; |
99 | 99 | if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { |
100 | - $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
100 | + $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($mode == 'fullpage') { |