@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null; |
35 | 35 | $learnpath_id = (int) $_REQUEST['lp_id']; |
36 | -$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
36 | +$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
37 | 37 | $_course = api_get_course_info(); |
38 | 38 | |
39 | 39 | /* MAIN CODE */ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | if (!empty($gradebook) && $gradebook == 'view') { |
64 | - $interbreadcrumb[] = array ( |
|
64 | + $interbreadcrumb[] = array( |
|
65 | 65 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
66 | 66 | 'name' => get_lang('ToolGradebook') |
67 | 67 | ); |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | $in = implode(',', $lp_items_to_remove_audio); |
100 | 100 | } |
101 | 101 | } |
102 | - if (count($lp_items_to_remove_audio)>0) { |
|
103 | - $sql = "UPDATE $tbl_lp_item SET audio = '' WHERE c_id = $course_id AND id IN (".$in.")"; |
|
102 | + if (count($lp_items_to_remove_audio) > 0) { |
|
103 | + $sql = "UPDATE $tbl_lp_item SET audio = '' WHERE c_id = $course_id AND id IN (".$in.")"; |
|
104 | 104 | $result = Database::query($sql); |
105 | 105 | } |
106 | 106 | |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | // Adding something random to prevent overwriting. |
134 | 134 | $filename_components[count($filename_components) - 1] = time(); |
135 | 135 | // Reconstructing the new filename. |
136 | - $clean_name = implode($filename_components) .'.'.$file_extension; |
|
136 | + $clean_name = implode($filename_components).'.'.$file_extension; |
|
137 | 137 | // Using the new name in the $_FILES superglobal. |
138 | 138 | $_FILES[$key]['name'] = $clean_name; |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Upload the file in the documents tool. |
142 | - $file_path = handle_uploaded_document($_course, $_FILES[$key], api_get_path(SYS_COURSE_PATH).$_course['path'].'/document','/audio', api_get_user_id(), '', '', '', '', false); |
|
142 | + $file_path = handle_uploaded_document($_course, $_FILES[$key], api_get_path(SYS_COURSE_PATH).$_course['path'].'/document', '/audio', api_get_user_id(), '', '', '', '', false); |
|
143 | 143 | |
144 | 144 | // Getting the filename only. |
145 | 145 | $file_components = explode('/', $file_path); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | if (!empty($gradebook) && $gradebook == 'view') { |
25 | - $interbreadcrumb[] = array ( |
|
25 | + $interbreadcrumb[] = array( |
|
26 | 26 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
27 | 27 | 'name' => get_lang('ToolGradebook') |
28 | 28 | ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null; |
54 | 54 | |
55 | -$defaults=array(); |
|
55 | +$defaults = array(); |
|
56 | 56 | $form = new FormValidator('form1', 'post', 'lp_controller.php'); |
57 | 57 | |
58 | 58 | // Form title |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | $content_proximity_select->addOption(get_lang('Remote'), 'remote'); |
94 | 94 | */ |
95 | 95 | //Hide toc frame |
96 | -$hide_toc_frame = $form->addElement('checkbox', 'hide_toc_frame', null, get_lang('HideTocFrame'),array('onclick' => '$("#lp_layout_column").toggle()' )); |
|
96 | +$hide_toc_frame = $form->addElement('checkbox', 'hide_toc_frame', null, get_lang('HideTocFrame'), array('onclick' => '$("#lp_layout_column").toggle()')); |
|
97 | 97 | if (api_get_setting('allow_course_theme') == 'true') { |
98 | 98 | $mycourselptheme = api_get_course_setting('allow_learning_path_theme'); |
99 | - if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) { |
|
99 | + if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) { |
|
100 | 100 | //LP theme picker |
101 | 101 | $theme_select = $form->addElement('SelectTheme', 'lp_theme', get_lang('Theme')); |
102 | 102 | $form->applyFilter('lp_theme', 'trim'); |
@@ -107,27 +107,27 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | // Author |
110 | -$form->addElement('html_editor', 'lp_author', get_lang('Author'), array('size' => 80), array('ToolbarSet' => 'LearningPathAuthor', 'Width' => '100%', 'Height' => '150px') ); |
|
110 | +$form->addElement('html_editor', 'lp_author', get_lang('Author'), array('size' => 80), array('ToolbarSet' => 'LearningPathAuthor', 'Width' => '100%', 'Height' => '150px')); |
|
111 | 111 | $form->applyFilter('lp_author', 'html_filter'); |
112 | 112 | |
113 | 113 | // LP image |
114 | 114 | $form->add_progress_bar(); |
115 | 115 | if (strlen($_SESSION['oLP']->get_preview_image()) > 0) { |
116 | - $show_preview_image='<img src='.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'>'; |
|
116 | + $show_preview_image = '<img src='.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'>'; |
|
117 | 117 | $form->addElement('label', get_lang('ImagePreview'), $show_preview_image); |
118 | 118 | $form->addElement('checkbox', 'remove_picture', null, get_lang('DelImage')); |
119 | 119 | } |
120 | 120 | $label = ($_SESSION['oLP']->get_preview_image() != '' ? get_lang('UpdateImage') : get_lang('AddImage')); |
121 | 121 | $form->addElement('file', 'lp_preview_image', array($label, get_lang('ImageWillResizeMsg'))); |
122 | 122 | |
123 | -$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif')); |
|
123 | +$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif')); |
|
124 | 124 | |
125 | 125 | // Search terms (only if search is activated). |
126 | 126 | if (api_get_setting('search_enabled') === 'true') { |
127 | 127 | $specific_fields = get_specific_field_list(); |
128 | 128 | foreach ($specific_fields as $specific_field) { |
129 | - $form -> addElement ('text', $specific_field['code'], $specific_field['name']); |
|
130 | - $filter = array('c_id'=> "'". api_get_course_int_id() ."'", 'field_id' => $specific_field['id'], 'ref_id' => $_SESSION['oLP']->lp_id, 'tool_id' => '\''. TOOL_LEARNPATH .'\''); |
|
129 | + $form -> addElement('text', $specific_field['code'], $specific_field['name']); |
|
130 | + $filter = array('c_id'=> "'".api_get_course_int_id()."'", 'field_id' => $specific_field['id'], 'ref_id' => $_SESSION['oLP']->lp_id, 'tool_id' => '\''.TOOL_LEARNPATH.'\''); |
|
131 | 131 | $values = get_specific_field_values_list($filter, array('value')); |
132 | 132 | if (!empty($values)) { |
133 | 133 | $arr_str_values = array(); |
@@ -149,36 +149,36 @@ discard block |
||
149 | 149 | $publicated_on = $_SESSION['oLP']->publicated_on; |
150 | 150 | |
151 | 151 | // Prerequisites |
152 | -$form->addElement('html','<div class="form-group">'); |
|
152 | +$form->addElement('html', '<div class="form-group">'); |
|
153 | 153 | $items = $_SESSION['oLP']->display_lp_prerequisites_list(); |
154 | -$form->addElement('html','<label class="col-md-2">'.get_lang('LearnpathPrerequisites').'</label>'); |
|
155 | -$form->addElement('html','<div class="col-md-10">'); |
|
156 | -$form->addElement('html',$items); |
|
154 | +$form->addElement('html', '<label class="col-md-2">'.get_lang('LearnpathPrerequisites').'</label>'); |
|
155 | +$form->addElement('html', '<div class="col-md-10">'); |
|
156 | +$form->addElement('html', $items); |
|
157 | 157 | $form->addElement('html', '<div class="help-block">'.get_lang('LpPrerequisiteDescription').'</div></div></div>'); |
158 | 158 | |
159 | 159 | //Start date |
160 | -$form->addElement('checkbox', 'activate_start_date_check', null,get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()')); |
|
160 | +$form->addElement('checkbox', 'activate_start_date_check', null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()')); |
|
161 | 161 | $display_date = 'none'; |
162 | -if ($publicated_on!='0000-00-00 00:00:00' && !empty($publicated_on)) { |
|
162 | +if ($publicated_on != '0000-00-00 00:00:00' && !empty($publicated_on)) { |
|
163 | 163 | $display_date = 'block'; |
164 | 164 | $defaults['activate_start_date_check'] = 1; |
165 | 165 | } |
166 | 166 | |
167 | -$form->addElement('html','<div id="start_date_div" style="display:'.$display_date.';">'); |
|
167 | +$form->addElement('html', '<div id="start_date_div" style="display:'.$display_date.';">'); |
|
168 | 168 | $form->addElement('DatePicker', 'publicated_on', get_lang('PublicationDate')); |
169 | -$form->addElement('html','</div>'); |
|
169 | +$form->addElement('html', '</div>'); |
|
170 | 170 | |
171 | 171 | //End date |
172 | -$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()')); |
|
172 | +$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()')); |
|
173 | 173 | $display_date = 'none'; |
174 | -if ($expired_on!='0000-00-00 00:00:00' && !empty($expired_on)) { |
|
174 | +if ($expired_on != '0000-00-00 00:00:00' && !empty($expired_on)) { |
|
175 | 175 | $display_date = 'block'; |
176 | 176 | $defaults['activate_end_date_check'] = 1; |
177 | 177 | } |
178 | 178 | |
179 | -$form->addElement('html','<div id="end_date_div" style="display:'.$display_date.';">'); |
|
179 | +$form->addElement('html', '<div id="end_date_div" style="display:'.$display_date.';">'); |
|
180 | 180 | $form->addElement('DatePicker', 'expired_on', get_lang('ExpirationDate')); |
181 | -$form->addElement('html','</div>'); |
|
181 | +$form->addElement('html', '</div>'); |
|
182 | 182 | |
183 | 183 | if (api_is_platform_admin()) { |
184 | 184 | $form->addElement('checkbox', 'use_max_score', null, get_lang('UseMaxScore100')); |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | if ($enableLpExtraFields) { |
205 | 205 | $htmlHeadXtra[] = '<script> |
206 | 206 | $(function() { |
207 | - ' . $extra['jquery_ready_content'] . ' |
|
207 | + ' . $extra['jquery_ready_content'].' |
|
208 | 208 | }); |
209 | 209 | </script>'; |
210 | 210 | } |
211 | 211 | |
212 | 212 | |
213 | -$defaults['publicated_on'] = ($publicated_on!='0000-00-00 00:00:00' && !empty($publicated_on))? api_get_local_time($publicated_on) : date('Y-m-d 12:00:00'); |
|
214 | -$defaults['expired_on'] = ($expired_on !='0000-00-00 00:00:00' && !empty($expired_on) )? api_get_local_time($expired_on): date('Y-m-d 12:00:00',time()+84600); |
|
213 | +$defaults['publicated_on'] = ($publicated_on != '0000-00-00 00:00:00' && !empty($publicated_on)) ? api_get_local_time($publicated_on) : date('Y-m-d 12:00:00'); |
|
214 | +$defaults['expired_on'] = ($expired_on != '0000-00-00 00:00:00' && !empty($expired_on)) ? api_get_local_time($expired_on) : date('Y-m-d 12:00:00', time() + 84600); |
|
215 | 215 | //$defaults['max_attempts'] = $_SESSION['oLP']->get_max_attempts(); |
216 | 216 | $defaults['subscribe_users'] = $_SESSION['oLP']->getSubscribeUsers(); |
217 | 217 | $form->setDefaults($defaults); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | echo '<div class="col-md-12">'; |
227 | 227 | $form -> display(); |
228 | 228 | echo '</div>'; |
229 | -} else{ |
|
229 | +} else { |
|
230 | 230 | echo '<div class="col-md-8">'; |
231 | 231 | $form -> display(); |
232 | 232 | echo '</div>'; |
@@ -69,7 +69,7 @@ |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | //$keep_href = ''; |
72 | - if ($element->hasAttributes()){ //in some cases we get here with an empty attributes array |
|
72 | + if ($element->hasAttributes()) { //in some cases we get here with an empty attributes array |
|
73 | 73 | // TODO: Find when and why we get such a case (empty array). |
74 | 74 | $attributes = $element->attributes; |
75 | 75 | foreach ($attributes as $attrib) { |
@@ -124,22 +124,22 @@ |
||
124 | 124 | $coreExit = $myLPI->get_core_exit(); |
125 | 125 | |
126 | 126 | $return .= |
127 | - "olms.lms_lp_id=".$lpId.";" . |
|
128 | - "olms.lms_item_id=".$newItemId.";" . |
|
129 | - "olms.lms_old_item_id=".$oldItemId.";" . |
|
130 | - "olms.lms_initialized=0;" . |
|
131 | - "olms.lms_view_id=".$viewId.";" . |
|
132 | - "olms.lms_user_id=".$userId.";" . |
|
133 | - "olms.next_item=".$newItemId.";" . // This one is very important to replace possible literal strings. |
|
134 | - "olms.lms_next_item=".$nextItemId.";" . |
|
135 | - "olms.lms_previous_item=".$previousItemId.";" . |
|
136 | - "olms.lms_item_type = '".$itemType."';" . |
|
137 | - "olms.lms_item_credit = '".$credit."';" . |
|
138 | - "olms.lms_item_lesson_mode = '".$lessonMode."';" . |
|
139 | - "olms.lms_item_launch_data = '".$launchData."';" . |
|
140 | - "olms.lms_item_interactions_count = '".$interactionsCount."';" . |
|
141 | - "olms.lms_item_objectives_count = '".$objectivesCount."';" . |
|
142 | - "olms.lms_item_core_exit = '".$coreExit."';" . |
|
127 | + "olms.lms_lp_id=".$lpId.";". |
|
128 | + "olms.lms_item_id=".$newItemId.";". |
|
129 | + "olms.lms_old_item_id=".$oldItemId.";". |
|
130 | + "olms.lms_initialized=0;". |
|
131 | + "olms.lms_view_id=".$viewId.";". |
|
132 | + "olms.lms_user_id=".$userId.";". |
|
133 | + "olms.next_item=".$newItemId.";".// This one is very important to replace possible literal strings. |
|
134 | + "olms.lms_next_item=".$nextItemId.";". |
|
135 | + "olms.lms_previous_item=".$previousItemId.";". |
|
136 | + "olms.lms_item_type = '".$itemType."';". |
|
137 | + "olms.lms_item_credit = '".$credit."';". |
|
138 | + "olms.lms_item_lesson_mode = '".$lessonMode."';". |
|
139 | + "olms.lms_item_launch_data = '".$launchData."';". |
|
140 | + "olms.lms_item_interactions_count = '".$interactionsCount."';". |
|
141 | + "olms.lms_item_objectives_count = '".$objectivesCount."';". |
|
142 | + "olms.lms_item_core_exit = '".$coreExit."';". |
|
143 | 143 | "olms.asset_timer = 0;"; |
144 | 144 | |
145 | 145 | $return .= "update_toc('unhighlight','".$currentItem."');". |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), $doc_url); //echo $doc_url; |
26 | 26 | |
27 | -if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) { |
|
27 | +if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) { |
|
28 | 28 | $doc_url = ''; |
29 | 29 | } |
30 | 30 | $sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm'; |
@@ -50,5 +50,5 @@ discard block |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work. |
|
53 | +Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work. |
|
54 | 54 | exit; |
@@ -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?cidReq=<?php echo api_get_course_id();?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + ""; |
|
288 | + ?>/lp_controller.php?cidReq=<?php echo api_get_course_id(); ?>&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(); |
@@ -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(''); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null; |
19 | 19 | $learnpath_id = (int) $_REQUEST['lp_id']; |
20 | -$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
20 | +$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
21 | 21 | |
22 | 22 | $type = isset($_GET['type']) ? $_GET['type'] : null; |
23 | 23 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | if (!empty($gradebook) && $gradebook == 'view') { |
43 | - $interbreadcrumb[] = array ( |
|
43 | + $interbreadcrumb[] = array( |
|
44 | 44 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
45 | 45 | 'name' => get_lang('ToolGradebook') |
46 | 46 | ); |
@@ -51,19 +51,19 @@ discard block |
||
51 | 51 | |
52 | 52 | switch ($type) { |
53 | 53 | case 'chapter': |
54 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
55 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter')); |
|
54 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
55 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter')); |
|
56 | 56 | break; |
57 | 57 | case 'document': |
58 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
58 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
59 | 59 | break; |
60 | 60 | default: |
61 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep')); |
|
61 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep')); |
|
62 | 62 | break; |
63 | 63 | } |
64 | 64 | |
65 | 65 | if ($action == 'add_item' && $type == 'document') { |
66 | - $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
66 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // Theme calls. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $form = new FormValidator( |
80 | 80 | 'add_audio', |
81 | 81 | 'post', |
82 | - api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id, |
|
82 | + api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id, |
|
83 | 83 | null, |
84 | 84 | array('enctype' => 'multipart/form-data') |
85 | 85 | ); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ); |
86 | 86 | |
87 | 87 | // Generating the thumbnail. |
88 | - $image = $this->base_work_dir.$this->created_dir .'/'. $file_name; |
|
88 | + $image = $this->base_work_dir.$this->created_dir.'/'.$file_name; |
|
89 | 89 | |
90 | 90 | $pattern = '/(\w+)\.png$/'; |
91 | 91 | $replacement = '${1}_thumb.png'; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $my_new_image = new Image($image); |
103 | 103 | $my_new_image->resize($thumb_width, $thumb_height); |
104 | - $my_new_image->send_image($this->base_work_dir.$this->created_dir .'/'. $thumb_name, -1, 'png'); |
|
104 | + $my_new_image->send_image($this->base_work_dir.$this->created_dir.'/'.$thumb_name, -1, 'png'); |
|
105 | 105 | |
106 | 106 | // Adding the thumbnail to documents. |
107 | 107 | $document_id_thumb = add_document( |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | <body> |
128 | 128 | <img src="'.$slide_src.'" /> |
129 | 129 | </body> |
130 | -</html>'); // This indentation is to make the generated html files to look well. |
|
130 | +</html>'); // This indentation is to make the generated html files to look well. |
|
131 | 131 | |
132 | 132 | fclose($fp); |
133 | 133 | $document_id = add_document( |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | foreach ($specific_fields as $specific_field) { |
163 | 163 | if (isset($_REQUEST[$specific_field['code']])) { |
164 | 164 | $sterms = trim($_REQUEST[$specific_field['code']]); |
165 | - $all_specific_terms .= ' '. $sterms; |
|
165 | + $all_specific_terms .= ' '.$sterms; |
|
166 | 166 | if (!empty($sterms)) { |
167 | 167 | $sterms = explode(',', $sterms); |
168 | 168 | foreach ($sterms as $sterm) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | } |
174 | - $slide_body = $all_specific_terms .' '. $slide_body; |
|
174 | + $slide_body = $all_specific_terms.' '.$slide_body; |
|
175 | 175 | $ic_slide->addValue('content', $slide_body); |
176 | 176 | /* FIXME: cidReq:lp_id:doc_id al indexar */ |
177 | 177 | // Add a comment to say terms separated by commas. |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | SE_COURSE_ID => $courseid, |
184 | 184 | SE_TOOL_ID => TOOL_LEARNPATH, |
185 | 185 | SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id), |
186 | - SE_USER => (int)api_get_user_id(), |
|
186 | + SE_USER => (int) api_get_user_id(), |
|
187 | 187 | ); |
188 | 188 | $ic_slide->xapian_data = serialize($xapian_data); |
189 | 189 | $di->addChunk($ic_slide); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $_course = api_get_course_info(); |
222 | 222 | foreach ($files as $file) { |
223 | 223 | // '||' is used as separator between slide name (with accents) and file name (without accents). |
224 | - list($slide_name,$file_name) = explode('||',$file); |
|
224 | + list($slide_name, $file_name) = explode('||', $file); |
|
225 | 225 | $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset); |
226 | 226 | $slide_name = str_replace('’', '\'', $slide_name); |
227 | 227 | $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset); |