@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | require_once '../inc/global.inc.php'; |
15 | 15 | $this_section = SECTION_COURSES; |
16 | -$current_course_tool = TOOL_GROUP; |
|
16 | +$current_course_tool = TOOL_GROUP; |
|
17 | 17 | |
18 | 18 | // Notice for unauthorized people. |
19 | 19 | api_protect_course_script(true); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // Group members |
163 | 163 | $group_member_list = GroupManager::get_subscribed_users($current_group['id']); |
164 | 164 | |
165 | -$selected_users = array (); |
|
165 | +$selected_users = array(); |
|
166 | 166 | if (!empty($group_member_list)) { |
167 | 167 | foreach ($group_member_list as $index => $user) { |
168 | 168 | $selected_users[] = $user['user_id']; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id) |
51 | 51 | WHERE |
52 | 52 | post.cat_id = ".intval($_GET['cat_id'])." AND |
53 | - post.dest_user_id = $user_id" ; |
|
53 | + post.dest_user_id = $user_id"; |
|
54 | 54 | } |
55 | 55 | $files_to_download = array(); |
56 | 56 | $result = Database::query($sql); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX][] = intval($_GET['id']); |
97 | 97 | |
98 | 98 | $work = new Dropbox_Work($_GET['id']); |
99 | - $path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server |
|
99 | + $path = dropbox_cnf('sysPath').'/'.$work -> filename; //path to file as stored on server |
|
100 | 100 | |
101 | 101 | if (!Security::check_abs_path($path, dropbox_cnf('sysPath').'/')) { |
102 | 102 | exit; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
185 | 185 | |
186 | 186 | // Do some sanity checks |
187 | - $id = intval($id); |
|
187 | + $id = intval($id); |
|
188 | 188 | |
189 | 189 | // Get the data from DB |
190 | 190 | $sql = "SELECT uploader_id, filename, filesize, title, description, author, upload_date, last_upload_date, cat_id |
@@ -226,14 +226,14 @@ discard block |
||
226 | 226 | $row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']); |
227 | 227 | $feedback2[] = $row_feedback; |
228 | 228 | } |
229 | - $this->feedback2= $feedback2; |
|
229 | + $this->feedback2 = $feedback2; |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
234 | 234 | class Dropbox_SentWork extends Dropbox_Work |
235 | 235 | { |
236 | - public $recipients; //array of ['id']['name'] arrays |
|
236 | + public $recipients; //array of ['id']['name'] arrays |
|
237 | 237 | |
238 | 238 | /** |
239 | 239 | * Constructor calls private functions to create a new work or retreive an existing work from DB |
@@ -290,15 +290,15 @@ discard block |
||
290 | 290 | settype($uploader_id, 'integer') or die(get_lang('GeneralError').' (code 208)'); // Set $uploader_id to correct type |
291 | 291 | |
292 | 292 | $justSubmit = false; |
293 | - if ( is_int($recipient_ids)) { |
|
293 | + if (is_int($recipient_ids)) { |
|
294 | 294 | $justSubmit = true; |
295 | 295 | $recipient_ids = array($recipient_ids + $this->id); |
296 | - } elseif ( count($recipient_ids) == 0) { |
|
296 | + } elseif (count($recipient_ids) == 0) { |
|
297 | 297 | $justSubmit = true; |
298 | 298 | $recipient_ids = array($uploader_id); |
299 | 299 | } |
300 | 300 | |
301 | - if (! is_array($recipient_ids) || count($recipient_ids) == 0) { |
|
301 | + if (!is_array($recipient_ids) || count($recipient_ids) == 0) { |
|
302 | 302 | die(get_lang('GeneralError').' (code 209)'); |
303 | 303 | } |
304 | 304 | |
@@ -313,11 +313,11 @@ discard block |
||
313 | 313 | $table_person = $dropbox_cnf['tbl_person']; |
314 | 314 | $session_id = api_get_session_id(); |
315 | 315 | $uploader_id = $this->uploader_id; |
316 | - $user = api_get_user_id(); |
|
316 | + $user = api_get_user_id(); |
|
317 | 317 | // Insert data in dropbox_post and dropbox_person table for each recipient |
318 | 318 | foreach ($this->recipients as $rec) { |
319 | - $file_id = (int)$this->id; |
|
320 | - $user_id = (int)$rec['id']; |
|
319 | + $file_id = (int) $this->id; |
|
320 | + $user_id = (int) $rec['id']; |
|
321 | 321 | $sql = "INSERT INTO $table_post (c_id, file_id, dest_user_id, session_id) |
322 | 322 | VALUES ($course_id, $file_id, $user_id, $session_id)"; |
323 | 323 | Database::query($sql); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | // Do not add recipient in person table if mailing zip or just upload. |
335 | 335 | if (!$justSubmit) { |
336 | - Database::query($sql); // If work already exists no error is generated |
|
336 | + Database::query($sql); // If work already exists no error is generated |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $ownerid = getUserOwningThisMailing($ownerid); |
343 | 343 | } |
344 | 344 | if (($recipid = $rec["id"]) > $dropbox_cnf['mailingIdBase']) { |
345 | - $recipid = $ownerid; // mailing file recipient = mailing id, not a person |
|
345 | + $recipid = $ownerid; // mailing file recipient = mailing id, not a person |
|
346 | 346 | } |
347 | 347 | api_item_property_update( |
348 | 348 | $_course, |
@@ -401,13 +401,13 @@ discard block |
||
401 | 401 | class Dropbox_Person |
402 | 402 | { |
403 | 403 | // The receivedWork and the sentWork arrays are sorted. |
404 | - public $receivedWork; // an array of Dropbox_Work objects |
|
405 | - public $sentWork; // an array of Dropbox_SentWork objects |
|
404 | + public $receivedWork; // an array of Dropbox_Work objects |
|
405 | + public $sentWork; // an array of Dropbox_SentWork objects |
|
406 | 406 | |
407 | 407 | public $userId = 0; |
408 | 408 | public $isCourseAdmin = false; |
409 | 409 | public $isCourseTutor = false; |
410 | - public $_orderBy = ''; // private property that determines by which field |
|
410 | + public $_orderBy = ''; // private property that determines by which field |
|
411 | 411 | |
412 | 412 | /** |
413 | 413 | * Constructor for recreating the Dropbox_Person object |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | */ |
507 | 507 | function orderSentWork($sort) |
508 | 508 | { |
509 | - switch($sort) { |
|
509 | + switch ($sort) { |
|
510 | 510 | case 'lastDate': |
511 | 511 | $this->_orderBy = 'last_upload_date'; |
512 | 512 | break; |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | */ |
540 | 540 | function orderReceivedWork($sort) |
541 | 541 | { |
542 | - switch($sort) { |
|
542 | + switch ($sort) { |
|
543 | 543 | case 'lastDate': |
544 | 544 | $this->_orderBy = 'last_upload_date'; |
545 | 545 | break; |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_person']." |
633 | 633 | WHERE c_id = $course_id AND user_id = '".$this->userId."' AND file_id ='".$id."'"; |
634 | 634 | Database::query($sql); |
635 | - removeUnusedFiles(); // Check for unused files |
|
635 | + removeUnusedFiles(); // Check for unused files |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | /** |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | Database::query($sql); |
650 | 650 | removeMoreIfMailing($w->id); |
651 | 651 | } |
652 | - removeUnusedFiles(); // Check for unused files |
|
652 | + removeUnusedFiles(); // Check for unused files |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | /** |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$id."'"; |
684 | 684 | Database::query($sql); |
685 | 685 | removeMoreIfMailing($id); |
686 | - removeUnusedFiles(); // Check for unused files |
|
686 | + removeUnusedFiles(); // Check for unused files |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | /** |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | $wi = -1; |
706 | 706 | foreach ($this->receivedWork as $w) { |
707 | 707 | $wi++; |
708 | - if ($w->id == $id){ |
|
708 | + if ($w->id == $id) { |
|
709 | 709 | $found = true; |
710 | 710 | break; |
711 | 711 | } // foreach (... as $wi -> $w) gives error 221! (no idea why...) |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | */ |
19 | 19 | $dropbox_cnf['courseId'] = $_cid; |
20 | 20 | //path to dropbox subdir in course containing the uploaded files |
21 | -$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox'; |
|
22 | -$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/dropbox'; |
|
21 | +$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox'; |
|
22 | +$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/dropbox'; |
|
23 | 23 | |
24 | 24 | //file size limit as imposed by the platform admin (see Chamilo Config Settings on the platform administration section) |
25 | 25 | $dropbox_cnf['maxFilesize'] = api_get_setting('dropbox_max_filesize'); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | // false = no mailing functionality |
35 | 35 | $dropbox_cnf['allowMailing'] = api_string_2_boolean(api_get_setting('dropbox_allow_mailing')); |
36 | -$dropbox_cnf['mailingIdBase'] = 10000000; // bigger than any user_id, |
|
36 | +$dropbox_cnf['mailingIdBase'] = 10000000; // bigger than any user_id, |
|
37 | 37 | // allowing enough space for pseudo_ids as uploader_id, dest_user_id, user_id: |
38 | 38 | // mailing pseudo_id = dropbox_cnf('mailingIdBase') + mailing id |
39 | 39 | $dropbox_cnf['mailingZipRegexp'] = '/^(.*)(STUDENTID|USERID|LOGINNAME)(.*)\.ZIP$/i'; |
@@ -201,20 +201,20 @@ discard block |
||
201 | 201 | $plan_html = null; |
202 | 202 | if (!empty($data)) { |
203 | 203 | foreach ($data as $plan) { |
204 | - $plan_html .= '<strong>' . $plan['title'] . '</strong><br /> ' . $plan['description'] . '<br />'; |
|
204 | + $plan_html .= '<strong>'.$plan['title'].'</strong><br /> '.$plan['description'].'<br />'; |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | $data = $thematic->get_thematic_advance_by_thematic_id($theme['id']); |
208 | 208 | $advance_html = null; |
209 | 209 | if (!empty($data)) { |
210 | 210 | foreach ($data as $advance) { |
211 | - $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG) . ' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />'; |
|
211 | + $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG).' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />'; |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | $table[] = array($theme['title'], $plan_html, $advance_html); |
215 | 215 | } |
216 | 216 | $params = array( |
217 | - 'filename' => get_lang('Thematic') . '-' . api_get_local_time(), |
|
217 | + 'filename' => get_lang('Thematic').'-'.api_get_local_time(), |
|
218 | 218 | 'pdf_title' => get_lang('Thematic'), |
219 | 219 | 'add_signatures' => true, |
220 | 220 | 'format' => 'A4-L', |
@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | unset($_SESSION['thematic_plan_token']); |
312 | 312 | $data['message'] = 'ok'; |
313 | 313 | |
314 | - $saveRedirect = api_get_path(WEB_PATH) . 'main/course_progress/index.php?'; |
|
315 | - $saveRedirect.= api_get_cidreq() . '&'; |
|
316 | - $saveRedirect.= 'thematic_plan_save_message=ok'; |
|
314 | + $saveRedirect = api_get_path(WEB_PATH).'main/course_progress/index.php?'; |
|
315 | + $saveRedirect .= api_get_cidreq().'&'; |
|
316 | + $saveRedirect .= 'thematic_plan_save_message=ok'; |
|
317 | 317 | |
318 | 318 | header("Location: $saveRedirect"); |
319 | 319 | exit; |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | 'index.php?action=thematic_advance_list&thematic_id='.$thematic_id.'&'.api_get_cidreq( |
26 | 26 | ) |
27 | 27 | ); |
28 | - $form->addElement('header', $header_form); |
|
28 | + $form->addElement('header', $header_form); |
|
29 | 29 | //$form->addElement('hidden', 'thematic_advance_token',$token); |
30 | 30 | $form->addElement('hidden', 'action', $action); |
31 | 31 | |
32 | 32 | if (!empty($thematic_advance_id)) { |
33 | - $form->addElement('hidden', 'thematic_advance_id',$thematic_advance_id); |
|
33 | + $form->addElement('hidden', 'thematic_advance_id', $thematic_advance_id); |
|
34 | 34 | } |
35 | 35 | if (!empty($thematic_id)) { |
36 | - $form->addElement('hidden', 'thematic_id',$thematic_id); |
|
36 | + $form->addElement('hidden', 'thematic_id', $thematic_id); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $radios = array(); |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | // thematic advance list |
177 | 177 | echo '<div class="actions">'; |
178 | 178 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=thematic_details">'. |
179 | - Display::return_icon('back.png', get_lang("BackTo"),'',ICON_SIZE_MEDIUM).'</a>'; |
|
179 | + Display::return_icon('back.png', get_lang("BackTo"), '', ICON_SIZE_MEDIUM).'</a>'; |
|
180 | 180 | if (api_is_allowed_to_edit(false, true)) { |
181 | 181 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=thematic_advance_add&thematic_id='.$thematic_id.'"> '. |
182 | - Display::return_icon('add.png', get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
182 | + Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
183 | 183 | } |
184 | 184 | echo '</div>'; |
185 | 185 | $table = new SortableTable( |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | 12 | if (!empty($thematic_plan_data)) |
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
13 | +foreach ($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | 15 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 16 | } |
17 | 17 | |
18 | 18 | $new_id = ADD_THEMATIC_PLAN; |
19 | 19 | if (!empty($thematic_simple_list)) |
20 | -foreach($thematic_simple_list as $item) { |
|
20 | +foreach ($thematic_simple_list as $item) { |
|
21 | 21 | if ($item >= ADD_THEMATIC_PLAN) { |
22 | 22 | $new_id = $item + 1; |
23 | 23 | $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title']; |
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | -$i=1; |
|
27 | +$i = 1; |
|
28 | 28 | |
29 | 29 | echo Display::tag('h2', $thematic_data['title']); |
30 | 30 | echo $thematic_data['content']; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $thematic_plan = null; |
67 | 67 | } else { |
68 | 68 | $thematic_plan = null; |
69 | - $default['title['.$id.']'] = $title; |
|
70 | - $default['description['.$id.']']= ''; |
|
69 | + $default['title['.$id.']'] = $title; |
|
70 | + $default['description['.$id.']'] = ''; |
|
71 | 71 | } |
72 | 72 | $form->setDefaults($default); |
73 | 73 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $header_form = $default_thematic_plan_title[$description_type]; |
81 | 81 | } |
82 | 82 | if (!$error) { |
83 | - $token = md5(uniqid(rand(),TRUE)); |
|
83 | + $token = md5(uniqid(rand(), TRUE)); |
|
84 | 84 | $_SESSION['thematic_plan_token'] = $token; |
85 | 85 | } |
86 | 86 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | // error messages |
137 | 137 | if ($error) { |
138 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
138 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
139 | 139 | } |
140 | 140 | $form->display(); |
141 | 141 | } |
@@ -23,25 +23,25 @@ discard block |
||
23 | 23 | case 'thematic_add' : |
24 | 24 | case 'thematic_import_select' : |
25 | 25 | echo '<a href="index.php?'.api_get_cidreq().'">'. |
26 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ThematicDetails'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
26 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ThematicDetails'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
27 | 27 | break; |
28 | 28 | case 'thematic_list' : |
29 | 29 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'. |
30 | - Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
30 | + Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
31 | 31 | break; |
32 | 32 | case 'thematic_details' : |
33 | 33 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'. |
34 | - Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
34 | + Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
35 | 35 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_import_select'.$url_token.'">'. |
36 | - Display::return_icon('import_csv.png',get_lang('ImportThematic'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
36 | + Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
37 | 37 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export'.$url_token.'">'. |
38 | - Display::return_icon('export_csv.png',get_lang('ExportThematic'),'', ICON_SIZE_MEDIUM).'</a>'; |
|
38 | + Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
39 | 39 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export_pdf'.$url_token.'">'. |
40 | - Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>'; |
|
40 | + Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
41 | 41 | break; |
42 | 42 | default : |
43 | 43 | echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'. |
44 | - Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
44 | + Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
45 | 45 | } |
46 | 46 | echo '</div>'; |
47 | 47 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | $parameters['action'] = $action; |
58 | 58 | $table->set_additional_parameters($parameters); |
59 | 59 | $table->set_header(0, '', false, array('style'=>'width:20px;')); |
60 | - $table->set_header(1, get_lang('Title'), false ); |
|
60 | + $table->set_header(1, get_lang('Title'), false); |
|
61 | 61 | if (api_is_allowed_to_edit(null, true)) { |
62 | - $table->set_header(2, get_lang('Actions'), false,array('style'=>'text-align:center;width:40%;')); |
|
63 | - $table->set_form_actions(array ('thematic_delete_select' => get_lang('DeleteAllThematics'))); |
|
62 | + $table->set_header(2, get_lang('Actions'), false, array('style'=>'text-align:center;width:40%;')); |
|
63 | + $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics'))); |
|
64 | 64 | } |
65 | 65 | $table->display(); |
66 | 66 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | |
73 | 73 | if (isset($last_id) && $last_id) { |
74 | 74 | $link_to_thematic_plan = '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$last_id.'">'. |
75 | - Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>'; |
|
75 | + Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>'; |
|
76 | 76 | $link_to_thematic_advance = '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$last_id.'">'. |
77 | - Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>'; |
|
77 | + Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>'; |
|
78 | 78 | Display::display_confirmation_message( |
79 | - get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'),$link_to_thematic_plan, $link_to_thematic_advance), |
|
79 | + get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'), $link_to_thematic_plan, $link_to_thematic_advance), |
|
80 | 80 | false |
81 | 81 | ); |
82 | 82 | } |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | $actions_first_col = ''; |
114 | 114 | if (api_is_allowed_to_edit(null, true)) { |
115 | 115 | // Thematic title |
116 | - $actions_first_col = Display::url( |
|
116 | + $actions_first_col = Display::url( |
|
117 | 117 | Display::return_icon('cd.gif', get_lang('Copy')), |
118 | 118 | 'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$my_thematic_id.$params.$url_token |
119 | 119 | ); |
120 | - if (api_get_session_id() == 0 ) { |
|
120 | + if (api_get_session_id() == 0) { |
|
121 | 121 | |
122 | 122 | if ($thematic['display_order'] > 1) { |
123 | - $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>'; |
|
123 | + $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>'; |
|
124 | 124 | } else { |
125 | - $actions_first_col .= ' '.Display::return_icon('up_na.png',' ','',ICON_SIZE_SMALL); |
|
125 | + $actions_first_col .= ' '.Display::return_icon('up_na.png', ' ', '', ICON_SIZE_SMALL); |
|
126 | 126 | } |
127 | 127 | if (isset($thematic['max_thematic_item']) && $thematic['display_order'] < $thematic['max_thematic_item']) { |
128 | - $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>'; |
|
128 | + $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>'; |
|
129 | 129 | } else { |
130 | - $actions_first_col .= ' '.Display::return_icon('down_na.png',' ','',ICON_SIZE_SMALL); |
|
130 | + $actions_first_col .= ' '.Display::return_icon('down_na.png', ' ', '', ICON_SIZE_SMALL); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | } |
134 | 134 | if (api_get_session_id() == $thematic['session_id']) { |
135 | - $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
136 | - $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
135 | + $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
136 | + $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $actions_first_col = Display::div($actions_first_col, array('id'=>'thematic_id_content_'.$thematic['id'], 'class'=>'thematic_tools')); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | //if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) { |
150 | 150 | if (api_is_allowed_to_edit(null, true)) { |
151 | 151 | echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&origin=thematic_details&action=thematic_plan_list&thematic_id='.$thematic['id'].'&width=700&height=500">'. |
152 | - Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'),ICON_SIZE_MEDIUM).'</a></div><br />'; |
|
152 | + Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'), ICON_SIZE_MEDIUM).'</a></div><br />'; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | if (empty($thematic_plan_div[$thematic['id']])) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | //if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) { |
166 | 166 | if (api_is_allowed_to_edit(null, true)) { |
167 | 167 | echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&action=thematic_advance_add&thematic_id='.$thematic['id'].'">'. |
168 | - Display::return_icon('add.png',get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a></div>'; |
|
168 | + Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a></div>'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | //if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | [], |
188 | 188 | ICON_SIZE_SMALL |
189 | 189 | ), |
190 | - 'index.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
190 | + 'index.php?'.api_get_cidreq().'&'.http_build_query([ |
|
191 | 191 | 'action' => 'thematic_advance_edit', |
192 | 192 | 'thematic_id' => $thematic['id'], |
193 | 193 | 'thematic_advance_id' => $thematic_advance['id'], |
@@ -198,17 +198,17 @@ discard block |
||
198 | 198 | 'data-title' => get_lang('EditThematicAdvance') |
199 | 199 | ] |
200 | 200 | ); |
201 | - $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'. |
|
202 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>'; |
|
201 | + $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'. |
|
202 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a></center>'; |
|
203 | 203 | |
204 | 204 | //Links |
205 | 205 | $edit_link = Display::div( |
206 | - Display::div($edit_link , array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')), |
|
206 | + Display::div($edit_link, array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')), |
|
207 | 207 | array('style'=>'height:20px;') |
208 | 208 | ); |
209 | 209 | } |
210 | 210 | |
211 | - $thematic_advance_item = isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null; |
|
211 | + $thematic_advance_item = isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null; |
|
212 | 212 | echo Display::div($thematic_advance_item, array('id'=>'thematic_advance_'.$thematic_advance['id'])); |
213 | 213 | echo $edit_link; |
214 | 214 | echo '</td>'; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } elseif ($action == 'thematic_add' || $action == 'thematic_edit') { |
254 | 254 | |
255 | 255 | // Display form |
256 | - $form = new FormValidator('thematic_add','POST','index.php?action=thematic_add&'.api_get_cidreq()); |
|
256 | + $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq()); |
|
257 | 257 | |
258 | 258 | if ($action == 'thematic_edit') { |
259 | 259 | $form->addElement('header', '', get_lang('EditThematicSection')); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $form->addElement('hidden', 'action', $action); |
264 | 264 | |
265 | 265 | if (!empty($thematic_id)) { |
266 | - $form->addElement('hidden', 'thematic_id',$thematic_id); |
|
266 | + $form->addElement('hidden', 'thematic_id', $thematic_id); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | $form->addText('title', get_lang('Title'), true, array('size'=>'50')); |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | if (!empty($thematic_data)) { |
276 | 276 | if (api_get_session_id()) { |
277 | 277 | if ($thematic_data['session_id'] != api_get_session_id()) { |
278 | - $show_form = false; |
|
279 | - Display::display_error_message(get_lang('NotAllowedClickBack'),false); |
|
278 | + $show_form = false; |
|
279 | + Display::display_error_message(get_lang('NotAllowedClickBack'), false); |
|
280 | 280 | } |
281 | 281 | } |
282 | 282 | // set default values |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | |
288 | 288 | // error messages |
289 | 289 | if (isset($error)) { |
290 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
290 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
291 | 291 | } |
292 | 292 | if ($show_form) { |
293 | 293 | $form->display(); |
294 | 294 | } |
295 | 295 | } elseif ($action == 'thematic_import_select') { |
296 | 296 | // Create form to upload csv file. |
297 | - $form = new FormValidator('thematic_import','POST','index.php?action=thematic_import&'.api_get_cidreq().$url_token); |
|
297 | + $form = new FormValidator('thematic_import', 'POST', 'index.php?action=thematic_import&'.api_get_cidreq().$url_token); |
|
298 | 298 | $form->addElement('header', get_lang('ImportThematic')); |
299 | 299 | $form->addElement('file', 'file'); |
300 | 300 | $form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic')); |
@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | $res = Database::query($sql); |
200 | 200 | if (Database::num_rows($res) > 0) { |
201 | 201 | $se_ref = Database::fetch_array($res); |
202 | - $this->search_did = (int)$se_ref['search_did']; |
|
202 | + $this->search_did = (int) $se_ref['search_did']; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | $this->audio = $row['audio']; |
206 | 206 | if (self::debug > 0) { |
207 | 207 | error_log( |
208 | - 'New LP - End of learnpathItem constructor for item ' . $id, |
|
208 | + 'New LP - End of learnpathItem constructor for item '.$id, |
|
209 | 209 | 0 |
210 | 210 | ); |
211 | 211 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | public function delete() |
315 | 315 | { |
316 | 316 | if (self::debug > 0) { |
317 | - error_log('learnpath_item::delete() for item ' . $this->db_id, 0); |
|
317 | + error_log('learnpath_item::delete() for item '.$this->db_id, 0); |
|
318 | 318 | } |
319 | 319 | $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
320 | 320 | $lp_item = Database::get_course_table(TABLE_LP_ITEM); |
@@ -322,29 +322,29 @@ discard block |
||
322 | 322 | $course_id = api_get_course_int_id(); |
323 | 323 | |
324 | 324 | $sql = "DELETE FROM $lp_item_view |
325 | - WHERE c_id = $course_id AND lp_item_id = " . $this->db_id; |
|
325 | + WHERE c_id = $course_id AND lp_item_id = ".$this->db_id; |
|
326 | 326 | if (self::debug > 0) { |
327 | - error_log('Deleting from lp_item_view: ' . $sql, 0); |
|
327 | + error_log('Deleting from lp_item_view: '.$sql, 0); |
|
328 | 328 | } |
329 | 329 | Database::query($sql); |
330 | 330 | |
331 | 331 | $sql = "SELECT * FROM $lp_item |
332 | - WHERE c_id = $course_id AND id = " . $this->db_id; |
|
332 | + WHERE c_id = $course_id AND id = ".$this->db_id; |
|
333 | 333 | $res_sel = Database::query($sql); |
334 | 334 | if (Database::num_rows($res_sel) < 1) { |
335 | 335 | return false; |
336 | 336 | } |
337 | 337 | |
338 | 338 | $sql = "DELETE FROM $lp_item |
339 | - WHERE c_id = $course_id AND id = " . $this->db_id; |
|
339 | + WHERE c_id = $course_id AND id = ".$this->db_id; |
|
340 | 340 | Database::query($sql); |
341 | 341 | if (self::debug > 0) { |
342 | - error_log('Deleting from lp_item: ' . $sql); |
|
342 | + error_log('Deleting from lp_item: '.$sql); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | if (api_get_setting('search_enabled') == 'true') { |
346 | 346 | if (!is_null($this->search_did)) { |
347 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
347 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
348 | 348 | $di = new ChamiloIndexer(); |
349 | 349 | $di->remove_document($this->search_did); |
350 | 350 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | if (self::debug > 0) { |
382 | 382 | error_log( |
383 | - 'learnpathItem::get_attempt_id() on item ' . $this->db_id, |
|
383 | + 'learnpathItem::get_attempt_id() on item '.$this->db_id, |
|
384 | 384 | 0 |
385 | 385 | ); |
386 | 386 | } |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | } |
391 | 391 | if (self::debug > 0) { |
392 | 392 | error_log( |
393 | - 'New LP - End of learnpathItem::get_attempt_id() on item ' . |
|
394 | - $this->db_id . ' - Returning ' . $res, |
|
393 | + 'New LP - End of learnpathItem::get_attempt_id() on item '. |
|
394 | + $this->db_id.' - Returning '.$res, |
|
395 | 395 | 0 |
396 | 396 | ); |
397 | 397 | } |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | if (self::debug > 2) { |
454 | 454 | error_log( |
455 | 455 | 'learnpathItem::get_credit() - get_prevent_reinit!=0 and '. |
456 | - 'status is ' . $status, |
|
456 | + 'status is '.$status, |
|
457 | 457 | 0 |
458 | 458 | ); |
459 | 459 | } |
460 | 460 | //0=not attempted - 1 = incomplete |
461 | - if ($status != $this->possible_status[0]&& |
|
461 | + if ($status != $this->possible_status[0] && |
|
462 | 462 | $status != $this->possible_status[1] |
463 | 463 | ) { |
464 | 464 | $credit = 'no-credit'; |
@@ -532,13 +532,13 @@ discard block |
||
532 | 532 | case TOOL_DOCUMENT: |
533 | 533 | $table_doc = Database::get_course_table(TABLE_DOCUMENT); |
534 | 534 | $sql = 'SELECT path |
535 | - FROM ' . $table_doc . ' |
|
535 | + FROM ' . $table_doc.' |
|
536 | 536 | WHERE |
537 | - c_id = ' . $course_id . ' AND |
|
537 | + c_id = ' . $course_id.' AND |
|
538 | 538 | id = ' . $path; |
539 | 539 | $res = Database::query($sql); |
540 | 540 | $row = Database::fetch_array($res); |
541 | - $real_path = 'document' . $row['path']; |
|
541 | + $real_path = 'document'.$row['path']; |
|
542 | 542 | return $real_path; |
543 | 543 | case TOOL_STUDENTPUBLICATION: |
544 | 544 | case TOOL_QUIZ: |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | } |
551 | 551 | } else { |
552 | 552 | if (!empty($path_to_scorm_dir)) { |
553 | - $path = $path_to_scorm_dir . $path; |
|
553 | + $path = $path_to_scorm_dir.$path; |
|
554 | 554 | } |
555 | 555 | return $path; |
556 | 556 | } |
@@ -586,8 +586,8 @@ discard block |
||
586 | 586 | $sql = "SELECT id FROM $tbl |
587 | 587 | WHERE |
588 | 588 | c_id = $course_id AND |
589 | - lp_item_id = " . $this->db_id . " AND |
|
590 | - lp_view_id = " . $this->view_id . " AND |
|
589 | + lp_item_id = ".$this->db_id." AND |
|
590 | + lp_view_id = " . $this->view_id." AND |
|
591 | 591 | view_count = " . $this->attempt_id; |
592 | 592 | $res = Database::query($sql); |
593 | 593 | if (Database::num_rows($res) > 0) { |
@@ -630,8 +630,8 @@ discard block |
||
630 | 630 | $sql = "SELECT id FROM $tbl |
631 | 631 | WHERE |
632 | 632 | c_id = $course_id AND |
633 | - lp_item_id = " . $this->db_id . " AND |
|
634 | - lp_view_id = " . $this->view_id ." AND |
|
633 | + lp_item_id = ".$this->db_id." AND |
|
634 | + lp_view_id = " . $this->view_id." AND |
|
635 | 635 | view_count = " . $this->get_attempt_id(); |
636 | 636 | $res = Database::query($sql); |
637 | 637 | if (Database::num_rows($res) > 0) { |
@@ -671,13 +671,13 @@ discard block |
||
671 | 671 | foreach ($this->interactions as $id => $in) { |
672 | 672 | $return .= "[ |
673 | 673 | '$id', |
674 | - '" . $in[1] . "', |
|
675 | - '" . $in[2] . "', |
|
676 | - '" . $in[3] . "', |
|
677 | - '" . $in[4] . "', |
|
678 | - '" . $in[5] . "', |
|
679 | - '" . $in[6] . "', |
|
680 | - '" . $in[7] . "'],"; |
|
674 | + '".$in[1]."', |
|
675 | + '" . $in[2]."', |
|
676 | + '" . $in[3]."', |
|
677 | + '" . $in[4]."', |
|
678 | + '" . $in[5]."', |
|
679 | + '" . $in[6]."', |
|
680 | + '" . $in[7]."'],"; |
|
681 | 681 | } |
682 | 682 | if (!empty($return)) { |
683 | 683 | $return = substr($return, 0, -1); |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | $table = Database::get_course_table(TABLE_LP_MAIN); |
920 | 920 | $sql = "SELECT prevent_reinit |
921 | 921 | FROM $table |
922 | - WHERE c_id = $course_id AND id = " . $this->lp_id; |
|
922 | + WHERE c_id = $course_id AND id = ".$this->lp_id; |
|
923 | 923 | $res = Database::query($sql); |
924 | 924 | if (Database::num_rows($res) < 1) { |
925 | 925 | $this->error = "Could not find parent learnpath in lp table"; |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | } |
942 | 942 | if (self::debug > 2) { |
943 | 943 | error_log( |
944 | - 'New LP - End of learnpathItem::get_prevent_reinit() - Returned ' . $this->prevent_reinit, |
|
944 | + 'New LP - End of learnpathItem::get_prevent_reinit() - Returned '.$this->prevent_reinit, |
|
945 | 945 | 0 |
946 | 946 | ); |
947 | 947 | } |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $table = Database::get_course_table(TABLE_LP_MAIN); |
967 | 967 | $sql = "SELECT seriousgame_mode |
968 | 968 | FROM $table |
969 | - WHERE c_id = $course_id AND id = " . $this->lp_id; |
|
969 | + WHERE c_id = $course_id AND id = ".$this->lp_id; |
|
970 | 970 | $res = Database::query($sql); |
971 | 971 | if (Database::num_rows($res) < 1) { |
972 | 972 | $this->error = "Could not find parent learnpath in learnpath table"; |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | } |
988 | 988 | if (self::debug > 2) { |
989 | 989 | error_log( |
990 | - 'New LP - End of learnpathItem::get_seriousgame_mode() - Returned ' . $this->seriousgame_mode, |
|
990 | + 'New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode, |
|
991 | 991 | 0 |
992 | 992 | ); |
993 | 993 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | if (!isset($abs_path)) { |
1034 | 1034 | $path = $this->get_file_path(); |
1035 | - $abs_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . $path; |
|
1035 | + $abs_path = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.$path; |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | $files_list = array(); |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | $abs_path |
1308 | 1308 | ); |
1309 | 1309 | $new_abs_path = realpath( |
1310 | - $dir . '/' . $second_part |
|
1310 | + $dir.'/'.$second_part |
|
1311 | 1311 | ); |
1312 | 1312 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1313 | 1313 | TOOL_DOCUMENT, |
@@ -1345,7 +1345,7 @@ discard block |
||
1345 | 1345 | $abs_path |
1346 | 1346 | ); |
1347 | 1347 | $new_abs_path = realpath( |
1348 | - $dir . '/' . $second_part |
|
1348 | + $dir.'/'.$second_part |
|
1349 | 1349 | ); |
1350 | 1350 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1351 | 1351 | TOOL_DOCUMENT, |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | $abs_path |
1453 | 1453 | ); |
1454 | 1454 | $new_abs_path = realpath( |
1455 | - $dir . '/' . $source |
|
1455 | + $dir.'/'.$source |
|
1456 | 1456 | ); |
1457 | 1457 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1458 | 1458 | TOOL_DOCUMENT, |
@@ -1490,7 +1490,7 @@ discard block |
||
1490 | 1490 | $abs_path |
1491 | 1491 | ); |
1492 | 1492 | $new_abs_path = realpath( |
1493 | - $dir . '/' . $source |
|
1493 | + $dir.'/'.$source |
|
1494 | 1494 | ); |
1495 | 1495 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1496 | 1496 | TOOL_DOCUMENT, |
@@ -1574,7 +1574,7 @@ discard block |
||
1574 | 1574 | ); |
1575 | 1575 | $dir = dirname($abs_path); |
1576 | 1576 | $new_abs_path = realpath( |
1577 | - $dir . '/' . $source |
|
1577 | + $dir.'/'.$source |
|
1578 | 1578 | ); |
1579 | 1579 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1580 | 1580 | TOOL_DOCUMENT, |
@@ -1619,7 +1619,7 @@ discard block |
||
1619 | 1619 | ); |
1620 | 1620 | $dir = dirname($abs_path); |
1621 | 1621 | $new_abs_path = realpath( |
1622 | - $dir . '/' . $source |
|
1622 | + $dir.'/'.$source |
|
1623 | 1623 | ); |
1624 | 1624 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1625 | 1625 | TOOL_DOCUMENT, |
@@ -1679,7 +1679,7 @@ discard block |
||
1679 | 1679 | } |
1680 | 1680 | if (self::debug > 1) { |
1681 | 1681 | error_log( |
1682 | - 'New LP - Out of learnpathItem::get_score() - returning ' . $res, |
|
1682 | + 'New LP - Out of learnpathItem::get_score() - returning '.$res, |
|
1683 | 1683 | 0 |
1684 | 1684 | ); |
1685 | 1685 | } |
@@ -1699,7 +1699,7 @@ discard block |
||
1699 | 1699 | $course_id = api_get_course_int_id(); |
1700 | 1700 | $debug = self::debug; |
1701 | 1701 | if ($debug > 0) { |
1702 | - error_log('learnpathItem::get_status() on item ' . $this->db_id, 0); |
|
1702 | + error_log('learnpathItem::get_status() on item '.$this->db_id, 0); |
|
1703 | 1703 | } |
1704 | 1704 | if ($check_db) { |
1705 | 1705 | if ($debug > 2) { |
@@ -1710,12 +1710,12 @@ discard block |
||
1710 | 1710 | $sql = "SELECT status FROM $table |
1711 | 1711 | WHERE |
1712 | 1712 | c_id = $course_id AND |
1713 | - id = '" . $this->db_item_view_id . "' AND |
|
1714 | - view_count = '" . $this->get_attempt_id() . "'"; |
|
1713 | + id = '".$this->db_item_view_id."' AND |
|
1714 | + view_count = '" . $this->get_attempt_id()."'"; |
|
1715 | 1715 | |
1716 | 1716 | if ($debug > 2) { |
1717 | 1717 | error_log( |
1718 | - 'learnpathItem::get_status() - Checking DB: ' . $sql, |
|
1718 | + 'learnpathItem::get_status() - Checking DB: '.$sql, |
|
1719 | 1719 | 0 |
1720 | 1720 | ); |
1721 | 1721 | } |
@@ -1726,7 +1726,7 @@ discard block |
||
1726 | 1726 | if ($update_local) { |
1727 | 1727 | if ($debug > 2) { |
1728 | 1728 | error_log( |
1729 | - 'learnpathItem::set_status() :' . $row['status'], |
|
1729 | + 'learnpathItem::set_status() :'.$row['status'], |
|
1730 | 1730 | 0 |
1731 | 1731 | ); |
1732 | 1732 | } |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | } |
1735 | 1735 | if ($debug > 2) { |
1736 | 1736 | error_log( |
1737 | - 'learnpathItem::get_status() - Returning db value ' . $row['status'], |
|
1737 | + 'learnpathItem::get_status() - Returning db value '.$row['status'], |
|
1738 | 1738 | 0 |
1739 | 1739 | ); |
1740 | 1740 | } |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | if (!empty($this->status)) { |
1752 | 1752 | if ($debug > 2) { |
1753 | 1753 | error_log( |
1754 | - 'learnpathItem::get_status() - Returning attrib: ' . $this->status, |
|
1754 | + 'learnpathItem::get_status() - Returning attrib: '.$this->status, |
|
1755 | 1755 | 0 |
1756 | 1756 | ); |
1757 | 1757 | } |
@@ -1761,7 +1761,7 @@ discard block |
||
1761 | 1761 | |
1762 | 1762 | if ($debug > 2) { |
1763 | 1763 | error_log( |
1764 | - 'learnpathItem::get_status() - Returning default ' . $this->possible_status[0], |
|
1764 | + 'learnpathItem::get_status() - Returning default '.$this->possible_status[0], |
|
1765 | 1765 | 0 |
1766 | 1766 | ); |
1767 | 1767 | } |
@@ -1801,7 +1801,7 @@ discard block |
||
1801 | 1801 | if ($origin == 'js') { |
1802 | 1802 | return '00 : 00: 00'; |
1803 | 1803 | } else { |
1804 | - return '00 ' . $h . ' 00 \' 00"'; |
|
1804 | + return '00 '.$h.' 00 \' 00"'; |
|
1805 | 1805 | } |
1806 | 1806 | } else { |
1807 | 1807 | return api_format_time($time, $origin); |
@@ -1826,7 +1826,7 @@ discard block |
||
1826 | 1826 | if (!isset($given_time)) { |
1827 | 1827 | if (self::debug > 2) { |
1828 | 1828 | error_log( |
1829 | - 'learnpathItem::get_scorm_time(): given time empty, current_start_time = ' . $this->current_start_time, |
|
1829 | + 'learnpathItem::get_scorm_time(): given time empty, current_start_time = '.$this->current_start_time, |
|
1830 | 1830 | 0 |
1831 | 1831 | ); |
1832 | 1832 | } |
@@ -1836,8 +1836,8 @@ discard block |
||
1836 | 1836 | FROM $table |
1837 | 1837 | WHERE |
1838 | 1838 | c_id = $course_id AND |
1839 | - id = '" . $this->db_item_view_id . "' AND |
|
1840 | - view_count = '" . $this->get_attempt_id() . "'"; |
|
1839 | + id = '".$this->db_item_view_id."' AND |
|
1840 | + view_count = '" . $this->get_attempt_id()."'"; |
|
1841 | 1841 | $res = Database::query($sql); |
1842 | 1842 | $row = Database::fetch_array($res); |
1843 | 1843 | $start = $row['start_time']; |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | } |
1859 | 1859 | if (self::debug > 2) { |
1860 | 1860 | error_log( |
1861 | - 'learnpathItem::get_scorm_time(): intermediate = ' . $time, |
|
1861 | + 'learnpathItem::get_scorm_time(): intermediate = '.$time, |
|
1862 | 1862 | 0 |
1863 | 1863 | ); |
1864 | 1864 | } |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | $sql = "SELECT * FROM $lp_item |
1879 | 1879 | WHERE |
1880 | 1880 | c_id = $course_id AND |
1881 | - id='" . intval($this->db_id) . "'"; |
|
1881 | + id='".intval($this->db_id)."'"; |
|
1882 | 1882 | $res = Database::query($sql); |
1883 | 1883 | $row = Database::fetch_array($res); |
1884 | 1884 | return $row['terms']; |
@@ -1907,9 +1907,9 @@ discard block |
||
1907 | 1907 | { |
1908 | 1908 | if (self::debug > 0) { |
1909 | 1909 | error_log( |
1910 | - 'learnpathItem::get_total_time() for item ' . $this->db_id . |
|
1911 | - ' - Initially, current_start_time = ' . $this->current_start_time . |
|
1912 | - ' and current_stop_time = ' . $this->current_stop_time, |
|
1910 | + 'learnpathItem::get_total_time() for item '.$this->db_id. |
|
1911 | + ' - Initially, current_start_time = '.$this->current_start_time. |
|
1912 | + ' and current_stop_time = '.$this->current_stop_time, |
|
1913 | 1913 | 0 |
1914 | 1914 | ); |
1915 | 1915 | } |
@@ -1950,9 +1950,9 @@ discard block |
||
1950 | 1950 | } else { |
1951 | 1951 | if (self::debug > 2) { |
1952 | 1952 | error_log( |
1953 | - 'learnpathItem::get_total_time() - Current start time = ' . |
|
1954 | - $this->current_start_time . ', current stop time = ' . |
|
1955 | - $this->current_stop_time . ' Returning ' . $time . "-----------\n", |
|
1953 | + 'learnpathItem::get_total_time() - Current start time = '. |
|
1954 | + $this->current_start_time.', current stop time = '. |
|
1955 | + $this->current_stop_time.' Returning '.$time."-----------\n", |
|
1956 | 1956 | 0 |
1957 | 1957 | ); |
1958 | 1958 | } |
@@ -1972,7 +1972,7 @@ discard block |
||
1972 | 1972 | } |
1973 | 1973 | if (self::debug > 2) { |
1974 | 1974 | error_log( |
1975 | - 'learnpathItem::get_type() - Returning ' . $res . ' for item ' . $this->db_id, |
|
1975 | + 'learnpathItem::get_type() - Returning '.$res.' for item '.$this->db_id, |
|
1976 | 1976 | 0 |
1977 | 1977 | ); |
1978 | 1978 | } |
@@ -2012,8 +2012,8 @@ discard block |
||
2012 | 2012 | if ($this->status_is($completedStatusList)) { |
2013 | 2013 | if (self::debug > 2) { |
2014 | 2014 | error_log( |
2015 | - 'learnpath::is_done() - Item ' . $this->get_id( |
|
2016 | - ) . ' is complete', |
|
2015 | + 'learnpath::is_done() - Item '.$this->get_id( |
|
2016 | + ).' is complete', |
|
2017 | 2017 | 0 |
2018 | 2018 | ); |
2019 | 2019 | } |
@@ -2022,8 +2022,8 @@ discard block |
||
2022 | 2022 | } else { |
2023 | 2023 | if (self::debug > 2) { |
2024 | 2024 | error_log( |
2025 | - 'learnpath::is_done() - Item ' . $this->get_id( |
|
2026 | - ) . ' is not complete', |
|
2025 | + 'learnpath::is_done() - Item '.$this->get_id( |
|
2026 | + ).' is not complete', |
|
2027 | 2027 | 0 |
2028 | 2028 | ); |
2029 | 2029 | } |
@@ -2060,7 +2060,7 @@ discard block |
||
2060 | 2060 | } |
2061 | 2061 | if (self::debug > 2) { |
2062 | 2062 | error_log( |
2063 | - 'New LP - End of learnpathItem::is_restart_allowed() - Returning ' . $restart, |
|
2063 | + 'New LP - End of learnpathItem::is_restart_allowed() - Returning '.$restart, |
|
2064 | 2064 | 0 |
2065 | 2065 | ); |
2066 | 2066 | } |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | { |
2140 | 2140 | if (self::debug > 0) { |
2141 | 2141 | error_log( |
2142 | - 'learnpathItem::parse_prereq() for learnpath ' . $this->lp_id . ' with string ' . $prereqs_string, |
|
2142 | + 'learnpathItem::parse_prereq() for learnpath '.$this->lp_id.' with string '.$prereqs_string, |
|
2143 | 2143 | 0 |
2144 | 2144 | ); |
2145 | 2145 | } |
@@ -2332,7 +2332,7 @@ discard block |
||
2332 | 2332 | // Strange... |
2333 | 2333 | if (self::debug > 1) { |
2334 | 2334 | error_log( |
2335 | - 'New LP - Found ~ but strange string: ' . $prereqs_string, |
|
2335 | + 'New LP - Found ~ but strange string: '.$prereqs_string, |
|
2336 | 2336 | 0 |
2337 | 2337 | ); |
2338 | 2338 | } |
@@ -2360,7 +2360,7 @@ discard block |
||
2360 | 2360 | // the big brackets-enclosed condition. |
2361 | 2361 | if (self::debug > 1) { |
2362 | 2362 | error_log( |
2363 | - 'New LP - Dealing with group ' . $gr, |
|
2363 | + 'New LP - Dealing with group '.$gr, |
|
2364 | 2364 | 0 |
2365 | 2365 | ); |
2366 | 2366 | } |
@@ -2374,7 +2374,7 @@ discard block |
||
2374 | 2374 | ) { |
2375 | 2375 | if (self::debug > 1) { |
2376 | 2376 | error_log( |
2377 | - 'New LP - Found multiplier ' . $multi[0], |
|
2377 | + 'New LP - Found multiplier '.$multi[0], |
|
2378 | 2378 | 0 |
2379 | 2379 | ); |
2380 | 2380 | } |
@@ -2390,7 +2390,7 @@ discard block |
||
2390 | 2390 | $mytrue++; |
2391 | 2391 | if (self::debug > 1) { |
2392 | 2392 | error_log( |
2393 | - 'New LP - Found true item, counting.. (' . ($mytrue) . ')', |
|
2393 | + 'New LP - Found true item, counting.. ('.($mytrue).')', |
|
2394 | 2394 | 0 |
2395 | 2395 | ); |
2396 | 2396 | } |
@@ -2398,7 +2398,7 @@ discard block |
||
2398 | 2398 | } else { |
2399 | 2399 | if (self::debug > 1) { |
2400 | 2400 | error_log( |
2401 | - 'New LP - item ' . $cond . ' does not exist in items list', |
|
2401 | + 'New LP - item '.$cond.' does not exist in items list', |
|
2402 | 2402 | 0 |
2403 | 2403 | ); |
2404 | 2404 | } |
@@ -2445,7 +2445,7 @@ discard block |
||
2445 | 2445 | } else { |
2446 | 2446 | if (self::debug > 1) { |
2447 | 2447 | error_log( |
2448 | - 'New LP - ' . |
|
2448 | + 'New LP - '. |
|
2449 | 2449 | ' Found false item, the set is not true, return false', |
2450 | 2450 | 0 |
2451 | 2451 | ); |
@@ -2456,7 +2456,7 @@ discard block |
||
2456 | 2456 | } else { |
2457 | 2457 | if (self::debug > 1) { |
2458 | 2458 | error_log( |
2459 | - 'New LP - item ' . $cond . ' does not exist in items list', |
|
2459 | + 'New LP - item '.$cond.' does not exist in items list', |
|
2460 | 2460 | 0 |
2461 | 2461 | ); |
2462 | 2462 | } |
@@ -2482,7 +2482,7 @@ discard block |
||
2482 | 2482 | // value of the corresponding resource completion status. |
2483 | 2483 | if (self::debug > 1) { |
2484 | 2484 | error_log( |
2485 | - 'New LP - Didnt find any group, returning value for ' . $prereqs_string, |
|
2485 | + 'New LP - Didnt find any group, returning value for '.$prereqs_string, |
|
2486 | 2486 | 0 |
2487 | 2487 | ); |
2488 | 2488 | } |
@@ -2499,14 +2499,14 @@ discard block |
||
2499 | 2499 | if (!$returnstatus) { |
2500 | 2500 | if (self::debug > 1) { |
2501 | 2501 | error_log( |
2502 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2502 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2503 | 2503 | 0 |
2504 | 2504 | ); |
2505 | 2505 | } |
2506 | 2506 | } else { |
2507 | 2507 | if (self::debug > 1) { |
2508 | 2508 | error_log( |
2509 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2509 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2510 | 2510 | 0 |
2511 | 2511 | ); |
2512 | 2512 | } |
@@ -2518,12 +2518,12 @@ discard block |
||
2518 | 2518 | if ($returnstatus) { |
2519 | 2519 | //AND origin_lp_item_id = '.$user_id.' |
2520 | 2520 | $sql = 'SELECT exe_result, exe_weighting |
2521 | - FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . ' |
|
2521 | + FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).' |
|
2522 | 2522 | WHERE |
2523 | - exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND |
|
2524 | - exe_user_id = ' . $user_id . ' AND |
|
2525 | - orig_lp_id = ' . $this->lp_id . ' AND |
|
2526 | - orig_lp_item_id = ' . $prereqs_string . ' AND |
|
2523 | + exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND |
|
2524 | + exe_user_id = ' . $user_id.' AND |
|
2525 | + orig_lp_id = ' . $this->lp_id.' AND |
|
2526 | + orig_lp_item_id = ' . $prereqs_string.' AND |
|
2527 | 2527 | status <> "incomplete" |
2528 | 2528 | ORDER BY exe_date DESC |
2529 | 2529 | LIMIT 0, 1'; |
@@ -2561,12 +2561,12 @@ discard block |
||
2561 | 2561 | |
2562 | 2562 | // Checking in the database. |
2563 | 2563 | $sql = 'SELECT exe_result, exe_weighting |
2564 | - FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . ' |
|
2564 | + FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).' |
|
2565 | 2565 | WHERE |
2566 | - exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND |
|
2567 | - exe_user_id = ' . $user_id . ' AND |
|
2568 | - orig_lp_id = ' . $this->lp_id . ' AND |
|
2569 | - orig_lp_item_id = ' . $prereqs_string . ' '; |
|
2566 | + exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND |
|
2567 | + exe_user_id = ' . $user_id.' AND |
|
2568 | + orig_lp_id = ' . $this->lp_id.' AND |
|
2569 | + orig_lp_item_id = ' . $prereqs_string.' '; |
|
2570 | 2570 | |
2571 | 2571 | $rs_quiz = Database::query($sql); |
2572 | 2572 | if (Database::num_rows($rs_quiz) > 0) { |
@@ -2612,14 +2612,14 @@ discard block |
||
2612 | 2612 | if (!$returnstatus) { |
2613 | 2613 | if (self::debug > 1) { |
2614 | 2614 | error_log( |
2615 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2615 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2616 | 2616 | 0 |
2617 | 2617 | ); |
2618 | 2618 | } |
2619 | 2619 | } else { |
2620 | 2620 | if (self::debug > 1) { |
2621 | 2621 | error_log( |
2622 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2622 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2623 | 2623 | 0 |
2624 | 2624 | ); |
2625 | 2625 | } |
@@ -2634,11 +2634,11 @@ discard block |
||
2634 | 2634 | TABLE_LP_VIEW |
2635 | 2635 | ); |
2636 | 2636 | |
2637 | - $sql = 'SELECT id FROM ' . $lp_view . ' |
|
2637 | + $sql = 'SELECT id FROM '.$lp_view.' |
|
2638 | 2638 | WHERE |
2639 | - c_id = ' . $course_id . ' AND |
|
2640 | - user_id = ' . $user_id . ' AND |
|
2641 | - lp_id = ' . $this->lp_id . ' AND |
|
2639 | + c_id = ' . $course_id.' AND |
|
2640 | + user_id = ' . $user_id.' AND |
|
2641 | + lp_id = ' . $this->lp_id.' AND |
|
2642 | 2642 | session_id = '.$sessionId.' |
2643 | 2643 | LIMIT 0, 1'; |
2644 | 2644 | $rs_lp = Database::query($sql); |
@@ -2647,11 +2647,11 @@ discard block |
||
2647 | 2647 | ); |
2648 | 2648 | $my_lp_id = $lp_id[0]; |
2649 | 2649 | |
2650 | - $sql = 'SELECT status FROM ' . $lp_item_view . ' |
|
2650 | + $sql = 'SELECT status FROM '.$lp_item_view.' |
|
2651 | 2651 | WHERE |
2652 | - c_id = ' . $course_id . ' AND |
|
2653 | - lp_view_id = ' . $my_lp_id . ' AND |
|
2654 | - lp_item_id = ' . $refs_list[$prereqs_string] . ' |
|
2652 | + c_id = ' . $course_id.' AND |
|
2653 | + lp_view_id = ' . $my_lp_id.' AND |
|
2654 | + lp_item_id = ' . $refs_list[$prereqs_string].' |
|
2655 | 2655 | LIMIT 0, 1'; |
2656 | 2656 | $rs_lp = Database::query($sql); |
2657 | 2657 | $status_array = Database :: fetch_row( |
@@ -2668,14 +2668,14 @@ discard block |
||
2668 | 2668 | if (!$returnstatus) { |
2669 | 2669 | if (self::debug > 1) { |
2670 | 2670 | error_log( |
2671 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2671 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2672 | 2672 | 0 |
2673 | 2673 | ); |
2674 | 2674 | } |
2675 | 2675 | } else { |
2676 | 2676 | if (self::debug > 1) { |
2677 | 2677 | error_log( |
2678 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2678 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2679 | 2679 | 0 |
2680 | 2680 | ); |
2681 | 2681 | } |
@@ -2686,7 +2686,7 @@ discard block |
||
2686 | 2686 | } else { |
2687 | 2687 | if (self::debug > 1) { |
2688 | 2688 | error_log( |
2689 | - 'New LP - Could not find ' . $prereqs_string . ' in ' . print_r( |
|
2689 | + 'New LP - Could not find '.$prereqs_string.' in '.print_r( |
|
2690 | 2690 | $refs_list, |
2691 | 2691 | true |
2692 | 2692 | ), |
@@ -2709,7 +2709,7 @@ discard block |
||
2709 | 2709 | foreach ($list as $condition) { |
2710 | 2710 | if (self::debug > 1) { |
2711 | 2711 | error_log( |
2712 | - 'New LP - Found OR, adding it (' . $condition . ')', |
|
2712 | + 'New LP - Found OR, adding it ('.$condition.')', |
|
2713 | 2713 | 0 |
2714 | 2714 | ); |
2715 | 2715 | } |
@@ -2762,7 +2762,7 @@ discard block |
||
2762 | 2762 | |
2763 | 2763 | if (self::debug > 1) { |
2764 | 2764 | error_log( |
2765 | - 'New LP - End of parse_prereq. Error code is now ' . $this->prereq_alert, |
|
2765 | + 'New LP - End of parse_prereq. Error code is now '.$this->prereq_alert, |
|
2766 | 2766 | 0 |
2767 | 2767 | ); |
2768 | 2768 | } |
@@ -2880,7 +2880,7 @@ discard block |
||
2880 | 2880 | $this->set_score($value); |
2881 | 2881 | if (self::debug > 2) { |
2882 | 2882 | error_log( |
2883 | - 'learnpathItem::save() - setting score to ' . $value, |
|
2883 | + 'learnpathItem::save() - setting score to '.$value, |
|
2884 | 2884 | 0 |
2885 | 2885 | ); |
2886 | 2886 | } |
@@ -2889,7 +2889,7 @@ discard block |
||
2889 | 2889 | $this->set_max_score($value); |
2890 | 2890 | if (self::debug > 2) { |
2891 | 2891 | error_log( |
2892 | - 'learnpathItem::save() - setting view_max_score to ' . $value, |
|
2892 | + 'learnpathItem::save() - setting view_max_score to '.$value, |
|
2893 | 2893 | 0 |
2894 | 2894 | ); |
2895 | 2895 | } |
@@ -2898,7 +2898,7 @@ discard block |
||
2898 | 2898 | $this->min_score = $value; |
2899 | 2899 | if (self::debug > 2) { |
2900 | 2900 | error_log( |
2901 | - 'learnpathItem::save() - setting min_score to ' . $value, |
|
2901 | + 'learnpathItem::save() - setting min_score to '.$value, |
|
2902 | 2902 | 0 |
2903 | 2903 | ); |
2904 | 2904 | } |
@@ -2908,7 +2908,7 @@ discard block |
||
2908 | 2908 | $this->set_status($value); |
2909 | 2909 | if (self::debug > 2) { |
2910 | 2910 | error_log( |
2911 | - 'learnpathItem::save() - setting status to ' . $value, |
|
2911 | + 'learnpathItem::save() - setting status to '.$value, |
|
2912 | 2912 | 0 |
2913 | 2913 | ); |
2914 | 2914 | } |
@@ -2918,7 +2918,7 @@ discard block |
||
2918 | 2918 | $this->set_time($value); |
2919 | 2919 | if (self::debug > 2) { |
2920 | 2920 | error_log( |
2921 | - 'learnpathItem::save() - setting time to ' . $value, |
|
2921 | + 'learnpathItem::save() - setting time to '.$value, |
|
2922 | 2922 | 0 |
2923 | 2923 | ); |
2924 | 2924 | } |
@@ -2927,7 +2927,7 @@ discard block |
||
2927 | 2927 | $this->current_data = $value; |
2928 | 2928 | if (self::debug > 2) { |
2929 | 2929 | error_log( |
2930 | - 'learnpathItem::save() - setting suspend_data to ' . $value, |
|
2930 | + 'learnpathItem::save() - setting suspend_data to '.$value, |
|
2931 | 2931 | 0 |
2932 | 2932 | ); |
2933 | 2933 | } |
@@ -2936,7 +2936,7 @@ discard block |
||
2936 | 2936 | $this->set_lesson_location($value); |
2937 | 2937 | if (self::debug > 2) { |
2938 | 2938 | error_log( |
2939 | - 'learnpathItem::save() - setting lesson_location to ' . $value, |
|
2939 | + 'learnpathItem::save() - setting lesson_location to '.$value, |
|
2940 | 2940 | 0 |
2941 | 2941 | ); |
2942 | 2942 | } |
@@ -2945,7 +2945,7 @@ discard block |
||
2945 | 2945 | $this->set_core_exit($value); |
2946 | 2946 | if (self::debug > 2) { |
2947 | 2947 | error_log( |
2948 | - 'learnpathItem::save() - setting core_exit to ' . $value, |
|
2948 | + 'learnpathItem::save() - setting core_exit to '.$value, |
|
2949 | 2949 | 0 |
2950 | 2950 | ); |
2951 | 2951 | } |
@@ -3092,7 +3092,7 @@ discard block |
||
3092 | 3092 | public function set_level($int = 0) |
3093 | 3093 | { |
3094 | 3094 | if (self::debug > 0) { |
3095 | - error_log('learnpathItem::set_level(' . $int . ')', 0); |
|
3095 | + error_log('learnpathItem::set_level('.$int.')', 0); |
|
3096 | 3096 | } |
3097 | 3097 | if (!empty($int) AND $int == strval(intval($int))) { |
3098 | 3098 | $this->level = $int; |
@@ -3121,7 +3121,7 @@ discard block |
||
3121 | 3121 | if (empty($lpItemId)) { |
3122 | 3122 | if (self::debug > 0) { |
3123 | 3123 | error_log( |
3124 | - 'learnpathItem::set_lp_view(' . $lp_view_id . ') $lpItemId is empty', |
|
3124 | + 'learnpathItem::set_lp_view('.$lp_view_id.') $lpItemId is empty', |
|
3125 | 3125 | 0 |
3126 | 3126 | ); |
3127 | 3127 | } |
@@ -3132,7 +3132,7 @@ discard block |
||
3132 | 3132 | if (empty($lp_view_id)) { |
3133 | 3133 | if (self::debug > 0) { |
3134 | 3134 | error_log( |
3135 | - 'learnpathItem::set_lp_view(' . $lp_view_id . ') $lp_view_id is empty', |
|
3135 | + 'learnpathItem::set_lp_view('.$lp_view_id.') $lp_view_id is empty', |
|
3136 | 3136 | 0 |
3137 | 3137 | ); |
3138 | 3138 | } |
@@ -3141,7 +3141,7 @@ discard block |
||
3141 | 3141 | } |
3142 | 3142 | |
3143 | 3143 | if (self::debug > 0) { |
3144 | - error_log('learnpathItem::set_lp_view(' . $lp_view_id . ')', 0); |
|
3144 | + error_log('learnpathItem::set_lp_view('.$lp_view_id.')', 0); |
|
3145 | 3145 | } |
3146 | 3146 | |
3147 | 3147 | $this->view_id = $lp_view_id; |
@@ -3151,13 +3151,13 @@ discard block |
||
3151 | 3151 | $sql = "SELECT * FROM $item_view_table |
3152 | 3152 | WHERE |
3153 | 3153 | c_id = $course_id AND |
3154 | - lp_item_id = " . $lpItemId . " AND |
|
3155 | - lp_view_id = " . $lp_view_id . " |
|
3154 | + lp_item_id = ".$lpItemId." AND |
|
3155 | + lp_view_id = " . $lp_view_id." |
|
3156 | 3156 | ORDER BY view_count DESC"; |
3157 | 3157 | |
3158 | 3158 | if (self::debug > 2) { |
3159 | 3159 | error_log( |
3160 | - 'learnpathItem::set_lp_view() - Querying lp_item_view: ' . $sql, |
|
3160 | + 'learnpathItem::set_lp_view() - Querying lp_item_view: '.$sql, |
|
3161 | 3161 | 0 |
3162 | 3162 | ); |
3163 | 3163 | } |
@@ -3189,7 +3189,7 @@ discard block |
||
3189 | 3189 | $sql = "SELECT * FROM $item_view_interaction_table |
3190 | 3190 | WHERE |
3191 | 3191 | c_id = $course_id AND |
3192 | - lp_iv_id = '" . $this->db_item_view_id . "'"; |
|
3192 | + lp_iv_id = '".$this->db_item_view_id."'"; |
|
3193 | 3193 | |
3194 | 3194 | $res = Database::query($sql); |
3195 | 3195 | if ($res !== false) { |
@@ -3204,7 +3204,7 @@ discard block |
||
3204 | 3204 | $sql = "SELECT * FROM $item_view_objective_table |
3205 | 3205 | WHERE |
3206 | 3206 | c_id = $course_id AND |
3207 | - lp_iv_id = '" . $this->db_item_view_id . "'"; |
|
3207 | + lp_iv_id = '".$this->db_item_view_id."'"; |
|
3208 | 3208 | |
3209 | 3209 | $res = Database::query($sql); |
3210 | 3210 | if ($res !== false) { |
@@ -3265,7 +3265,7 @@ discard block |
||
3265 | 3265 | { |
3266 | 3266 | $debug = self::debug; |
3267 | 3267 | if ($debug > 0) { |
3268 | - error_log('learnpathItem::set_score(' . $score . ')', 0); |
|
3268 | + error_log('learnpathItem::set_score('.$score.')', 0); |
|
3269 | 3269 | } |
3270 | 3270 | if (($this->max_score <= 0 || $score <= $this->max_score) && ($score >= $this->min_score)) { |
3271 | 3271 | $this->current_score = $score; |
@@ -3278,9 +3278,9 @@ discard block |
||
3278 | 3278 | } |
3279 | 3279 | |
3280 | 3280 | if ($debug > 0) { |
3281 | - error_log('get_mastery_score: ' . $masteryScore); |
|
3282 | - error_log('current_status: ' . $current_status); |
|
3283 | - error_log('current score : ' . $this->current_score); |
|
3281 | + error_log('get_mastery_score: '.$masteryScore); |
|
3282 | + error_log('current_status: '.$current_status); |
|
3283 | + error_log('current score : '.$this->current_score); |
|
3284 | 3284 | } |
3285 | 3285 | |
3286 | 3286 | // If mastery_score is set AND the current score reaches the mastery |
@@ -3308,15 +3308,15 @@ discard block |
||
3308 | 3308 | public function set_max_score($score) |
3309 | 3309 | { |
3310 | 3310 | if (self::debug > 0) { |
3311 | - error_log('learnpathItem::set_max_score(' . $score . ')', 0); |
|
3311 | + error_log('learnpathItem::set_max_score('.$score.')', 0); |
|
3312 | 3312 | } |
3313 | 3313 | if (is_int($score) || $score == '') { |
3314 | 3314 | $this->view_max_score = $score; |
3315 | 3315 | if (self::debug > 1) { |
3316 | 3316 | error_log( |
3317 | - 'learnpathItem::set_max_score() - ' . |
|
3318 | - 'Updated object score of item ' . $this->db_id . |
|
3319 | - ' to ' . $this->view_max_score, |
|
3317 | + 'learnpathItem::set_max_score() - '. |
|
3318 | + 'Updated object score of item '.$this->db_id. |
|
3319 | + ' to '.$this->view_max_score, |
|
3320 | 3320 | 0 |
3321 | 3321 | ); |
3322 | 3322 | } |
@@ -3334,12 +3334,12 @@ discard block |
||
3334 | 3334 | public function set_status($status) |
3335 | 3335 | { |
3336 | 3336 | if (self::debug > 0) { |
3337 | - error_log('learnpathItem::set_status(' . $status . ')', 0); |
|
3337 | + error_log('learnpathItem::set_status('.$status.')', 0); |
|
3338 | 3338 | } |
3339 | 3339 | |
3340 | 3340 | $found = false; |
3341 | 3341 | foreach ($this->possible_status as $possible) { |
3342 | - if (preg_match('/^' . $possible . '$/i', $status)) { |
|
3342 | + if (preg_match('/^'.$possible.'$/i', $status)) { |
|
3343 | 3343 | $found = true; |
3344 | 3344 | } |
3345 | 3345 | } |
@@ -3349,8 +3349,8 @@ discard block |
||
3349 | 3349 | if (self::debug > 1) { |
3350 | 3350 | error_log( |
3351 | 3351 | 'learnpathItem::set_status() - '. |
3352 | - 'Updated object status of item ' . $this->db_id . |
|
3353 | - ' to ' . $this->status, |
|
3352 | + 'Updated object status of item '.$this->db_id. |
|
3353 | + ' to '.$this->status, |
|
3354 | 3354 | 0 |
3355 | 3355 | ); |
3356 | 3356 | } |
@@ -3374,7 +3374,7 @@ discard block |
||
3374 | 3374 | $lp_item = Database::get_course_table(TABLE_LP_ITEM); |
3375 | 3375 | require_once api_get_path( |
3376 | 3376 | LIBRARY_PATH |
3377 | - ) . 'search/ChamiloIndexer.class.php'; |
|
3377 | + ).'search/ChamiloIndexer.class.php'; |
|
3378 | 3378 | $a_terms = preg_split('/,/', $terms); |
3379 | 3379 | $i_terms = preg_split('/,/', $this->get_terms()); |
3380 | 3380 | foreach ($i_terms as $term) { |
@@ -3391,7 +3391,7 @@ discard block |
||
3391 | 3391 | SET terms = '$terms' |
3392 | 3392 | WHERE |
3393 | 3393 | c_id = $course_id AND |
3394 | - id=" . $this->get_id(); |
|
3394 | + id=".$this->get_id(); |
|
3395 | 3395 | Database::query($sql); |
3396 | 3396 | // Save it to search engine. |
3397 | 3397 | if (api_get_setting('search_enabled') == 'true') { |
@@ -3419,7 +3419,7 @@ discard block |
||
3419 | 3419 | public function set_time($scorm_time, $format = 'scorm') |
3420 | 3420 | { |
3421 | 3421 | if (self::debug > 0) { |
3422 | - error_log('learnpathItem::set_time(' . $scorm_time . ')', 0); |
|
3422 | + error_log('learnpathItem::set_time('.$scorm_time.')', 0); |
|
3423 | 3423 | } |
3424 | 3424 | if ($scorm_time == '0' |
3425 | 3425 | and ($this->type != 'sco') |
@@ -3430,8 +3430,8 @@ discard block |
||
3430 | 3430 | $this->update_time($my_time); |
3431 | 3431 | if (self::debug > 0) { |
3432 | 3432 | error_log( |
3433 | - 'learnpathItem::set_time(' . $scorm_time . ') - ' . |
|
3434 | - 'found asset - set time to ' . $my_time, |
|
3433 | + 'learnpathItem::set_time('.$scorm_time.') - '. |
|
3434 | + 'found asset - set time to '.$my_time, |
|
3435 | 3435 | 0 |
3436 | 3436 | ); |
3437 | 3437 | } |
@@ -3504,10 +3504,10 @@ discard block |
||
3504 | 3504 | { |
3505 | 3505 | if (self::debug > 1) { |
3506 | 3506 | error_log( |
3507 | - 'learnpathItem::status_is(' . print_r( |
|
3507 | + 'learnpathItem::status_is('.print_r( |
|
3508 | 3508 | $list, |
3509 | 3509 | true |
3510 | - ) . ') on item ' . $this->db_id, |
|
3510 | + ).') on item '.$this->db_id, |
|
3511 | 3511 | 0 |
3512 | 3512 | ); |
3513 | 3513 | } |
@@ -3517,11 +3517,11 @@ discard block |
||
3517 | 3517 | } |
3518 | 3518 | $found = false; |
3519 | 3519 | foreach ($list as $status) { |
3520 | - if (preg_match('/^' . $status . '$/i', $currentStatus)) { |
|
3520 | + if (preg_match('/^'.$status.'$/i', $currentStatus)) { |
|
3521 | 3521 | if (self::debug > 2) { |
3522 | 3522 | error_log( |
3523 | - 'New LP - learnpathItem::status_is() - Found status ' . |
|
3524 | - $status . ' corresponding to current status', |
|
3523 | + 'New LP - learnpathItem::status_is() - Found status '. |
|
3524 | + $status.' corresponding to current status', |
|
3525 | 3525 | 0 |
3526 | 3526 | ); |
3527 | 3527 | } |
@@ -3532,8 +3532,8 @@ discard block |
||
3532 | 3532 | } |
3533 | 3533 | if (self::debug > 2) { |
3534 | 3534 | error_log( |
3535 | - 'New LP - learnpathItem::status_is() - Status ' . |
|
3536 | - $currentStatus . ' did not match request', |
|
3535 | + 'New LP - learnpathItem::status_is() - Status '. |
|
3536 | + $currentStatus.' did not match request', |
|
3537 | 3537 | 0 |
3538 | 3538 | ); |
3539 | 3539 | } |
@@ -3550,7 +3550,7 @@ discard block |
||
3550 | 3550 | public function update_time($total_sec = 0) |
3551 | 3551 | { |
3552 | 3552 | if (self::debug > 0) { |
3553 | - error_log('learnpathItem::update_time(' . $total_sec . ')', 0); |
|
3553 | + error_log('learnpathItem::update_time('.$total_sec.')', 0); |
|
3554 | 3554 | } |
3555 | 3555 | if ($total_sec >= 0) { |
3556 | 3556 | // Getting start time from finish time. The only problem in the calculation is it might be |
@@ -3602,11 +3602,11 @@ discard block |
||
3602 | 3602 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3603 | 3603 | $course_id = api_get_course_int_id(); |
3604 | 3604 | |
3605 | - $get_view_sql = 'SELECT total_time, status FROM ' . $item_view_table . ' |
|
3606 | - WHERE c_id = ' . $course_id . ' |
|
3607 | - AND lp_item_id="' . $this->db_id . '" |
|
3608 | - AND lp_view_id="' . $this->view_id . '" |
|
3609 | - AND view_count="' . $this->attempt_id . '" ;'; |
|
3605 | + $get_view_sql = 'SELECT total_time, status FROM '.$item_view_table.' |
|
3606 | + WHERE c_id = ' . $course_id.' |
|
3607 | + AND lp_item_id="' . $this->db_id.'" |
|
3608 | + AND lp_view_id="' . $this->view_id.'" |
|
3609 | + AND view_count="' . $this->attempt_id.'" ;'; |
|
3610 | 3610 | $result = Database::query($get_view_sql); |
3611 | 3611 | $row = Database::fetch_array($result); |
3612 | 3612 | |
@@ -3659,12 +3659,12 @@ discard block |
||
3659 | 3659 | { |
3660 | 3660 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3661 | 3661 | $course_id = api_get_course_int_id(); |
3662 | - $sql = 'UPDATE ' . $item_view_table . ' |
|
3663 | - SET total_time = 0, start_time=' . time() . ' |
|
3664 | - WHERE c_id = ' . $course_id . ' |
|
3665 | - AND lp_item_id="' . $this->db_id . '" |
|
3666 | - AND lp_view_id="' . $this->view_id . '" |
|
3667 | - AND view_count="' . $this->attempt_id . '" ;'; |
|
3662 | + $sql = 'UPDATE '.$item_view_table.' |
|
3663 | + SET total_time = 0, start_time=' . time().' |
|
3664 | + WHERE c_id = ' . $course_id.' |
|
3665 | + AND lp_item_id="' . $this->db_id.'" |
|
3666 | + AND lp_view_id="' . $this->view_id.'" |
|
3667 | + AND view_count="' . $this->attempt_id.'" ;'; |
|
3668 | 3668 | Database::query($sql); |
3669 | 3669 | } |
3670 | 3670 | |
@@ -3686,8 +3686,8 @@ discard block |
||
3686 | 3686 | FROM $tbl |
3687 | 3687 | WHERE |
3688 | 3688 | c_id = $course_id AND |
3689 | - lp_item_id = " . $this->db_id . " AND |
|
3690 | - lp_view_id = " . $this->view_id . " AND |
|
3689 | + lp_item_id = ".$this->db_id." AND |
|
3690 | + lp_view_id = " . $this->view_id." AND |
|
3691 | 3691 | view_count = " . $this->attempt_id; |
3692 | 3692 | $res = Database::query($sql); |
3693 | 3693 | if (Database::num_rows($res) > 0) { |
@@ -3695,8 +3695,8 @@ discard block |
||
3695 | 3695 | $lp_iv_id = $row[0]; |
3696 | 3696 | if (self::debug > 2) { |
3697 | 3697 | error_log( |
3698 | - 'learnpathItem::write_to_db() - Got item_view_id ' . |
|
3699 | - $lp_iv_id . ', now checking objectives ', |
|
3698 | + 'learnpathItem::write_to_db() - Got item_view_id '. |
|
3699 | + $lp_iv_id.', now checking objectives ', |
|
3700 | 3700 | 0 |
3701 | 3701 | ); |
3702 | 3702 | } |
@@ -3708,7 +3708,7 @@ discard block |
||
3708 | 3708 | WHERE |
3709 | 3709 | c_id = $course_id AND |
3710 | 3710 | lp_iv_id = $lp_iv_id AND |
3711 | - objective_id = '" . Database::escape_string($objective[0]) . "'"; |
|
3711 | + objective_id = '".Database::escape_string($objective[0])."'"; |
|
3712 | 3712 | $iva_res = Database::query($iva_sql); |
3713 | 3713 | // id(0), type(1), time(2), weighting(3), |
3714 | 3714 | // correct_responses(4), student_response(5), |
@@ -3717,22 +3717,22 @@ discard block |
||
3717 | 3717 | // Update (or don't). |
3718 | 3718 | $iva_row = Database::fetch_array($iva_res); |
3719 | 3719 | $iva_id = $iva_row[0]; |
3720 | - $ivau_sql = "UPDATE $iva_table " . |
|
3721 | - "SET objective_id = '" . Database::escape_string( |
|
3720 | + $ivau_sql = "UPDATE $iva_table ". |
|
3721 | + "SET objective_id = '".Database::escape_string( |
|
3722 | 3722 | $objective[0] |
3723 | - ) . "'," . |
|
3724 | - "status = '" . Database::escape_string( |
|
3723 | + )."',". |
|
3724 | + "status = '".Database::escape_string( |
|
3725 | 3725 | $objective[1] |
3726 | - ) . "'," . |
|
3727 | - "score_raw = '" . Database::escape_string( |
|
3726 | + )."',". |
|
3727 | + "score_raw = '".Database::escape_string( |
|
3728 | 3728 | $objective[2] |
3729 | - ) . "'," . |
|
3730 | - "score_min = '" . Database::escape_string( |
|
3729 | + )."',". |
|
3730 | + "score_min = '".Database::escape_string( |
|
3731 | 3731 | $objective[4] |
3732 | - ) . "'," . |
|
3733 | - "score_max = '" . Database::escape_string( |
|
3732 | + )."',". |
|
3733 | + "score_max = '".Database::escape_string( |
|
3734 | 3734 | $objective[3] |
3735 | - ) . "' " . |
|
3735 | + )."' ". |
|
3736 | 3736 | "WHERE c_id = $course_id AND id = $iva_id"; |
3737 | 3737 | Database::query($ivau_sql); |
3738 | 3738 | } else { |
@@ -3782,12 +3782,12 @@ discard block |
||
3782 | 3782 | $credit = $this->get_credit(); |
3783 | 3783 | |
3784 | 3784 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3785 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
3785 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
3786 | 3786 | WHERE |
3787 | - c_id = ' . $course_id . ' AND |
|
3788 | - lp_item_id="' . $this->db_id . '" AND |
|
3789 | - lp_view_id="' . $this->view_id . '" AND |
|
3790 | - view_count="' . $this->get_attempt_id() . '" '; |
|
3787 | + c_id = ' . $course_id.' AND |
|
3788 | + lp_item_id="' . $this->db_id.'" AND |
|
3789 | + lp_view_id="' . $this->view_id.'" AND |
|
3790 | + view_count="' . $this->get_attempt_id().'" '; |
|
3791 | 3791 | $rs_verified = Database::query($sql); |
3792 | 3792 | $row_verified = Database::fetch_array($rs_verified); |
3793 | 3793 | |
@@ -3815,8 +3815,8 @@ discard block |
||
3815 | 3815 | "This info shouldn't be saved as the credit or lesson mode info prevent it" |
3816 | 3816 | ); |
3817 | 3817 | error_log( |
3818 | - 'learnpathItem::write_to_db() - credit(' . $credit . ') or'. |
|
3819 | - ' lesson_mode(' . $mode . ') prevent recording!', |
|
3818 | + 'learnpathItem::write_to_db() - credit('.$credit.') or'. |
|
3819 | + ' lesson_mode('.$mode.') prevent recording!', |
|
3820 | 3820 | 0 |
3821 | 3821 | ); |
3822 | 3822 | } |
@@ -3840,14 +3840,14 @@ discard block |
||
3840 | 3840 | "max_score" => $this->get_max(), |
3841 | 3841 | "lp_item_id" => $this->db_id, |
3842 | 3842 | "lp_view_id" => $this->view_id, |
3843 | - "view_count" => $this->get_attempt_id() , |
|
3843 | + "view_count" => $this->get_attempt_id(), |
|
3844 | 3844 | "suspend_data" => $this->current_data, |
3845 | 3845 | //"max_time_allowed" => , |
3846 | 3846 | "lesson_location" => $this->lesson_location |
3847 | 3847 | ); |
3848 | 3848 | if (self::debug > 2) { |
3849 | 3849 | error_log( |
3850 | - 'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1), |
|
3850 | + 'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1), |
|
3851 | 3851 | 0 |
3852 | 3852 | ); |
3853 | 3853 | } |
@@ -3855,7 +3855,7 @@ discard block |
||
3855 | 3855 | |
3856 | 3856 | if ($this->db_item_view_id) { |
3857 | 3857 | $sql = "UPDATE $item_view_table SET id = iid |
3858 | - WHERE iid = " . $this->db_item_view_id; |
|
3858 | + WHERE iid = ".$this->db_item_view_id; |
|
3859 | 3859 | Database::query($sql); |
3860 | 3860 | $inserted = true; |
3861 | 3861 | } |
@@ -3865,12 +3865,12 @@ discard block |
||
3865 | 3865 | $sql = "SELECT * FROM $item_view_table |
3866 | 3866 | WHERE |
3867 | 3867 | c_id = $course_id AND |
3868 | - lp_item_id = " . $this->db_id . " AND |
|
3869 | - lp_view_id = " . $this->view_id . " AND |
|
3868 | + lp_item_id = ".$this->db_id." AND |
|
3869 | + lp_view_id = " . $this->view_id." AND |
|
3870 | 3870 | view_count = " . intval($this->get_attempt_id()); |
3871 | 3871 | if (self::debug > 2) { |
3872 | 3872 | error_log( |
3873 | - 'learnpathItem::write_to_db() - Querying item_view: ' . $sql, |
|
3873 | + 'learnpathItem::write_to_db() - Querying item_view: '.$sql, |
|
3874 | 3874 | 0 |
3875 | 3875 | ); |
3876 | 3876 | } |
@@ -3887,7 +3887,7 @@ discard block |
||
3887 | 3887 | "max_score" => $this->get_max(), |
3888 | 3888 | "lp_item_id" => $this->db_id, |
3889 | 3889 | "lp_view_id" => $this->view_id, |
3890 | - "view_count" => $this->get_attempt_id() , |
|
3890 | + "view_count" => $this->get_attempt_id(), |
|
3891 | 3891 | "suspend_data" => $this->current_data, |
3892 | 3892 | //"max_time_allowed" => ,$this->get_max_time_allowed() |
3893 | 3893 | "lesson_location" => $this->lesson_location |
@@ -3895,7 +3895,7 @@ discard block |
||
3895 | 3895 | |
3896 | 3896 | if (self::debug > 2) { |
3897 | 3897 | error_log( |
3898 | - 'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1), |
|
3898 | + 'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1), |
|
3899 | 3899 | 0 |
3900 | 3900 | ); |
3901 | 3901 | } |
@@ -3904,7 +3904,7 @@ discard block |
||
3904 | 3904 | |
3905 | 3905 | if ($this->db_item_view_id) { |
3906 | 3906 | $sql = "UPDATE $item_view_table SET id = iid |
3907 | - WHERE iid = " . $this->db_item_view_id; |
|
3907 | + WHERE iid = ".$this->db_item_view_id; |
|
3908 | 3908 | Database::query($sql); |
3909 | 3909 | } |
3910 | 3910 | } else { |
@@ -3944,8 +3944,8 @@ discard block |
||
3944 | 3944 | $time_exe_date = convert_sql_date( |
3945 | 3945 | $row_dates['exe_date'] |
3946 | 3946 | ); |
3947 | - $mytime = ((int)$time_exe_date - (int)$time_start_date); |
|
3948 | - $total_time = " total_time = " . $mytime . ", "; |
|
3947 | + $mytime = ((int) $time_exe_date - (int) $time_start_date); |
|
3948 | + $total_time = " total_time = ".$mytime.", "; |
|
3949 | 3949 | } |
3950 | 3950 | } else { |
3951 | 3951 | $my_type_lp = learnpath::get_type_static($this->lp_id); |
@@ -3959,16 +3959,16 @@ discard block |
||
3959 | 3959 | |
3960 | 3960 | // Is not multiple attempts |
3961 | 3961 | if ($this->seriousgame_mode == 1 && $this->type == 'sco') { |
3962 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
3963 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3962 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
3963 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
3964 | 3964 | } elseif ($this->get_prevent_reinit() == 1) { |
3965 | 3965 | // Process of status verified into data base. |
3966 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
3966 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
3967 | 3967 | WHERE |
3968 | - c_id = ' . $course_id . ' AND |
|
3969 | - lp_item_id="' . $this->db_id . '" AND |
|
3970 | - lp_view_id="' . $this->view_id . '" AND |
|
3971 | - view_count="' . $this->get_attempt_id() . '" |
|
3968 | + c_id = ' . $course_id.' AND |
|
3969 | + lp_item_id="' . $this->db_id.'" AND |
|
3970 | + lp_view_id="' . $this->view_id.'" AND |
|
3971 | + view_count="' . $this->get_attempt_id().'" |
|
3972 | 3972 | '; |
3973 | 3973 | $rs_verified = Database::query($sql); |
3974 | 3974 | $row_verified = Database::fetch_array($rs_verified); |
@@ -3978,26 +3978,26 @@ discard block |
||
3978 | 3978 | if (!in_array($this->get_status(false), $case_completed) && |
3979 | 3979 | $my_type_lp == 2 |
3980 | 3980 | ) { |
3981 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
3982 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3981 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
3982 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
3983 | 3983 | } else { |
3984 | 3984 | // Verified into database. |
3985 | 3985 | if (!in_array($row_verified['status'], $case_completed) && |
3986 | 3986 | $my_type_lp == 2 |
3987 | 3987 | ) { |
3988 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
3989 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3990 | - } elseif (in_array($row_verified['status'], $case_completed ) && |
|
3988 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
3989 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
3990 | + } elseif (in_array($row_verified['status'], $case_completed) && |
|
3991 | 3991 | $my_type_lp == 2 && $this->type != 'sco' |
3992 | 3992 | ) { |
3993 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
3994 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3993 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
3994 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
3995 | 3995 | } else { |
3996 | 3996 | if (($my_type_lp == 3 && $this->type == 'au') || |
3997 | 3997 | ($my_type_lp == 1 && $this->type != 'chapter')) { |
3998 | 3998 | // Is AICC or Chamilo LP |
3999 | - $total_time = " total_time = total_time + " . $this->get_total_time() . ", "; |
|
4000 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3999 | + $total_time = " total_time = total_time + ".$this->get_total_time().", "; |
|
4000 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4001 | 4001 | } |
4002 | 4002 | } |
4003 | 4003 | } |
@@ -4009,27 +4009,27 @@ discard block |
||
4009 | 4009 | ) && $my_type_lp == 2 |
4010 | 4010 | ) { |
4011 | 4011 | // Reset zero new attempt ? |
4012 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4012 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4013 | 4013 | } elseif (!in_array($this->get_status(false), $case_completed) && |
4014 | 4014 | $my_type_lp == 2 |
4015 | 4015 | ) { |
4016 | - $total_time = " total_time = " . $this->get_total_time() . ", "; |
|
4017 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4016 | + $total_time = " total_time = ".$this->get_total_time().", "; |
|
4017 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4018 | 4018 | } else { |
4019 | 4019 | // It is chamilo LP. |
4020 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4021 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4020 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4021 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4022 | 4022 | } |
4023 | 4023 | |
4024 | 4024 | // This code line fixes the problem of wrong status. |
4025 | 4025 | if ($my_type_lp == 2) { |
4026 | 4026 | // Verify current status in multiples attempts. |
4027 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
4027 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
4028 | 4028 | WHERE |
4029 | - c_id = ' . $course_id . ' AND |
|
4030 | - lp_item_id="' . $this->db_id . '" AND |
|
4031 | - lp_view_id="' . $this->view_id . '" AND |
|
4032 | - view_count="' . $this->get_attempt_id() . '" '; |
|
4029 | + c_id = ' . $course_id.' AND |
|
4030 | + lp_item_id="' . $this->db_id.'" AND |
|
4031 | + lp_view_id="' . $this->view_id.'" AND |
|
4032 | + view_count="' . $this->get_attempt_id().'" '; |
|
4033 | 4033 | $rs_status = Database::query($sql); |
4034 | 4034 | $current_status = Database::result( |
4035 | 4035 | $rs_status, |
@@ -4040,7 +4040,7 @@ discard block |
||
4040 | 4040 | $my_status = ''; |
4041 | 4041 | $total_time = ''; |
4042 | 4042 | } else { |
4043 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4043 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4044 | 4044 | } |
4045 | 4045 | } |
4046 | 4046 | } |
@@ -4051,38 +4051,38 @@ discard block |
||
4051 | 4051 | //" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it |
4052 | 4052 | ////" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
4053 | 4053 | $sql = "UPDATE $item_view_table SET |
4054 | - score = " . $this->get_score() . ", |
|
4054 | + score = ".$this->get_score().", |
|
4055 | 4055 | $my_status |
4056 | - max_score = '" . $this->get_max() . "', |
|
4057 | - suspend_data = '" . Database::escape_string($this->current_data) . "', |
|
4058 | - lesson_location = '" . $this->lesson_location . "' |
|
4056 | + max_score = '".$this->get_max()."', |
|
4057 | + suspend_data = '" . Database::escape_string($this->current_data)."', |
|
4058 | + lesson_location = '" . $this->lesson_location."' |
|
4059 | 4059 | WHERE |
4060 | 4060 | c_id = $course_id AND |
4061 | - lp_item_id = " . $this->db_id . " AND |
|
4062 | - lp_view_id = " . $this->view_id . " AND |
|
4061 | + lp_item_id = ".$this->db_id." AND |
|
4062 | + lp_view_id = " . $this->view_id." AND |
|
4063 | 4063 | view_count = " . $this->get_attempt_id(); |
4064 | 4064 | |
4065 | 4065 | } else { |
4066 | 4066 | //" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
4067 | 4067 | $sql = "UPDATE $item_view_table SET |
4068 | 4068 | $total_time |
4069 | - start_time = " . $this->get_current_start_time() . ", |
|
4070 | - score = " . $this->get_score() . ", |
|
4069 | + start_time = ".$this->get_current_start_time().", |
|
4070 | + score = " . $this->get_score().", |
|
4071 | 4071 | $my_status |
4072 | - max_score = '" . $this->get_max() . "', |
|
4073 | - suspend_data = '" . Database::escape_string($this->current_data) . "', |
|
4074 | - lesson_location = '" . $this->lesson_location . "' |
|
4072 | + max_score = '".$this->get_max()."', |
|
4073 | + suspend_data = '" . Database::escape_string($this->current_data)."', |
|
4074 | + lesson_location = '" . $this->lesson_location."' |
|
4075 | 4075 | WHERE |
4076 | 4076 | c_id = $course_id AND |
4077 | - lp_item_id = " . $this->db_id . " AND |
|
4078 | - lp_view_id = " . $this->view_id . " AND |
|
4077 | + lp_item_id = ".$this->db_id." AND |
|
4078 | + lp_view_id = " . $this->view_id." AND |
|
4079 | 4079 | view_count = " . $this->get_attempt_id(); |
4080 | 4080 | } |
4081 | 4081 | $this->current_start_time = time(); |
4082 | 4082 | } |
4083 | 4083 | if (self::debug > 2) { |
4084 | 4084 | error_log( |
4085 | - 'learnpathItem::write_to_db() - Updating item_view: ' . $sql, |
|
4085 | + 'learnpathItem::write_to_db() - Updating item_view: '.$sql, |
|
4086 | 4086 | 0 |
4087 | 4087 | ); |
4088 | 4088 | } |
@@ -4095,8 +4095,8 @@ discard block |
||
4095 | 4095 | $sql = "SELECT id FROM $tbl |
4096 | 4096 | WHERE |
4097 | 4097 | c_id = $course_id AND |
4098 | - lp_item_id = " . $this->db_id . " AND |
|
4099 | - lp_view_id = " . $this->view_id . " AND |
|
4098 | + lp_item_id = ".$this->db_id." AND |
|
4099 | + lp_view_id = " . $this->view_id." AND |
|
4100 | 4100 | view_count = " . $this->get_attempt_id(); |
4101 | 4101 | $res = Database::query($sql); |
4102 | 4102 | if (Database::num_rows($res) > 0) { |
@@ -4104,8 +4104,8 @@ discard block |
||
4104 | 4104 | $lp_iv_id = $row[0]; |
4105 | 4105 | if (self::debug > 2) { |
4106 | 4106 | error_log( |
4107 | - 'learnpathItem::write_to_db() - Got item_view_id ' . |
|
4108 | - $lp_iv_id . ', now checking interactions ', |
|
4107 | + 'learnpathItem::write_to_db() - Got item_view_id '. |
|
4108 | + $lp_iv_id.', now checking interactions ', |
|
4109 | 4109 | 0 |
4110 | 4110 | ); |
4111 | 4111 | } |
@@ -4116,7 +4116,7 @@ discard block |
||
4116 | 4116 | ) && !empty($interaction[4][0]) |
4117 | 4117 | ) { |
4118 | 4118 | foreach ($interaction[4] as $resp) { |
4119 | - $correct_resp .= $resp . ','; |
|
4119 | + $correct_resp .= $resp.','; |
|
4120 | 4120 | } |
4121 | 4121 | $correct_resp = substr( |
4122 | 4122 | $correct_resp, |
@@ -4135,7 +4135,7 @@ discard block |
||
4135 | 4135 | lp_iv_id = $lp_iv_id AND |
4136 | 4136 | ( |
4137 | 4137 | order_id = $index OR |
4138 | - interaction_id = '" . Database::escape_string($interaction[0]) . "' |
|
4138 | + interaction_id = '".Database::escape_string($interaction[0])."' |
|
4139 | 4139 | ) |
4140 | 4140 | "; |
4141 | 4141 | $iva_res = Database::query($iva_sql); |
@@ -4208,11 +4208,11 @@ discard block |
||
4208 | 4208 | public function add_audio() |
4209 | 4209 | { |
4210 | 4210 | $course_info = api_get_course_info(); |
4211 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/'; |
|
4211 | + $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/'; |
|
4212 | 4212 | |
4213 | - if (!is_dir($filepath . 'audio')) { |
|
4213 | + if (!is_dir($filepath.'audio')) { |
|
4214 | 4214 | mkdir( |
4215 | - $filepath . 'audio', |
|
4215 | + $filepath.'audio', |
|
4216 | 4216 | api_get_permissions_for_new_directories() |
4217 | 4217 | ); |
4218 | 4218 | $audio_id = add_document( |
@@ -4271,10 +4271,10 @@ discard block |
||
4271 | 4271 | // Store the mp3 file in the lp_item table. |
4272 | 4272 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
4273 | 4273 | $sql = "UPDATE $tbl_lp_item SET |
4274 | - audio = '" . Database::escape_string($file_path) . "' |
|
4274 | + audio = '".Database::escape_string($file_path)."' |
|
4275 | 4275 | WHERE |
4276 | 4276 | c_id = {$course_info['real_id']} AND |
4277 | - id = '" . intval($this->db_id) . "'"; |
|
4277 | + id = '".intval($this->db_id)."'"; |
|
4278 | 4278 | Database::query($sql); |
4279 | 4279 | } |
4280 | 4280 | |
@@ -4299,10 +4299,10 @@ discard block |
||
4299 | 4299 | // Store the mp3 file in the lp_item table. |
4300 | 4300 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
4301 | 4301 | $sql = "UPDATE $tbl_lp_item SET |
4302 | - audio = '" . Database::escape_string($file_path) . "' |
|
4302 | + audio = '".Database::escape_string($file_path)."' |
|
4303 | 4303 | WHERE |
4304 | 4304 | c_id = {$course_info['real_id']} AND |
4305 | - id = " . intval($this->db_id); |
|
4305 | + id = ".intval($this->db_id); |
|
4306 | 4306 | Database::query($sql); |
4307 | 4307 | } |
4308 | 4308 | return $file_path; |
@@ -4323,7 +4323,7 @@ discard block |
||
4323 | 4323 | } |
4324 | 4324 | $sql = "UPDATE $tbl_lp_item SET |
4325 | 4325 | audio = '' |
4326 | - WHERE c_id = $course_id AND id IN (" . $this->db_id . ")"; |
|
4326 | + WHERE c_id = $course_id AND id IN (".$this->db_id.")"; |
|
4327 | 4327 | Database::query($sql); |
4328 | 4328 | } |
4329 | 4329 | |
@@ -4369,7 +4369,7 @@ discard block |
||
4369 | 4369 | |
4370 | 4370 | if ($type == 'simple') { |
4371 | 4371 | if (in_array($status, array('failed', 'passed', 'browsed'))) { |
4372 | - $myLessonStatus = get_lang('ScormIncomplete');; |
|
4372 | + $myLessonStatus = get_lang('ScormIncomplete'); ; |
|
4373 | 4373 | $classStatus = 'warning'; |
4374 | 4374 | } |
4375 | 4375 | } |
@@ -4518,7 +4518,7 @@ discard block |
||
4518 | 4518 | */ |
4519 | 4519 | public function createForumThread($currentForumId) |
4520 | 4520 | { |
4521 | - require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php'; |
|
4521 | + require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php'; |
|
4522 | 4522 | |
4523 | 4523 | $em = Database::getManager(); |
4524 | 4524 | $threadRepo = $em->getRepository('ChamiloCourseBundle:CForumThread'); |