@@ -355,9 +355,13 @@ discard block |
||
355 | 355 | $id = $row['ref']; |
356 | 356 | if ($update_database) { |
357 | 357 | $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
358 | - if ($debug) var_dump($sql); |
|
358 | + if ($debug) { |
|
359 | + var_dump($sql); |
|
360 | + } |
|
359 | 361 | $res_update = Database::query($sql); |
360 | - if ($debug) var_dump($res_update); |
|
362 | + if ($debug) { |
|
363 | + var_dump($res_update); |
|
364 | + } |
|
361 | 365 | $result_message['agenda']++; |
362 | 366 | } |
363 | 367 | } |
@@ -366,16 +370,22 @@ discard block |
||
366 | 370 | //8. Student publication - Works |
367 | 371 | $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY |
368 | 372 | WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id"; |
369 | - if ($debug) echo $sql; |
|
373 | + if ($debug) { |
|
374 | + echo $sql; |
|
375 | + } |
|
370 | 376 | $res = Database::query($sql); |
371 | 377 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
372 | 378 | $id = $row['ref']; |
373 | 379 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id"; |
374 | - if ($debug) var_dump($sql); |
|
380 | + if ($debug) { |
|
381 | + var_dump($sql); |
|
382 | + } |
|
375 | 383 | $sub_res = Database::query($sql); |
376 | 384 | if (Database::num_rows($sub_res) > 0) { |
377 | 385 | $data = Database::fetch_array($sub_res, 'ASSOC'); |
378 | - if ($debug) var_dump($data); |
|
386 | + if ($debug) { |
|
387 | + var_dump($data); |
|
388 | + } |
|
379 | 389 | $parent_id = $data['parent_id']; |
380 | 390 | if (isset($data['parent_id']) && !empty($data['parent_id'])) { |
381 | 391 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION |
@@ -401,7 +411,9 @@ discard block |
||
401 | 411 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION |
402 | 412 | WHERE description like '%$search_this%' AND url LIKE '%$search_this2%' AND session_id = $new_session_id AND c_id = $course_id |
403 | 413 | ORDER BY id desc LIMIT 1"; |
404 | - if ($debug) echo $sql; |
|
414 | + if ($debug) { |
|
415 | + echo $sql; |
|
416 | + } |
|
405 | 417 | $sub_res = Database::query($sql); |
406 | 418 | $num_rows = Database::num_rows($sub_res); |
407 | 419 | |
@@ -443,7 +455,9 @@ discard block |
||
443 | 455 | |
444 | 456 | //Creating student_publication_assignment if exists |
445 | 457 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id"; |
446 | - if ($debug) var_dump($sql); |
|
458 | + if ($debug) { |
|
459 | + var_dump($sql); |
|
460 | + } |
|
447 | 461 | $rest_select = Database::query($sql); |
448 | 462 | if (Database::num_rows($rest_select) > 0) { |
449 | 463 | if ($update_database) { |
@@ -455,7 +469,9 @@ discard block |
||
455 | 469 | add_to_calendar = '".$assignment_data['add_to_calendar']."', |
456 | 470 | enable_qualification = '".$assignment_data['enable_qualification']."', |
457 | 471 | publication_id = '".$new_parent_id."'"; |
458 | - if ($debug) echo $sql_add_publication; |
|
472 | + if ($debug) { |
|
473 | + echo $sql_add_publication; |
|
474 | + } |
|
459 | 475 | $rest_select = Database::query($sql_add_publication); |
460 | 476 | $id = Database::insert_id(); |
461 | 477 | |
@@ -463,9 +479,13 @@ discard block |
||
463 | 479 | "has_properties = '".$id."', |
464 | 480 | view_properties = '1' |
465 | 481 | WHERE id = ".$new_parent_id; |
466 | - if ($debug) echo $sql_update; |
|
482 | + if ($debug) { |
|
483 | + echo $sql_update; |
|
484 | + } |
|
467 | 485 | $rest_update = Database::query($sql_update); |
468 | - if ($debug) var_dump($sql_update); |
|
486 | + if ($debug) { |
|
487 | + var_dump($sql_update); |
|
488 | + } |
|
469 | 489 | $result_message[$TBL_STUDENT_PUBLICATION_ASSIGNMENT]++; |
470 | 490 | } |
471 | 491 | } |
@@ -506,7 +526,9 @@ discard block |
||
506 | 526 | if ($result) { |
507 | 527 | unlink($full_file_name); |
508 | 528 | $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id']; |
509 | - if ($debug) var_dump($sql); |
|
529 | + if ($debug) { |
|
530 | + var_dump($sql); |
|
531 | + } |
|
510 | 532 | $result_delete = Database::query($sql); |
511 | 533 | api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id()); |
512 | 534 | } |
@@ -520,22 +542,30 @@ discard block |
||
520 | 542 | //10. Dropbox - not neccesary to move categories (no presence of session_id) |
521 | 543 | $sql = "SELECT id FROM $TBL_DROPBOX_FILE |
522 | 544 | WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id"; |
523 | - if ($debug) var_dump($sql); |
|
545 | + if ($debug) { |
|
546 | + var_dump($sql); |
|
547 | + } |
|
524 | 548 | $res = Database::query($sql); |
525 | 549 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
526 | 550 | $id = $row['id']; |
527 | 551 | if ($update_database) { |
528 | 552 | $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
529 | - if ($debug) var_dump($sql); |
|
553 | + if ($debug) { |
|
554 | + var_dump($sql); |
|
555 | + } |
|
530 | 556 | $res = Database::query($sql); |
531 | - if ($debug) var_dump($res); |
|
557 | + if ($debug) { |
|
558 | + var_dump($res); |
|
559 | + } |
|
532 | 560 | |
533 | 561 | $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id"; |
534 | - if ($debug) |
|
535 | - var_dump($sql); |
|
562 | + if ($debug) { |
|
563 | + var_dump($sql); |
|
564 | + } |
|
536 | 565 | $res = Database::query($sql); |
537 | - if ($debug) |
|
538 | - var_dump($res); |
|
566 | + if ($debug) { |
|
567 | + var_dump($res); |
|
568 | + } |
|
539 | 569 | $result_message[$TBL_DROPBOX_FILE]++; |
540 | 570 | } |
541 | 571 | } |
@@ -544,7 +574,9 @@ discard block |
||
544 | 574 | |
545 | 575 | $sql = "SELECT notebook_id FROM $TBL_NOTEBOOK |
546 | 576 | WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id"; |
547 | - if ($debug) var_dump($sql); |
|
577 | + if ($debug) { |
|
578 | + var_dump($sql); |
|
579 | + } |
|
548 | 580 | $res = Database::query($sql); |
549 | 581 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
550 | 582 | $id = $row['notebook_id']; |
@@ -552,17 +584,22 @@ discard block |
||
552 | 584 | $sql = "UPDATE $TBL_NOTEBOOK |
553 | 585 | SET session_id = $new_session_id |
554 | 586 | WHERE c_id = $course_id AND notebook_id = $id"; |
555 | - if ($debug) var_dump($sql); |
|
587 | + if ($debug) { |
|
588 | + var_dump($sql); |
|
589 | + } |
|
556 | 590 | $res = Database::query($sql); |
557 | - if ($debug) var_dump($res); |
|
591 | + if ($debug) { |
|
592 | + var_dump($res); |
|
593 | + } |
|
558 | 594 | } |
559 | 595 | } |
560 | 596 | |
561 | 597 | if ($update_database) { |
562 | 598 | echo '<h2>'.get_lang('StatsMoved').'</h2>'; |
563 | - if (is_array($result_message)) |
|
564 | - foreach ($result_message as $table => $times) { |
|
599 | + if (is_array($result_message)) { |
|
600 | + foreach ($result_message as $table => $times) { |
|
565 | 601 | echo 'Table '.$table.' - '.$times.' records updated <br />'; |
602 | + } |
|
566 | 603 | } |
567 | 604 | } else { |
568 | 605 | echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>'; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!empty($list)) { |
156 | 156 | foreach ($list as $exe_id => $data) { |
157 | 157 | if ($update_database) { |
158 | - $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
|
158 | + $sql = "update $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
|
159 | 159 | $res = Database::query($sql); |
160 | 160 | $result_message[$TABLETRACK_EXERCICES]++; |
161 | 161 | } else { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | if (!empty($list)) { |
185 | 185 | foreach ($list as $exe_id => $data) { |
186 | 186 | if ($update_database) { |
187 | - $sql = "UPDATE $TABLETRACK_EXERCICES |
|
187 | + $sql = "update $TABLETRACK_EXERCICES |
|
188 | 188 | SET session_id = '$new_session_id' |
189 | 189 | WHERE exe_id = $exe_id"; |
190 | 190 | $res = Database::query($sql); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | if (!empty($list)) { |
216 | 216 | foreach ($list as $id => $data) { |
217 | 217 | if ($update_database) { |
218 | - $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS |
|
218 | + $sql = "update $TBL_TRACK_E_COURSE_ACCESS |
|
219 | 219 | SET session_id = $new_session_id |
220 | 220 | WHERE course_access_id = $id"; |
221 | 221 | if ($debug) { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | if (!empty($list)) { |
241 | 241 | foreach ($list as $id) { |
242 | 242 | if ($update_database) { |
243 | - $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS |
|
243 | + $sql = "update $TBL_TRACK_E_LAST_ACCESS |
|
244 | 244 | SET access_session_id = $new_session_id |
245 | 245 | WHERE access_id = $id"; |
246 | 246 | if ($debug) { |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | if (!empty($list)) { |
275 | 275 | foreach ($list as $id => $data) { |
276 | 276 | if ($update_database) { |
277 | - $sql = "UPDATE $TBL_LP_VIEW |
|
277 | + $sql = "update $TBL_LP_VIEW |
|
278 | 278 | SET session_id = $new_session_id |
279 | 279 | WHERE c_id = $course_id AND id = $id "; |
280 | 280 | if ($debug) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
355 | 355 | $id = $row['ref']; |
356 | 356 | if ($update_database) { |
357 | - $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
|
357 | + $sql = "update $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
|
358 | 358 | if ($debug) var_dump($sql); |
359 | 359 | $res_update = Database::query($sql); |
360 | 360 | if ($debug) var_dump($res_update); |
@@ -525,12 +525,12 @@ discard block |
||
525 | 525 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
526 | 526 | $id = $row['id']; |
527 | 527 | if ($update_database) { |
528 | - $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
|
528 | + $sql = "update $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
|
529 | 529 | if ($debug) var_dump($sql); |
530 | 530 | $res = Database::query($sql); |
531 | 531 | if ($debug) var_dump($res); |
532 | 532 | |
533 | - $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id"; |
|
533 | + $sql = "update $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id"; |
|
534 | 534 | if ($debug) |
535 | 535 | var_dump($sql); |
536 | 536 | $res = Database::query($sql); |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
550 | 550 | $id = $row['notebook_id']; |
551 | 551 | if ($update_database) { |
552 | - $sql = "UPDATE $TBL_NOTEBOOK |
|
552 | + $sql = "update $TBL_NOTEBOOK |
|
553 | 553 | SET session_id = $new_session_id |
554 | 554 | WHERE c_id = $course_id AND notebook_id = $id"; |
555 | 555 | if ($debug) var_dump($sql); |
@@ -110,7 +110,7 @@ |
||
110 | 110 | * And when the user goes to another tool, returns to NULL |
111 | 111 | */ |
112 | 112 | $userId = intval($value); |
113 | - $sql = "UPDATE $onLineTrackTable |
|
113 | + $sql = "update $onLineTrackTable |
|
114 | 114 | SET c_id = NULL |
115 | 115 | WHERE login_user_id = $userId"; |
116 | 116 | Database::query($sql); |
@@ -119,7 +119,10 @@ discard block |
||
119 | 119 | <td width="40%" align="center"> |
120 | 120 | <select name="course_list[]" multiple="multiple" size="20" style="width:400px;"> |
121 | 121 | <?php foreach ($db_courses as $course) { ?> |
122 | - <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>> |
|
122 | + <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) { |
|
123 | + echo 'selected="selected"'; |
|
124 | +} |
|
125 | +?>> |
|
123 | 126 | <?php echo $course['title'].' ('.$course['code'].')'; ?> |
124 | 127 | </option> |
125 | 128 | <?php } ?> |
@@ -131,7 +134,10 @@ discard block |
||
131 | 134 | <td width="40%" align="center"> |
132 | 135 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
133 | 136 | <?php foreach ($db_urls as $url_obj) { ?> |
134 | - <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>> |
|
137 | + <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) { |
|
138 | + echo 'selected="selected"'; |
|
139 | +} |
|
140 | +?>> |
|
135 | 141 | <?php echo $url_obj['url']; ?> |
136 | 142 | </option> |
137 | 143 | <?php } ?> |
@@ -216,7 +216,7 @@ |
||
216 | 216 | $javascript .= "'".$dropbox_person->sentWork[$i]->title."'"; |
217 | 217 | } |
218 | 218 | } |
219 | - $javascript .= "); |
|
219 | + $javascript .= "); |
|
220 | 220 | |
221 | 221 | function checkfile(str) |
222 | 222 | { |
@@ -117,7 +117,7 @@ |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $groupRights || |
120 | - DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
120 | + DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
121 | 121 | |
122 | 122 | if (!$is_allowedToEdit) { |
123 | 123 | api_not_allowed(true); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @param int $tutor The user-id of the group's tutor |
159 | 159 | * @param int $places How many people can subscribe to the new group |
160 | 160 | * |
161 | - * @return int |
|
161 | + * @return string |
|
162 | 162 | */ |
163 | 163 | public static function create_group($name, $category_id, $tutor, $places) |
164 | 164 | { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | * @author Bart Mollet |
387 | 387 | * @param array $groupInfo iid |
388 | 388 | * @param string $course_code Default is current course |
389 | - * @return integer - number of groups deleted. |
|
389 | + * @return boolean - number of groups deleted. |
|
390 | 390 | */ |
391 | 391 | public static function delete_groups($groupInfo, $course_code = null) |
392 | 392 | { |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | * @param bool Whether self registration is allowed or not |
580 | 580 | * @param bool Whether self unregistration is allowed or not |
581 | 581 | * @param int $categoryId |
582 | - * @return bool TRUE if properties are successfully changed, false otherwise |
|
582 | + * @return Statement TRUE if properties are successfully changed, false otherwise |
|
583 | 583 | */ |
584 | 584 | public static function set_group_properties( |
585 | 585 | $group_id, |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | * @param int $group_id The iid of the group |
733 | 733 | * @param string $course_code The course in which the group is (default = |
734 | 734 | * current course) |
735 | - * @return array The category |
|
735 | + * @return integer The category |
|
736 | 736 | */ |
737 | 737 | public static function get_category_from_group($group_id, $course_code = '') |
738 | 738 | { |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | * @param int $self_unregistration_allowed |
817 | 817 | * @param int $maximum_number_of_students |
818 | 818 | * @param int $groups_per_user |
819 | - * @return mixed |
|
819 | + * @return false|string |
|
820 | 820 | */ |
821 | 821 | public static function create_category( |
822 | 822 | $title, |
@@ -1021,6 +1021,8 @@ discard block |
||
1021 | 1021 | * @param int $limit |
1022 | 1022 | * @param bool $getCount |
1023 | 1023 | * @param int $courseId |
1024 | + * @param string $column |
|
1025 | + * @param string $direction |
|
1024 | 1026 | * @return array list of user id |
1025 | 1027 | */ |
1026 | 1028 | public static function get_users( |
@@ -1700,7 +1702,7 @@ discard block |
||
1700 | 1702 | * Unsubscribe user(s) from a specified group in current course |
1701 | 1703 | * @param mixed $user_ids Can be an array with user-id's or a single user-id |
1702 | 1704 | * @param array $groupInfo |
1703 | - * @return bool TRUE if successful |
|
1705 | + * @return boolean|null TRUE if successful |
|
1704 | 1706 | */ |
1705 | 1707 | public static function unsubscribe_users($user_ids, $groupInfo) |
1706 | 1708 | { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $lastId = Database::insert_id(); |
222 | 222 | |
223 | 223 | if ($lastId) { |
224 | - $sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId"; |
|
224 | + $sql = "update $table_group SET id = iid WHERE iid = $lastId"; |
|
225 | 225 | Database::query($sql); |
226 | 226 | |
227 | 227 | $desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs'; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $unique_name = $newFolderData['path']; |
243 | 243 | |
244 | 244 | /* Stores the directory path into the group table */ |
245 | - $sql = "UPDATE $table_group SET |
|
245 | + $sql = "update $table_group SET |
|
246 | 246 | name = '".Database::escape_string($name)."', |
247 | 247 | secret_directory = '".$unique_name."' |
248 | 248 | WHERE c_id = $course_id AND id ='".$lastId."'"; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | foreach ($members as $group_id => $places) { |
350 | - $sql = "UPDATE $table_group SET max_student = $places |
|
350 | + $sql = "update $table_group SET max_student = $places |
|
351 | 351 | WHERE c_id = $course_id AND id = $group_id"; |
352 | 352 | Database::query($sql); |
353 | 353 | } |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | |
869 | 869 | $categoryId = Database::insert($table, $params); |
870 | 870 | if ($categoryId) { |
871 | - $sql = "UPDATE $table SET id = iid |
|
871 | + $sql = "update $table SET id = iid |
|
872 | 872 | WHERE iid = $categoryId"; |
873 | 873 | Database::query($sql); |
874 | 874 | |
@@ -1003,11 +1003,11 @@ discard block |
||
1003 | 1003 | $cat1 = Database::fetch_object($res); |
1004 | 1004 | $cat2 = Database::fetch_object($res); |
1005 | 1005 | if ($cat1 && $cat2) { |
1006 | - $sql = "UPDATE $table_group_cat SET display_order=$cat2->display_order |
|
1006 | + $sql = "update $table_group_cat SET display_order=$cat2->display_order |
|
1007 | 1007 | WHERE id = $cat1->id AND c_id = $course_id "; |
1008 | 1008 | Database::query($sql); |
1009 | 1009 | |
1010 | - $sql = "UPDATE $table_group_cat SET display_order=$cat1->display_order |
|
1010 | + $sql = "update $table_group_cat SET display_order=$cat1->display_order |
|
1011 | 1011 | WHERE id = $cat2->id AND c_id = $course_id "; |
1012 | 1012 | Database::query($sql); |
1013 | 1013 | } |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | if (!empty($model)) { |
2352 | 2352 | $scoreWithGrade = []; |
2353 | 2353 | foreach ($model['score_list'] as $item) { |
2354 | - if ($percentage >= $item['min'] && $percentage <= $item['max']) { |
|
2354 | + if ($percentage >= $item['min'] && $percentage <= $item['max']) { |
|
2355 | 2355 | $scoreWithGrade = $item; |
2356 | 2356 | break; |
2357 | 2357 | } |
@@ -3943,7 +3943,7 @@ discard block |
||
3943 | 3943 | $exe_id, |
3944 | 3944 | $questionId, |
3945 | 3945 | api_get_user_id() |
3946 | - );; |
|
3946 | + ); ; |
|
3947 | 3947 | |
3948 | 3948 | if (!empty($comnt) || $teacherAudio) { |
3949 | 3949 | echo '<b>'.get_lang('Feedback').'</b>'; |
@@ -1454,6 +1454,7 @@ discard block |
||
1454 | 1454 | |
1455 | 1455 | /** |
1456 | 1456 | * Generates the time control key |
1457 | + * @param integer $exercise_id |
|
1457 | 1458 | */ |
1458 | 1459 | public static function get_time_control_key( |
1459 | 1460 | $exercise_id, |
@@ -1541,7 +1542,7 @@ discard block |
||
1541 | 1542 | * @param int $in_direction |
1542 | 1543 | * @param string $in_hotpot_path |
1543 | 1544 | * @param bool $in_get_count |
1544 | - * @param null $where_condition |
|
1545 | + * @param string $where_condition |
|
1545 | 1546 | * @return array|int |
1546 | 1547 | */ |
1547 | 1548 | public static function get_exam_results_hotpotatoes_data( |
@@ -2443,7 +2444,7 @@ discard block |
||
2443 | 2444 | * @param string $name |
2444 | 2445 | * @param $weight |
2445 | 2446 | * @param $selected |
2446 | - * @return bool |
|
2447 | + * @return false|null |
|
2447 | 2448 | */ |
2448 | 2449 | public static function addScoreModelInput( |
2449 | 2450 | FormValidator & $form, |
@@ -2569,7 +2570,7 @@ discard block |
||
2569 | 2570 | /** |
2570 | 2571 | * Return true if pass_pourcentage activated (we use the pass pourcentage feature |
2571 | 2572 | * return false if pass_percentage = 0 (we don't use the pass pourcentage feature |
2572 | - * @param $value |
|
2573 | + * @param string $value |
|
2573 | 2574 | * @return boolean |
2574 | 2575 | * In this version, pass_percentage and show_success_message are disabled if |
2575 | 2576 | * pass_percentage is set to 0 |
@@ -2582,7 +2583,7 @@ discard block |
||
2582 | 2583 | /** |
2583 | 2584 | * Converts a numeric value in a percentage example 0.66666 to 66.67 % |
2584 | 2585 | * @param $value |
2585 | - * @return float Converted number |
|
2586 | + * @return string Converted number |
|
2586 | 2587 | */ |
2587 | 2588 | public static function convert_to_percentage($value) |
2588 | 2589 | { |
@@ -2598,7 +2599,7 @@ discard block |
||
2598 | 2599 | * @param float $score |
2599 | 2600 | * @param float $weight |
2600 | 2601 | * @deprecated seem not to be used |
2601 | - * @return float the score rounded converted to the new range |
|
2602 | + * @return string|null the score rounded converted to the new range |
|
2602 | 2603 | */ |
2603 | 2604 | public static function convert_score($score, $weight) |
2604 | 2605 | { |
@@ -3152,6 +3153,7 @@ discard block |
||
3152 | 3153 | * @param int exercise id |
3153 | 3154 | * @param int $courseId |
3154 | 3155 | * @param int session id |
3156 | + * @param integer $user_count |
|
3155 | 3157 | * @return float Best average score |
3156 | 3158 | */ |
3157 | 3159 | public static function get_best_average_score_by_exercise( |
@@ -3579,8 +3581,9 @@ discard block |
||
3579 | 3581 | } |
3580 | 3582 | |
3581 | 3583 | /** |
3582 | - * @param array $answer |
|
3584 | + * @param string|null $answer |
|
3583 | 3585 | * @param string $user_answer |
3586 | + * @param string|null $current_answer |
|
3584 | 3587 | * @return array |
3585 | 3588 | */ |
3586 | 3589 | public static function check_fill_in_blanks($answer, $user_answer, $current_answer) |
@@ -4275,7 +4278,7 @@ discard block |
||
4275 | 4278 | |
4276 | 4279 | /** |
4277 | 4280 | * @param int $countLetter |
4278 | - * @return mixed |
|
4281 | + * @return string |
|
4279 | 4282 | */ |
4280 | 4283 | public static function detectInputAppropriateClass($countLetter) |
4281 | 4284 | { |
@@ -4401,7 +4404,7 @@ discard block |
||
4401 | 4404 | } |
4402 | 4405 | |
4403 | 4406 | /** |
4404 | - * @return array |
|
4407 | + * @return string[] |
|
4405 | 4408 | */ |
4406 | 4409 | public static function getNotificationSettings() |
4407 | 4410 | { |
@@ -3021,8 +3021,7 @@ discard block |
||
3021 | 3021 | $exercise_id, |
3022 | 3022 | $courseId, |
3023 | 3023 | $session_id |
3024 | - ) |
|
3025 | - { |
|
3024 | + ) { |
|
3026 | 3025 | $user_results = Event::get_all_exercise_results( |
3027 | 3026 | $exercise_id, |
3028 | 3027 | $courseId, |
@@ -3122,8 +3121,7 @@ discard block |
||
3122 | 3121 | $user_id, |
3123 | 3122 | $courseId, |
3124 | 3123 | $session_id |
3125 | - ) |
|
3126 | - { |
|
3124 | + ) { |
|
3127 | 3125 | $user_results = Event::get_all_exercise_results_by_user( |
3128 | 3126 | $user_id, |
3129 | 3127 | $courseId, |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | </div> |
983 | 983 | </td> |
984 | 984 | <td width="10%"> |
985 | -HTML; |
|
985 | +html; |
|
986 | 986 | |
987 | 987 | $draggableSelectOptions = []; |
988 | 988 | $selectedValue = 0; |
@@ -1047,14 +1047,14 @@ discard block |
||
1047 | 1047 | $s .= <<<HTML |
1048 | 1048 | </td> |
1049 | 1049 | <td width="45%"> |
1050 | -HTML; |
|
1050 | +html; |
|
1051 | 1051 | |
1052 | 1052 | if (isset($select_items[$lines_count])) { |
1053 | 1053 | $s .= <<<HTML |
1054 | 1054 | <div id="window_{$windowId}_answer" class="window window_right_question"> |
1055 | 1055 | <strong>{$select_items[$lines_count]['letter']}.</strong> {$select_items[$lines_count]['answer']} |
1056 | 1056 | </div> |
1057 | -HTML; |
|
1057 | +html; |
|
1058 | 1058 | } else { |
1059 | 1059 | $s .= ' '; |
1060 | 1060 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | {$select_items[$lines_count]['answer']} |
1072 | 1072 | </td> |
1073 | 1073 | </tr> |
1074 | -HTML; |
|
1074 | +html; |
|
1075 | 1075 | $lines_count++; |
1076 | 1076 | } |
1077 | 1077 | } |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | <div class="exercise_questions"> |
1247 | 1247 | $questionDescription |
1248 | 1248 | <div class="row"> |
1249 | -HOTSPOT; |
|
1249 | +hotspot; |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | $relPath = api_get_path(WEB_CODE_PATH); |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | $s |
1275 | 1275 | </div> |
1276 | 1276 | </div> |
1277 | -HOTSPOT; |
|
1277 | +hotspot; |
|
1278 | 1278 | } elseif ($answerType == ANNOTATION) { |
1279 | 1279 | global $exe_id; |
1280 | 1280 | $relPath = api_get_path(WEB_CODE_PATH); |
@@ -1867,7 +1867,7 @@ discard block |
||
1867 | 1867 | if ($get_count) { |
1868 | 1868 | $hpsql_select = "SELECT count(username)"; |
1869 | 1869 | } else { |
1870 | - $hpsql_select = "SELECT |
|
1870 | + $hpsql_select = "select |
|
1871 | 1871 | $first_and_last_name , |
1872 | 1872 | username, |
1873 | 1873 | official_code, |
@@ -2516,7 +2516,7 @@ discard block |
||
2516 | 2516 | updateSelect($(this)); |
2517 | 2517 | }); |
2518 | 2518 | }); |
2519 | -EOT; |
|
2519 | +eot; |
|
2520 | 2520 | |
2521 | 2521 | return $js; |
2522 | 2522 | } |
@@ -3528,7 +3528,7 @@ discard block |
||
3528 | 3528 | $courseConditionWhere = " AND cu.status = 0 "; |
3529 | 3529 | } |
3530 | 3530 | |
3531 | - $sql = "SELECT $select_condition |
|
3531 | + $sql = "select $select_condition |
|
3532 | 3532 | FROM $track_exercises e |
3533 | 3533 | INNER JOIN $track_attempt a |
3534 | 3534 | ON ( |
@@ -356,7 +356,7 @@ |
||
356 | 356 | foreach ($teachers as $value) { |
357 | 357 | $name = $value['firstname'].' '.$value['lastname']; |
358 | 358 | if ($length > 2) { |
359 | - $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'" title="'.$name.'"> |
|
359 | + $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'" title="'.$name.'"> |
|
360 | 360 | <img src="'.$value['avatar'].'" alt="'.get_lang('UserPicture').'"/></a>'; |
361 | 361 | } else { |
362 | 362 | $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'" title="'.$name.'"> |
@@ -458,8 +458,8 @@ |
||
458 | 458 | } else if(param == 'cmi.core.student_name'){ |
459 | 459 | // ---- cmi.core.student_name |
460 | 460 | <?php |
461 | - $who = addslashes($user['lastname']).', '.addslashes($user['firstname']); |
|
462 | - echo "result='$who';"; |
|
461 | + $who = addslashes($user['lastname']).', '.addslashes($user['firstname']); |
|
462 | + echo "result='$who';"; |
|
463 | 463 | ?> |
464 | 464 | } else if(param == 'cmi.core.lesson_location'){ |
465 | 465 | // ---- cmi.core.lesson_location |