@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $extendedAttempt = null, |
115 | 115 | $extendedAll = null, |
116 | 116 | $type = 'classic', |
117 | - $allowExtend = true |
|
117 | + $allowExtend = true |
|
118 | 118 | ) { |
119 | 119 | if (empty($courseInfo) || empty($lp_id)) { |
120 | 120 | return null; |
@@ -138,22 +138,22 @@ discard block |
||
138 | 138 | $extend_all = 0; |
139 | 139 | |
140 | 140 | if ($origin == 'tracking') { |
141 | - $url_suffix = '&session_id=' . $session_id . '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . $lp_id . '&origin=' . $origin; |
|
141 | + $url_suffix = '&session_id='.$session_id.'&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.$lp_id.'&origin='.$origin; |
|
142 | 142 | } else { |
143 | - $url_suffix = '&lp_id=' . $lp_id; |
|
143 | + $url_suffix = '&lp_id='.$lp_id; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | if (!empty($extendedAll)) { |
147 | 147 | $extend_all_link = Display::url( |
148 | 148 | Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')), |
149 | - api_get_self() . '?action=stats' . $url_suffix |
|
149 | + api_get_self().'?action=stats'.$url_suffix |
|
150 | 150 | ); |
151 | 151 | |
152 | 152 | $extend_all = 1; |
153 | 153 | } else { |
154 | 154 | $extend_all_link = Display::url( |
155 | 155 | Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttempts')), |
156 | - api_get_self() . '?action=stats&extend_all=1' . $url_suffix |
|
156 | + api_get_self().'?action=stats&extend_all=1'.$url_suffix |
|
157 | 157 | ); |
158 | 158 | } |
159 | 159 | |
@@ -165,24 +165,24 @@ discard block |
||
165 | 165 | |
166 | 166 | $actionColumn = null; |
167 | 167 | if ($type == 'classic') { |
168 | - $actionColumn = ' <th>' . get_lang('Actions') . '</th>'; |
|
168 | + $actionColumn = ' <th>'.get_lang('Actions').'</th>'; |
|
169 | 169 | } |
170 | 170 | $output .= '<div class="table-responsive">'; |
171 | 171 | $output .= '<table class="table tracking"> |
172 | 172 | <thead> |
173 | 173 | <tr class="table-header"> |
174 | - <th width="16">' . ($allowExtend == true ? $extend_all_link : ' ') . '</th> |
|
174 | + <th width="16">' . ($allowExtend == true ? $extend_all_link : ' ').'</th> |
|
175 | 175 | <th colspan="4"> |
176 | - ' . get_lang('ScormLessonTitle') .' |
|
176 | + ' . get_lang('ScormLessonTitle').' |
|
177 | 177 | </th> |
178 | 178 | <th colspan="2"> |
179 | - ' . get_lang('ScormStatus') . ' |
|
179 | + ' . get_lang('ScormStatus').' |
|
180 | 180 | </th> |
181 | 181 | <th colspan="2"> |
182 | - ' . get_lang('ScormScore') . ' |
|
182 | + ' . get_lang('ScormScore').' |
|
183 | 183 | </th> |
184 | 184 | <th colspan="2"> |
185 | - ' . get_lang('ScormTime') . ' |
|
185 | + ' . get_lang('ScormTime').' |
|
186 | 186 | </th> |
187 | 187 | '.$actionColumn.' |
188 | 188 | </tr> |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | // Prepare statement to go through each attempt. |
246 | 246 | $viewCondition = null; |
247 | 247 | if (!empty($view)) { |
248 | - $viewCondition = " AND v.view_count = $view "; |
|
248 | + $viewCondition = " AND v.view_count = $view "; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | $sql = "SELECT |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | FROM $TBL_QUIZ |
294 | 294 | WHERE |
295 | 295 | c_id = $course_id AND |
296 | - id ='" . $my_path . "'"; |
|
296 | + id ='".$my_path."'"; |
|
297 | 297 | $res_result_disabled = Database::query($sql); |
298 | 298 | $row_result_disabled = Database::fetch_row($res_result_disabled); |
299 | 299 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (!empty($inter_num)) { |
316 | 316 | $extend_link = Display::url( |
317 | 317 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
318 | - api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix |
|
318 | + api_get_self().'?action=stats&fold_id='.$my_item_id.$url_suffix |
|
319 | 319 | ); |
320 | 320 | } |
321 | 321 | $title = $row['mytitle']; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | $action = null; |
335 | 335 | if ($type == 'classic') { |
336 | - $action = '<td></td>'; |
|
336 | + $action = '<td></td>'; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | if (in_array($row['item_type'], $chapterTypes)) { |
@@ -377,13 +377,13 @@ discard block |
||
377 | 377 | $extend_this_attempt = 1; |
378 | 378 | $extend_attempt_link = Display::url( |
379 | 379 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
380 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix |
|
380 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix |
|
381 | 381 | ); |
382 | 382 | } else { // Same case if fold_attempt_id is set, so not implemented explicitly. |
383 | 383 | // The extend button for this attempt has not been clicked. |
384 | 384 | $extend_attempt_link = Display::url( |
385 | 385 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
386 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
386 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
387 | 387 | ); |
388 | 388 | } |
389 | 389 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | // Remove "NaN" if any (@todo: locate the source of these NaN) |
419 | - $time = str_replace('NaN', '00' . $h . '00\'00"', $time); |
|
419 | + $time = str_replace('NaN', '00'.$h.'00\'00"', $time); |
|
420 | 420 | |
421 | 421 | if ($row['item_type'] != 'dokeos_chapter') { |
422 | 422 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
@@ -444,13 +444,13 @@ discard block |
||
444 | 444 | $action = '<td></td>'; |
445 | 445 | } |
446 | 446 | |
447 | - $output .= '<tr class="' . $oddclass . '"> |
|
447 | + $output .= '<tr class="'.$oddclass.'"> |
|
448 | 448 | <td></td> |
449 | - <td>' . $extend_attempt_link . '</td> |
|
450 | - <td colspan="3">' . get_lang('Attempt') . ' ' . $attemptCount . '</td> |
|
451 | - <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type) . '</td> |
|
452 | - <td colspan="2">' . $view_score . '</td> |
|
453 | - <td colspan="2">' . $time . '</td> |
|
449 | + <td>' . $extend_attempt_link.'</td> |
|
450 | + <td colspan="3">' . get_lang('Attempt').' '.$attemptCount.'</td> |
|
451 | + <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type).'</td> |
|
452 | + <td colspan="2">' . $view_score.'</td> |
|
453 | + <td colspan="2">' . $time.'</td> |
|
454 | 454 | '.$action.' |
455 | 455 | </tr>'; |
456 | 456 | $attemptCount++; |
@@ -463,10 +463,10 @@ discard block |
||
463 | 463 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
464 | 464 | $temp[] = '/'; |
465 | 465 | } else { |
466 | - $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
466 | + $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
467 | 467 | } |
468 | 468 | } else { |
469 | - $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
469 | + $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
470 | 470 | } |
471 | 471 | $temp[] = $time; |
472 | 472 | $csv_content[] = $temp; |
@@ -503,13 +503,13 @@ discard block |
||
503 | 503 | <td></td> |
504 | 504 | <td></td> |
505 | 505 | <td></td> |
506 | - <td>'.$interaction['order_id'] . '</td> |
|
507 | - <td>'.$interaction['id'] . '</td> |
|
506 | + <td>'.$interaction['order_id'].'</td> |
|
507 | + <td>'.$interaction['id'].'</td> |
|
508 | 508 | <td colspan="2">' . $interaction['type'].'</td> |
509 | - <td>'.$student_response . '</td> |
|
510 | - <td>'.$interaction['result'] . '</td> |
|
511 | - <td>'.$interaction['latency'] . '</td> |
|
512 | - <td>'.$interaction['time'] . '</td> |
|
509 | + <td>'.$student_response.'</td> |
|
510 | + <td>'.$interaction['result'].'</td> |
|
511 | + <td>'.$interaction['latency'].'</td> |
|
512 | + <td>'.$interaction['time'].'</td> |
|
513 | 513 | '.$action.' |
514 | 514 | </tr>'; |
515 | 515 | $counter++; |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | <td></td> |
527 | 527 | <td></td> |
528 | 528 | <td></td> |
529 | - <td>' . $interaction['order_id'] . '</td> |
|
530 | - <td colspan="2">' . $interaction['objective_id'] . '</td> |
|
531 | - <td colspan="2">' . $interaction['status'] .'</td> |
|
532 | - <td>' . $interaction['score_raw'] . '</td> |
|
533 | - <td>' . $interaction['score_max'] . '</td> |
|
534 | - <td>' . $interaction['score_min'] . '</td> |
|
529 | + <td>' . $interaction['order_id'].'</td> |
|
530 | + <td colspan="2">' . $interaction['objective_id'].'</td> |
|
531 | + <td colspan="2">' . $interaction['status'].'</td> |
|
532 | + <td>' . $interaction['score_raw'].'</td> |
|
533 | + <td>' . $interaction['score_max'].'</td> |
|
534 | + <td>' . $interaction['score_min'].'</td> |
|
535 | 535 | '.$action.' |
536 | 536 | </tr>'; |
537 | 537 | $counter++; |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $my_path = Database::escape_string($my_path); |
555 | 555 | $sql = "SELECT results_disabled |
556 | 556 | FROM $TBL_QUIZ |
557 | - WHERE c_id = $course_id AND id ='" . $my_path . "'"; |
|
557 | + WHERE c_id = $course_id AND id ='".$my_path."'"; |
|
558 | 558 | $res_result_disabled = Database::query($sql); |
559 | 559 | $row_result_disabled = Database::fetch_row($res_result_disabled); |
560 | 560 | |
@@ -578,14 +578,14 @@ discard block |
||
578 | 578 | $extend_this_attempt = 1; |
579 | 579 | $extend_attempt_link = Display::url( |
580 | 580 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
581 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix |
|
581 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix |
|
582 | 582 | ); |
583 | 583 | } else { |
584 | 584 | // Same case if fold_attempt_id is set, so not implemented explicitly. |
585 | 585 | // The extend button for this attempt has not been clicked. |
586 | 586 | $extend_attempt_link = Display::url( |
587 | 587 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
588 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
588 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
589 | 589 | ); |
590 | 590 | } |
591 | 591 | } |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | if ($inter_num > 1) { |
601 | 601 | $extend_link = Display::url( |
602 | 602 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
603 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
603 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
604 | 604 | ); |
605 | 605 | } |
606 | 606 | |
@@ -616,15 +616,15 @@ discard block |
||
616 | 616 | |
617 | 617 | // Selecting the exe_id from stats attempts tables in order to look the max score value. |
618 | 618 | |
619 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
619 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
620 | 620 | WHERE |
621 | - exe_exo_id="' . $row['path'] . '" AND |
|
622 | - exe_user_id="' . $user_id . '" AND |
|
623 | - orig_lp_id = "' . $lp_id . '" AND |
|
624 | - orig_lp_item_id = "' . $row['myid'] . '" AND |
|
625 | - c_id = ' . $course_id . ' AND |
|
621 | + exe_exo_id="' . $row['path'].'" AND |
|
622 | + exe_user_id="' . $user_id.'" AND |
|
623 | + orig_lp_id = "' . $lp_id.'" AND |
|
624 | + orig_lp_item_id = "' . $row['myid'].'" AND |
|
625 | + c_id = ' . $course_id.' AND |
|
626 | 626 | status <> "incomplete" AND |
627 | - session_id = ' . $session_id . ' |
|
627 | + session_id = ' . $session_id.' |
|
628 | 628 | ORDER BY exe_date DESC |
629 | 629 | LIMIT 1'; |
630 | 630 | |
@@ -655,8 +655,8 @@ discard block |
||
655 | 655 | FROM $TBL_LP_ITEM_VIEW |
656 | 656 | WHERE |
657 | 657 | c_id = $course_id AND |
658 | - lp_item_id = '" . (int) $my_id . "' AND |
|
659 | - lp_view_id = '" . (int) $my_lp_view_id . "' |
|
658 | + lp_item_id = '".(int) $my_id."' AND |
|
659 | + lp_view_id = '" . (int) $my_lp_view_id."' |
|
660 | 660 | ORDER BY view_count DESC limit 1"; |
661 | 661 | $res_score = Database::query($sql); |
662 | 662 | $row_score = Database::fetch_array($res_score); |
@@ -665,8 +665,8 @@ discard block |
||
665 | 665 | FROM $TBL_LP_ITEM_VIEW |
666 | 666 | WHERE |
667 | 667 | c_id = $course_id AND |
668 | - lp_item_id = '" . (int) $my_id . "' AND |
|
669 | - lp_view_id = '" . (int) $my_lp_view_id . "'"; |
|
668 | + lp_item_id = '".(int) $my_id."' AND |
|
669 | + lp_view_id = '" . (int) $my_lp_view_id."'"; |
|
670 | 670 | $res_time = Database::query($sql); |
671 | 671 | $row_time = Database::fetch_array($res_time); |
672 | 672 | |
@@ -725,16 +725,16 @@ discard block |
||
725 | 725 | } else { |
726 | 726 | $correct_test_link = '-'; |
727 | 727 | if ($row['item_type'] == 'quiz') { |
728 | - $my_url_suffix = '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . intval($row['mylpid']) . '&origin=' . $origin; |
|
729 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
728 | + $my_url_suffix = '&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.intval($row['mylpid']).'&origin='.$origin; |
|
729 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
730 | 730 | WHERE |
731 | - exe_exo_id="' . $row['path'] . '" AND |
|
732 | - exe_user_id="' . $user_id . '" AND |
|
733 | - orig_lp_id = "' . $lp_id . '" AND |
|
734 | - orig_lp_item_id = "' . $row['myid'] . '" AND |
|
735 | - c_id = ' . $course_id . ' AND |
|
731 | + exe_exo_id="' . $row['path'].'" AND |
|
732 | + exe_user_id="' . $user_id.'" AND |
|
733 | + orig_lp_id = "' . $lp_id.'" AND |
|
734 | + orig_lp_item_id = "' . $row['myid'].'" AND |
|
735 | + c_id = ' . $course_id.' AND |
|
736 | 736 | status <> "incomplete" AND |
737 | - session_id = ' . $session_id . ' |
|
737 | + session_id = ' . $session_id.' |
|
738 | 738 | ORDER BY exe_date DESC '; |
739 | 739 | |
740 | 740 | $resultLastAttempt = Database::query($sql); |
@@ -746,12 +746,12 @@ discard block |
||
746 | 746 | ) { |
747 | 747 | $correct_test_link = Display::url( |
748 | 748 | Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')), |
749 | - api_get_self() . '?action=stats' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id |
|
749 | + api_get_self().'?action=stats'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id |
|
750 | 750 | ); |
751 | 751 | } else { |
752 | 752 | $correct_test_link = Display::url( |
753 | 753 | Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttemptsByExercise')), |
754 | - api_get_self() . '?action=stats&extend_attempt=1' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id |
|
754 | + api_get_self().'?action=stats&extend_attempt=1'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id |
|
755 | 755 | ); |
756 | 756 | } |
757 | 757 | } |
@@ -761,14 +761,14 @@ discard block |
||
761 | 761 | |
762 | 762 | $action = null; |
763 | 763 | if ($type == 'classic') { |
764 | - $action = '<td>' . $correct_test_link . '</td>'; |
|
764 | + $action = '<td>'.$correct_test_link.'</td>'; |
|
765 | 765 | } |
766 | 766 | |
767 | 767 | if ($lp_id == $my_lp_id && false) { |
768 | 768 | |
769 | - $output .= '<tr class =' . $oddclass . '> |
|
770 | - <td>' . $extend_link . '</td> |
|
771 | - <td colspan="4">' . $title . '</td> |
|
769 | + $output .= '<tr class ='.$oddclass.'> |
|
770 | + <td>' . $extend_link.'</td> |
|
771 | + <td colspan="4">' . $title.'</td> |
|
772 | 772 | <td colspan="2"> </td> |
773 | 773 | <td colspan="2"> </td> |
774 | 774 | <td colspan="2"> </td> |
@@ -793,13 +793,13 @@ discard block |
||
793 | 793 | $scoreItem .= ExerciseLib::show_score($score, $maxscore, false); |
794 | 794 | } |
795 | 795 | } else { |
796 | - $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . $maxscore); |
|
796 | + $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.$maxscore); |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | $output .= ' |
800 | 800 | <td>'.$extend_link.'</td> |
801 | - <td colspan="4">' . $title . '</td> |
|
802 | - <td colspan="2">' . learnpathitem::humanize_status($lesson_status) .'</td> |
|
801 | + <td colspan="4">' . $title.'</td> |
|
802 | + <td colspan="2">' . learnpathitem::humanize_status($lesson_status).'</td> |
|
803 | 803 | <td colspan="2">'.$scoreItem.'</td> |
804 | 804 | <td colspan="2">'.$time.'</td> |
805 | 805 | '.$action.' |
@@ -816,10 +816,10 @@ discard block |
||
816 | 816 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
817 | 817 | $temp[] = '/'; |
818 | 818 | } else { |
819 | - $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
819 | + $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
820 | 820 | } |
821 | 821 | } else { |
822 | - $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
822 | + $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
823 | 823 | } |
824 | 824 | $temp[] = $time; |
825 | 825 | $csv_content[] = $temp; |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | |
831 | 831 | $action = null; |
832 | 832 | if ($type == 'classic') { |
833 | - $action = '<td></td>'; |
|
833 | + $action = '<td></td>'; |
|
834 | 834 | } |
835 | 835 | |
836 | 836 | if ($extend_this_attempt || $extend_all) { |
@@ -867,11 +867,11 @@ discard block |
||
867 | 867 | <td></td> |
868 | 868 | <td></td> |
869 | 869 | <td></td> |
870 | - <td>' . $interaction['order_id'] . '</td> |
|
871 | - <td colspan="2">'.$interaction['objective_id'] . '</td> |
|
872 | - <td colspan="2">' . $interaction['status'] . '</td> |
|
870 | + <td>' . $interaction['order_id'].'</td> |
|
871 | + <td colspan="2">'.$interaction['objective_id'].'</td> |
|
872 | + <td colspan="2">' . $interaction['status'].'</td> |
|
873 | 873 | <td>' . $interaction['score_raw'].'</td> |
874 | - <td>' . $interaction['score_max'] .'</td> |
|
874 | + <td>' . $interaction['score_max'].'</td> |
|
875 | 875 | <td>' . $interaction['score_min'].'</td> |
876 | 876 | '.$action.' |
877 | 877 | </tr>'; |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | } |
881 | 881 | |
882 | 882 | // Attempts listing by exercise. |
883 | - if ($lp_id == $my_lp_id && $lp_item_id== $my_id && $extendedAttempt) { |
|
883 | + if ($lp_id == $my_lp_id && $lp_item_id == $my_id && $extendedAttempt) { |
|
884 | 884 | // Get attempts of a exercise. |
885 | 885 | if (!empty($lp_id) && |
886 | 886 | !empty($lp_item_id) && |
@@ -895,15 +895,15 @@ discard block |
||
895 | 895 | $row_path = Database::fetch_array($res_path); |
896 | 896 | |
897 | 897 | if (Database::num_rows($res_path) > 0) { |
898 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
898 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
899 | 899 | WHERE |
900 | - exe_exo_id="' . (int) $row_path['path'] . '" AND |
|
900 | + exe_exo_id="' . (int) $row_path['path'].'" AND |
|
901 | 901 | status <> "incomplete" AND |
902 | - exe_user_id="' . $user_id . '" AND |
|
903 | - orig_lp_id = "' . (int) $lp_id . '" AND |
|
904 | - orig_lp_item_id = "' . (int) $lp_item_id . '" AND |
|
905 | - c_id = ' . $course_id . ' AND |
|
906 | - session_id = ' . $session_id . ' |
|
902 | + exe_user_id="' . $user_id.'" AND |
|
903 | + orig_lp_id = "' . (int) $lp_id.'" AND |
|
904 | + orig_lp_item_id = "' . (int) $lp_item_id.'" AND |
|
905 | + c_id = ' . $course_id.' AND |
|
906 | + session_id = ' . $session_id.' |
|
907 | 907 | ORDER BY exe_date'; |
908 | 908 | $res_attempts = Database::query($sql); |
909 | 909 | $num_attempts = Database::num_rows($res_attempts); |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | if ($mktime_start_date && $mktime_exe_date) { |
922 | 922 | $mytime = ((int) $mktime_exe_date - (int) $mktime_start_date); |
923 | 923 | $time_attemp = learnpathItem :: getScormTimeFromParameter('js', $mytime); |
924 | - $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp); |
|
924 | + $time_attemp = str_replace('NaN', '00'.$h.'00\'00"', $time_attemp); |
|
925 | 925 | } else { |
926 | 926 | $time_attemp = ' - '; |
927 | 927 | } |
@@ -947,33 +947,33 @@ discard block |
||
947 | 947 | $my_lesson_status = learnpathitem::humanize_status('incomplete'); |
948 | 948 | } |
949 | 949 | |
950 | - $output .= '<tr class="' . $oddclass . '" > |
|
950 | + $output .= '<tr class="'.$oddclass.'" > |
|
951 | 951 | <td></td> |
952 | - <td>' . $extend_attempt_link . '</td> |
|
953 | - <td colspan="3">' . get_lang('Attempt').' '. $n.'</td> |
|
954 | - <td colspan="2">' . $my_lesson_status . '</td> |
|
955 | - <td colspan="2">'.$view_score . '</td> |
|
956 | - <td colspan="2">'.$time_attemp . '</td>'; |
|
952 | + <td>' . $extend_attempt_link.'</td> |
|
953 | + <td colspan="3">' . get_lang('Attempt').' '.$n.'</td> |
|
954 | + <td colspan="2">' . $my_lesson_status.'</td> |
|
955 | + <td colspan="2">'.$view_score.'</td> |
|
956 | + <td colspan="2">'.$time_attemp.'</td>'; |
|
957 | 957 | if ($action == 'classic') { |
958 | 958 | if ($origin != 'tracking') { |
959 | 959 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
960 | 960 | $output .= '<td> |
961 | - <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"> |
|
961 | + <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"> |
|
962 | 962 | </td>'; |
963 | 963 | } else { |
964 | 964 | $output .= '<td> |
965 | - <a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent"> |
|
966 | - <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"> |
|
965 | + <a href="../exercice/exercise_show.php?origin=' . $origin.'&id='.$my_exe_id.'&cidReq='.$courseCode.'" target="_parent"> |
|
966 | + <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"> |
|
967 | 967 | </a></td>'; |
968 | 968 | } |
969 | 969 | } else { |
970 | 970 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
971 | 971 | $output .= '<td> |
972 | - <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>'; |
|
972 | + <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></td>'; |
|
973 | 973 | } else { |
974 | 974 | $output .= '<td> |
975 | - <a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent"> |
|
976 | - <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>'; |
|
975 | + <a href="../exercice/exercise_show.php?cidReq=' . $courseCode.'&origin=correct_exercise_in_lp&id='.$my_exe_id.'" target="_parent"> |
|
976 | + <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></a></td>'; |
|
977 | 977 | } |
978 | 978 | } |
979 | 979 | } |
@@ -1032,13 +1032,13 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $total_time = learnpathItem::getScormTimeFromParameter('js', $total_time); |
1035 | - $total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time); |
|
1035 | + $total_time = str_replace('NaN', '00'.$h.'00\'00"', $total_time); |
|
1036 | 1036 | |
1037 | 1037 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
1038 | 1038 | $final_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); |
1039 | 1039 | } else { |
1040 | 1040 | if (is_numeric($total_score)) { |
1041 | - $final_score = $total_score . '%'; |
|
1041 | + $final_score = $total_score.'%'; |
|
1042 | 1042 | } else { |
1043 | 1043 | $final_score = $total_score; |
1044 | 1044 | } |
@@ -1054,19 +1054,19 @@ discard block |
||
1054 | 1054 | |
1055 | 1055 | $action = null; |
1056 | 1056 | if ($type == 'classic') { |
1057 | - $action = '<td></td>'; |
|
1057 | + $action = '<td></td>'; |
|
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | $output .= '<tr class="'.$oddclass.'"> |
1061 | 1061 | <td></td> |
1062 | 1062 | <td colspan="4"> |
1063 | - <i>' . get_lang('AccomplishedStepsTotal') .'</i> |
|
1063 | + <i>' . get_lang('AccomplishedStepsTotal').'</i> |
|
1064 | 1064 | </td> |
1065 | 1065 | <td colspan="2">'.$progress.'%</td> |
1066 | 1066 | <td colspan="2"> |
1067 | 1067 | ' . $final_score.' |
1068 | 1068 | </td> |
1069 | - <td colspan="2">' . $total_time . '</div> |
|
1069 | + <td colspan="2">' . $total_time.'</div> |
|
1070 | 1070 | '.$action.' |
1071 | 1071 | </tr>'; |
1072 | 1072 | |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | $tbl_track_course = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); |
1407 | 1407 | if (is_array($user_id)) { |
1408 | 1408 | $user_id = array_map('intval', $user_id); |
1409 | - $condition_user = " AND user_id IN (".implode(',',$user_id).") "; |
|
1409 | + $condition_user = " AND user_id IN (".implode(',', $user_id).") "; |
|
1410 | 1410 | } else { |
1411 | 1411 | $user_id = intval($user_id); |
1412 | 1412 | $condition_user = " AND user_id = $user_id "; |
@@ -1442,13 +1442,13 @@ discard block |
||
1442 | 1442 | { |
1443 | 1443 | $tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
1444 | 1444 | $sql = 'SELECT login_date |
1445 | - FROM ' . $tbl_track_login . ' |
|
1446 | - WHERE login_user_id = ' . intval($student_id) . ' |
|
1445 | + FROM ' . $tbl_track_login.' |
|
1446 | + WHERE login_user_id = ' . intval($student_id).' |
|
1447 | 1447 | ORDER BY login_date ASC |
1448 | 1448 | LIMIT 0,1'; |
1449 | 1449 | |
1450 | 1450 | $rs = Database::query($sql); |
1451 | - if (Database::num_rows($rs)>0) { |
|
1451 | + if (Database::num_rows($rs) > 0) { |
|
1452 | 1452 | if ($first_login_date = Database::result($rs, 0, 0)) { |
1453 | 1453 | return api_convert_and_format_date( |
1454 | 1454 | $first_login_date, |
@@ -1473,8 +1473,8 @@ discard block |
||
1473 | 1473 | { |
1474 | 1474 | $table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
1475 | 1475 | $sql = 'SELECT login_date |
1476 | - FROM ' . $table . ' |
|
1477 | - WHERE login_user_id = ' . intval($student_id) . ' |
|
1476 | + FROM ' . $table.' |
|
1477 | + WHERE login_user_id = ' . intval($student_id).' |
|
1478 | 1478 | ORDER BY login_date |
1479 | 1479 | DESC LIMIT 0,1'; |
1480 | 1480 | |
@@ -1483,18 +1483,18 @@ discard block |
||
1483 | 1483 | if ($last_login_date = Database::result($rs, 0, 0)) { |
1484 | 1484 | $last_login_date = api_get_local_time($last_login_date); |
1485 | 1485 | if ($return_timestamp) { |
1486 | - return api_strtotime($last_login_date,'UTC'); |
|
1486 | + return api_strtotime($last_login_date, 'UTC'); |
|
1487 | 1487 | } else { |
1488 | 1488 | if (!$warning_message) { |
1489 | 1489 | return api_format_date($last_login_date, DATE_FORMAT_SHORT); |
1490 | 1490 | } else { |
1491 | - $timestamp = api_strtotime($last_login_date,'UTC'); |
|
1491 | + $timestamp = api_strtotime($last_login_date, 'UTC'); |
|
1492 | 1492 | $currentTimestamp = time(); |
1493 | 1493 | |
1494 | 1494 | //If the last connection is > than 7 days, the text is red |
1495 | 1495 | //345600 = 7 days in seconds |
1496 | 1496 | if ($currentTimestamp - $timestamp > 604800) { |
1497 | - return '<span style="color: #F00;">' . api_format_date($last_login_date, DATE_FORMAT_SHORT) . '</span>'; |
|
1497 | + return '<span style="color: #F00;">'.api_format_date($last_login_date, DATE_FORMAT_SHORT).'</span>'; |
|
1498 | 1498 | } else { |
1499 | 1499 | return api_format_date($last_login_date, DATE_FORMAT_SHORT); |
1500 | 1500 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | $sql = "$select |
1530 | 1530 | FROM $tbl_track_login |
1531 | 1531 | WHERE |
1532 | - login_user_id IN (' ". implode("','", $studentList) . "' ) AND |
|
1532 | + login_user_id IN (' ".implode("','", $studentList)."' ) AND |
|
1533 | 1533 | login_date < '$date' |
1534 | 1534 | "; |
1535 | 1535 | $rs = Database::query($sql); |
@@ -1628,7 +1628,7 @@ discard block |
||
1628 | 1628 | '.Display::return_icon('messagebox_warning.gif').' |
1629 | 1629 | </a>' |
1630 | 1630 | : null; |
1631 | - return $icon. Display::label($last_login_date, 'warning'); |
|
1631 | + return $icon.Display::label($last_login_date, 'warning'); |
|
1632 | 1632 | } else { |
1633 | 1633 | return $last_login_date; |
1634 | 1634 | } |
@@ -1663,8 +1663,8 @@ discard block |
||
1663 | 1663 | |
1664 | 1664 | // Given we're storing in cache, round the start and end times |
1665 | 1665 | // to the lower minute |
1666 | - $roundedStart = substr($start, 0, -2) . '00'; |
|
1667 | - $roundedStop = substr($stop, 0, -2) . '00'; |
|
1666 | + $roundedStart = substr($start, 0, -2).'00'; |
|
1667 | + $roundedStop = substr($stop, 0, -2).'00'; |
|
1668 | 1668 | $roundedStart = Database::escape_string($roundedStart); |
1669 | 1669 | $roundedStop = Database::escape_string($roundedStop); |
1670 | 1670 | |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | $session_id = intval($session_id); |
1675 | 1675 | $count = 0; |
1676 | 1676 | $tbl_track_e_course_access = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); |
1677 | - $sql = "SELECT count(*) as count_connections |
|
1677 | + $sql = "SELECT count(*) as count_connections |
|
1678 | 1678 | FROM $tbl_track_e_course_access |
1679 | 1679 | WHERE |
1680 | 1680 | c_id = $courseId AND |
@@ -1696,7 +1696,7 @@ discard block |
||
1696 | 1696 | $count = apcu_fetch($apc_var); |
1697 | 1697 | } else { |
1698 | 1698 | $rs = Database::query($sql); |
1699 | - if (Database::num_rows($rs)>0) { |
|
1699 | + if (Database::num_rows($rs) > 0) { |
|
1700 | 1700 | $row = Database::fetch_object($rs); |
1701 | 1701 | $count = $row->count_connections; |
1702 | 1702 | } |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | } |
1706 | 1706 | } else { |
1707 | 1707 | $rs = Database::query($sql); |
1708 | - if (Database::num_rows($rs)>0) { |
|
1708 | + if (Database::num_rows($rs) > 0) { |
|
1709 | 1709 | $row = Database::fetch_object($rs); |
1710 | 1710 | $count = $row->count_connections; |
1711 | 1711 | } |
@@ -1727,14 +1727,14 @@ discard block |
||
1727 | 1727 | $tbl_session_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
1728 | 1728 | |
1729 | 1729 | $sql = 'SELECT DISTINCT c_id |
1730 | - FROM ' . $tbl_course_rel_user . ' |
|
1730 | + FROM ' . $tbl_course_rel_user.' |
|
1731 | 1731 | WHERE user_id = ' . $user_id.' AND relation_type<>'.COURSE_RELATION_TYPE_RRHH; |
1732 | 1732 | $rs = Database::query($sql); |
1733 | 1733 | $nb_courses = Database::num_rows($rs); |
1734 | 1734 | |
1735 | 1735 | if ($include_sessions) { |
1736 | 1736 | $sql = 'SELECT DISTINCT c_id |
1737 | - FROM ' . $tbl_session_course_rel_user . ' |
|
1737 | + FROM ' . $tbl_session_course_rel_user.' |
|
1738 | 1738 | WHERE user_id = ' . $user_id; |
1739 | 1739 | $rs = Database::query($sql); |
1740 | 1740 | $nb_courses += Database::num_rows($rs); |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $condition_quiz = ""; |
1782 | 1782 | if (!empty($exercise_id)) { |
1783 | 1783 | $exercise_id = intval($exercise_id); |
1784 | - $condition_quiz =" AND id = $exercise_id "; |
|
1784 | + $condition_quiz = " AND id = $exercise_id "; |
|
1785 | 1785 | } |
1786 | 1786 | |
1787 | 1787 | // Compose a filter based on optional session id given |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | } |
1831 | 1831 | } |
1832 | 1832 | if (!empty($exercise_list)) { |
1833 | - $exercise_id = implode("','",$exercise_list); |
|
1833 | + $exercise_id = implode("','", $exercise_list); |
|
1834 | 1834 | } |
1835 | 1835 | } |
1836 | 1836 | |
@@ -1855,10 +1855,10 @@ discard block |
||
1855 | 1855 | $quiz_avg_score = null; |
1856 | 1856 | |
1857 | 1857 | if (!empty($row['avg_score'])) { |
1858 | - $quiz_avg_score = round($row['avg_score'],2); |
|
1858 | + $quiz_avg_score = round($row['avg_score'], 2); |
|
1859 | 1859 | } |
1860 | 1860 | |
1861 | - if(!empty($row['num_attempts'])) { |
|
1861 | + if (!empty($row['num_attempts'])) { |
|
1862 | 1862 | $quiz_avg_score = round($quiz_avg_score / $row['num_attempts'], 2); |
1863 | 1863 | } |
1864 | 1864 | if (is_array($student_id)) { |
@@ -1988,7 +1988,7 @@ discard block |
||
1988 | 1988 | $row = Database::fetch_row($rs); |
1989 | 1989 | $count = $row[0]; |
1990 | 1990 | } |
1991 | - $count = ($count != 0 ) ? 100*round(intval($count)/count($exercise_list), 2) .'%' : '0%'; |
|
1991 | + $count = ($count != 0) ? 100 * round(intval($count) / count($exercise_list), 2).'%' : '0%'; |
|
1992 | 1992 | return $count; |
1993 | 1993 | } |
1994 | 1994 | |
@@ -2013,7 +2013,7 @@ discard block |
||
2013 | 2013 | ); |
2014 | 2014 | |
2015 | 2015 | if (!empty($best_attempt) && !empty($best_attempt['exe_weighting'])) { |
2016 | - $result += $best_attempt['exe_result']/$best_attempt['exe_weighting']; |
|
2016 | + $result += $best_attempt['exe_result'] / $best_attempt['exe_weighting']; |
|
2017 | 2017 | } |
2018 | 2018 | } |
2019 | 2019 | $result = $result / count($exercise_list); |
@@ -2050,7 +2050,7 @@ discard block |
||
2050 | 2050 | $query = sprintf($sql, intval($courseId), $sessionId); |
2051 | 2051 | $rs = Database::query($query); |
2052 | 2052 | $teachers = array(); |
2053 | - while ($teacher = Database::fetch_array($rs,'ASSOC')) { |
|
2053 | + while ($teacher = Database::fetch_array($rs, 'ASSOC')) { |
|
2054 | 2054 | $teachers[] = $teacher; |
2055 | 2055 | } |
2056 | 2056 | $data = array(); |
@@ -2174,7 +2174,7 @@ discard block |
||
2174 | 2174 | $data[] = array( |
2175 | 2175 | 'course' => $course['title'], |
2176 | 2176 | 'session' => $teacher['name'], |
2177 | - 'tutor' => $tutor['username'] . ' - ' . $tutor['lastname'] . ' ' . $tutor['firstname'], |
|
2177 | + 'tutor' => $tutor['username'].' - '.$tutor['lastname'].' '.$tutor['firstname'], |
|
2178 | 2178 | 'documents' => $totalDocuments, |
2179 | 2179 | 'links' => $totalLinks, |
2180 | 2180 | 'forums' => $totalForums, |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | for ($i = 0; $i < count($lpIdList); $i++) { |
2238 | 2238 | $placeHolders[] = '?'; |
2239 | 2239 | } |
2240 | - $lpConditions['AND id IN(' . implode(', ', $placeHolders) . ') '] = $lpIdList; |
|
2240 | + $lpConditions['AND id IN('.implode(', ', $placeHolders).') '] = $lpIdList; |
|
2241 | 2241 | } |
2242 | 2242 | |
2243 | 2243 | if ($onlySeriousGame) { |
@@ -2257,14 +2257,14 @@ discard block |
||
2257 | 2257 | |
2258 | 2258 | $conditions = [ |
2259 | 2259 | " c_id = {$courseInfo['real_id']} ", |
2260 | - " lp_view.lp_id IN(" . implode(', ', $filteredLP) . ") " |
|
2260 | + " lp_view.lp_id IN(".implode(', ', $filteredLP).") " |
|
2261 | 2261 | ]; |
2262 | 2262 | |
2263 | 2263 | $groupBy = 'GROUP BY lp_id'; |
2264 | 2264 | |
2265 | 2265 | if (is_array($studentId)) { |
2266 | 2266 | $studentId = array_map('intval', $studentId); |
2267 | - $conditions[] = " lp_view.user_id IN (" . implode(',', $studentId) . ") "; |
|
2267 | + $conditions[] = " lp_view.user_id IN (".implode(',', $studentId).") "; |
|
2268 | 2268 | |
2269 | 2269 | |
2270 | 2270 | } else { |
@@ -2399,7 +2399,7 @@ discard block |
||
2399 | 2399 | // Compose a filter based on optional learning paths list given |
2400 | 2400 | $condition_lp = ""; |
2401 | 2401 | if (count($lp_ids) > 0) { |
2402 | - $condition_lp =" AND id IN(".implode(',',$lp_ids).") "; |
|
2402 | + $condition_lp = " AND id IN(".implode(',', $lp_ids).") "; |
|
2403 | 2403 | } |
2404 | 2404 | |
2405 | 2405 | // Compose a filter based on optional session id |
@@ -2439,9 +2439,9 @@ discard block |
||
2439 | 2439 | // prepare filter on users |
2440 | 2440 | if (is_array($student_id)) { |
2441 | 2441 | array_walk($student_id, 'intval'); |
2442 | - $condition_user1 =" AND user_id IN (".implode(',', $student_id).") "; |
|
2442 | + $condition_user1 = " AND user_id IN (".implode(',', $student_id).") "; |
|
2443 | 2443 | } else { |
2444 | - $condition_user1 =" AND user_id = $student_id "; |
|
2444 | + $condition_user1 = " AND user_id = $student_id "; |
|
2445 | 2445 | } |
2446 | 2446 | |
2447 | 2447 | if ($count_row_lp > 0 && !empty($student_id)) { |
@@ -2484,7 +2484,7 @@ discard block |
||
2484 | 2484 | ORDER BY lp_item_id"; |
2485 | 2485 | $res_lp_item = Database::query($sql); |
2486 | 2486 | |
2487 | - while ($row_lp_item = Database::fetch_array($res_lp_item,'ASSOC')) { |
|
2487 | + while ($row_lp_item = Database::fetch_array($res_lp_item, 'ASSOC')) { |
|
2488 | 2488 | $my_lp_item_id = $row_lp_item['lp_item_id']; |
2489 | 2489 | |
2490 | 2490 | // Getting the most recent attempt |
@@ -2507,8 +2507,8 @@ discard block |
||
2507 | 2507 | ORDER BY view_count DESC |
2508 | 2508 | LIMIT 1"; |
2509 | 2509 | $res_lp_item_result = Database::query($sql); |
2510 | - while ($row_max_score = Database::fetch_array($res_lp_item_result,'ASSOC')) { |
|
2511 | - $list[]= $row_max_score; |
|
2510 | + while ($row_max_score = Database::fetch_array($res_lp_item_result, 'ASSOC')) { |
|
2511 | + $list[] = $row_max_score; |
|
2512 | 2512 | } |
2513 | 2513 | } |
2514 | 2514 | } else { |
@@ -2532,8 +2532,8 @@ discard block |
||
2532 | 2532 | if ($debug) echo $sql.'<br />'; |
2533 | 2533 | $res_max_score = Database::query($sql); |
2534 | 2534 | |
2535 | - while ($row_max_score = Database::fetch_array($res_max_score,'ASSOC')) { |
|
2536 | - $list[]= $row_max_score; |
|
2535 | + while ($row_max_score = Database::fetch_array($res_max_score, 'ASSOC')) { |
|
2536 | + $list[] = $row_max_score; |
|
2537 | 2537 | } |
2538 | 2538 | } |
2539 | 2539 | |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | $max_score_item_view = $row_max_score['max_score_item_view']; |
2549 | 2549 | $score = $row_max_score['score']; |
2550 | 2550 | |
2551 | - if ($debug) echo '<h3>Item Type: ' .$row_max_score['item_type'].'</h3>'; |
|
2551 | + if ($debug) echo '<h3>Item Type: '.$row_max_score['item_type'].'</h3>'; |
|
2552 | 2552 | |
2553 | 2553 | if ($row_max_score['item_type'] == 'sco') { |
2554 | 2554 | /* Check if it is sco (easier to get max_score) |
@@ -2566,7 +2566,7 @@ discard block |
||
2566 | 2566 | } |
2567 | 2567 | // Avoid division by zero errors |
2568 | 2568 | if (!empty($max_score)) { |
2569 | - $lp_partial_total += $score/$max_score; |
|
2569 | + $lp_partial_total += $score / $max_score; |
|
2570 | 2570 | } |
2571 | 2571 | if ($debug) echo '<b>$lp_partial_total, $score, $max_score '.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />'; |
2572 | 2572 | } else { |
@@ -2590,10 +2590,10 @@ discard block |
||
2590 | 2590 | ORDER BY exe_date DESC |
2591 | 2591 | LIMIT 1"; |
2592 | 2592 | |
2593 | - if ($debug) echo $sql .'<br />'; |
|
2593 | + if ($debug) echo $sql.'<br />'; |
|
2594 | 2594 | $result_last_attempt = Database::query($sql); |
2595 | 2595 | $num = Database :: num_rows($result_last_attempt); |
2596 | - if ($num > 0 ) { |
|
2596 | + if ($num > 0) { |
|
2597 | 2597 | $id_last_attempt = Database :: result($result_last_attempt, 0, 0); |
2598 | 2598 | if ($debug) echo $id_last_attempt.'<br />'; |
2599 | 2599 | |
@@ -2622,13 +2622,13 @@ discard block |
||
2622 | 2622 | $max_score = $row_max_score_bis['maxscore']; |
2623 | 2623 | } |
2624 | 2624 | if (!empty($max_score) && floatval($max_score) > 0) { |
2625 | - $lp_partial_total += $score/$max_score; |
|
2625 | + $lp_partial_total += $score / $max_score; |
|
2626 | 2626 | } |
2627 | 2627 | if ($debug) echo '$lp_partial_total, $score, $max_score <b>'.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />'; |
2628 | 2628 | } |
2629 | 2629 | } |
2630 | 2630 | |
2631 | - if (in_array($row_max_score['item_type'], array('quiz','sco'))) { |
|
2631 | + if (in_array($row_max_score['item_type'], array('quiz', 'sco'))) { |
|
2632 | 2632 | // Normal way |
2633 | 2633 | if ($use_max_score[$lp_id]) { |
2634 | 2634 | $count_items++; |
@@ -2663,8 +2663,8 @@ discard block |
||
2663 | 2663 | if ($debug) echo $sql; |
2664 | 2664 | $result_have_quiz = Database::query($sql); |
2665 | 2665 | |
2666 | - if (Database::num_rows($result_have_quiz) > 0 ) { |
|
2667 | - $row = Database::fetch_array($result_have_quiz,'ASSOC'); |
|
2666 | + if (Database::num_rows($result_have_quiz) > 0) { |
|
2667 | + $row = Database::fetch_array($result_have_quiz, 'ASSOC'); |
|
2668 | 2668 | if (is_numeric($row['count']) && $row['count'] != 0) { |
2669 | 2669 | $lp_with_quiz++; |
2670 | 2670 | } |
@@ -2676,7 +2676,7 @@ discard block |
||
2676 | 2676 | |
2677 | 2677 | if ($lp_with_quiz != 0) { |
2678 | 2678 | if (!$return_array) { |
2679 | - $score_of_scorm_calculate = round(($global_result/$lp_with_quiz),2); |
|
2679 | + $score_of_scorm_calculate = round(($global_result / $lp_with_quiz), 2); |
|
2680 | 2680 | if ($debug) var_dump($score_of_scorm_calculate); |
2681 | 2681 | if (empty($lp_ids)) { |
2682 | 2682 | if ($debug) echo '<h2>All lps fix: '.$score_of_scorm_calculate.'</h2>'; |
@@ -2750,9 +2750,9 @@ discard block |
||
2750 | 2750 | |
2751 | 2751 | if (is_array($student_id)) { |
2752 | 2752 | array_walk($student_id, 'intval'); |
2753 | - $conditions[] =" lp_view.user_id IN (".implode(',', $student_id).") "; |
|
2753 | + $conditions[] = " lp_view.user_id IN (".implode(',', $student_id).") "; |
|
2754 | 2754 | } else { |
2755 | - $conditions[] =" lp_view.user_id = $student_id "; |
|
2755 | + $conditions[] = " lp_view.user_id = $student_id "; |
|
2756 | 2756 | } |
2757 | 2757 | |
2758 | 2758 | $conditionsToString = implode('AND ', $conditions); |
@@ -2776,7 +2776,7 @@ discard block |
||
2776 | 2776 | return 0; |
2777 | 2777 | } |
2778 | 2778 | |
2779 | - return ($row['sum_score'] / $row['sum_max_score'])*100; |
|
2779 | + return ($row['sum_score'] / $row['sum_max_score']) * 100; |
|
2780 | 2780 | |
2781 | 2781 | } |
2782 | 2782 | |
@@ -2806,7 +2806,7 @@ discard block |
||
2806 | 2806 | // Compose a filter based on optional learning paths list given |
2807 | 2807 | $condition_lp = ""; |
2808 | 2808 | if (count($lp_ids) > 0) { |
2809 | - $condition_lp =" AND id IN(".implode(',',$lp_ids).") "; |
|
2809 | + $condition_lp = " AND id IN(".implode(',', $lp_ids).") "; |
|
2810 | 2810 | } |
2811 | 2811 | |
2812 | 2812 | // Compose a filter based on optional session id |
@@ -2868,7 +2868,7 @@ discard block |
||
2868 | 2868 | |
2869 | 2869 | if (!empty($course)) { |
2870 | 2870 | |
2871 | - $course_id = $course['real_id']; |
|
2871 | + $course_id = $course['real_id']; |
|
2872 | 2872 | |
2873 | 2873 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
2874 | 2874 | $t_lpv = Database :: get_course_table(TABLE_LP_VIEW); |
@@ -2882,8 +2882,8 @@ discard block |
||
2882 | 2882 | // calculates last connection time |
2883 | 2883 | if ($count_row_lp > 0) { |
2884 | 2884 | $sql = 'SELECT MAX(start_time) |
2885 | - FROM ' . $t_lpiv . ' AS item_view |
|
2886 | - INNER JOIN ' . $t_lpv . ' AS view |
|
2885 | + FROM ' . $t_lpiv.' AS item_view |
|
2886 | + INNER JOIN ' . $t_lpv.' AS view |
|
2887 | 2887 | ON item_view.lp_view_id = view.id |
2888 | 2888 | WHERE |
2889 | 2889 | item_view.c_id = '.$course_id.' AND |
@@ -2919,15 +2919,15 @@ discard block |
||
2919 | 2919 | |
2920 | 2920 | // At first, courses where $coach_id is coach of the course // |
2921 | 2921 | $sql = 'SELECT session_id, c_id |
2922 | - FROM ' . $tbl_session_course_user . ' |
|
2922 | + FROM ' . $tbl_session_course_user.' |
|
2923 | 2923 | WHERE user_id=' . $coach_id.' AND status=2'; |
2924 | 2924 | |
2925 | 2925 | if (api_is_multiple_url_enabled()) { |
2926 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
2926 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
2927 | 2927 | $access_url_id = api_get_current_access_url_id(); |
2928 | 2928 | if ($access_url_id != -1) { |
2929 | 2929 | $sql = 'SELECT scu.session_id, scu.c_id |
2930 | - FROM ' . $tbl_session_course_user . ' scu |
|
2930 | + FROM ' . $tbl_session_course_user.' scu |
|
2931 | 2931 | INNER JOIN '.$tbl_session_rel_access_url.' sru |
2932 | 2932 | ON (scu.session_id=sru.session_id) |
2933 | 2933 | WHERE |
@@ -2961,28 +2961,28 @@ discard block |
||
2961 | 2961 | |
2962 | 2962 | // Then, courses where $coach_id is coach of the session // |
2963 | 2963 | $sql = 'SELECT session_course_user.user_id |
2964 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
2964 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
2965 | 2965 | INNER JOIN '.$tbl_session_user.' sru |
2966 | 2966 | ON session_course_user.user_id = sru.user_id AND session_course_user.session_id = sru.session_id |
2967 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
2967 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
2968 | 2968 | ON session_course.c_id = session_course_user.c_id |
2969 | 2969 | AND session_course_user.session_id = session_course.session_id |
2970 | - INNER JOIN ' . $tbl_session . ' as session |
|
2970 | + INNER JOIN ' . $tbl_session.' as session |
|
2971 | 2971 | ON session.id = session_course.session_id |
2972 | 2972 | AND session.id_coach = ' . $coach_id; |
2973 | 2973 | if (api_is_multiple_url_enabled()) { |
2974 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
2974 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
2975 | 2975 | $access_url_id = api_get_current_access_url_id(); |
2976 | - if ($access_url_id != -1){ |
|
2976 | + if ($access_url_id != -1) { |
|
2977 | 2977 | $sql = 'SELECT session_course_user.user_id |
2978 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
2978 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
2979 | 2979 | INNER JOIN '.$tbl_session_user.' sru |
2980 | 2980 | ON session_course_user.user_id = sru.user_id AND |
2981 | 2981 | session_course_user.session_id = sru.session_id |
2982 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
2982 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
2983 | 2983 | ON session_course.c_id = session_course_user.c_id AND |
2984 | 2984 | session_course_user.session_id = session_course.session_id |
2985 | - INNER JOIN ' . $tbl_session . ' as session |
|
2985 | + INNER JOIN ' . $tbl_session.' as session |
|
2986 | 2986 | ON session.id = session_course.session_id AND |
2987 | 2987 | session.id_coach = ' . $coach_id.' |
2988 | 2988 | INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url |
@@ -3012,8 +3012,8 @@ discard block |
||
3012 | 3012 | |
3013 | 3013 | $students = []; |
3014 | 3014 | // At first, courses where $coach_id is coach of the course // |
3015 | - $sql = 'SELECT c_id FROM ' . $tbl_session_course_user . ' |
|
3016 | - WHERE session_id="' . $id_session . '" AND user_id=' . $coach_id.' AND status=2'; |
|
3015 | + $sql = 'SELECT c_id FROM '.$tbl_session_course_user.' |
|
3016 | + WHERE session_id="' . $id_session.'" AND user_id='.$coach_id.' AND status=2'; |
|
3017 | 3017 | $result = Database::query($sql); |
3018 | 3018 | |
3019 | 3019 | while ($a_courses = Database::fetch_array($result)) { |
@@ -3023,7 +3023,7 @@ discard block |
||
3023 | 3023 | FROM $tbl_session_course_user AS srcru |
3024 | 3024 | WHERE |
3025 | 3025 | c_id = '$courseId' AND |
3026 | - session_id = '" . $id_session . "'"; |
|
3026 | + session_id = '".$id_session."'"; |
|
3027 | 3027 | $rs = Database::query($sql); |
3028 | 3028 | while ($row = Database::fetch_array($rs)) { |
3029 | 3029 | $students[$row['user_id']] = $row['user_id']; |
@@ -3031,15 +3031,15 @@ discard block |
||
3031 | 3031 | } |
3032 | 3032 | |
3033 | 3033 | // Then, courses where $coach_id is coach of the session |
3034 | - $sql = 'SELECT id_coach FROM ' . $tbl_session . ' |
|
3035 | - WHERE id="' . $id_session.'" AND id_coach="' . $coach_id . '"'; |
|
3034 | + $sql = 'SELECT id_coach FROM '.$tbl_session.' |
|
3035 | + WHERE id="' . $id_session.'" AND id_coach="'.$coach_id.'"'; |
|
3036 | 3036 | $result = Database::query($sql); |
3037 | 3037 | |
3038 | 3038 | //He is the session_coach so we select all the users in the session |
3039 | 3039 | if (Database::num_rows($result) > 0) { |
3040 | 3040 | $sql = 'SELECT DISTINCT srcru.user_id |
3041 | - FROM ' . $tbl_session_course_user . ' AS srcru |
|
3042 | - WHERE session_id="' . $id_session . '"'; |
|
3041 | + FROM ' . $tbl_session_course_user.' AS srcru |
|
3042 | + WHERE session_id="' . $id_session.'"'; |
|
3043 | 3043 | $result = Database::query($sql); |
3044 | 3044 | while ($row = Database::fetch_array($result)) { |
3045 | 3045 | $students[$row['user_id']] = $row['user_id']; |
@@ -3066,8 +3066,8 @@ discard block |
||
3066 | 3066 | |
3067 | 3067 | // At first, courses where $coach_id is coach of the course // |
3068 | 3068 | |
3069 | - $sql = 'SELECT 1 FROM ' . $tbl_session_course_user . ' |
|
3070 | - WHERE user_id=' . $coach_id .' AND status=2'; |
|
3069 | + $sql = 'SELECT 1 FROM '.$tbl_session_course_user.' |
|
3070 | + WHERE user_id=' . $coach_id.' AND status=2'; |
|
3071 | 3071 | $result = Database::query($sql); |
3072 | 3072 | if (Database::num_rows($result) > 0) { |
3073 | 3073 | return true; |
@@ -3075,12 +3075,12 @@ discard block |
||
3075 | 3075 | |
3076 | 3076 | // Then, courses where $coach_id is coach of the session |
3077 | 3077 | $sql = 'SELECT session_course_user.user_id |
3078 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
3079 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
3078 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
3079 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
3080 | 3080 | ON session_course.c_id = session_course_user.c_id |
3081 | - INNER JOIN ' . $tbl_session . ' as session |
|
3081 | + INNER JOIN ' . $tbl_session.' as session |
|
3082 | 3082 | ON session.id = session_course.session_id |
3083 | - AND session.id_coach = ' . $coach_id . ' |
|
3083 | + AND session.id_coach = ' . $coach_id.' |
|
3084 | 3084 | WHERE user_id = ' . $student_id; |
3085 | 3085 | $result = Database::query($sql); |
3086 | 3086 | if (Database::num_rows($result) > 0) { |
@@ -3112,16 +3112,16 @@ discard block |
||
3112 | 3112 | // At first, courses where $coach_id is coach of the course. |
3113 | 3113 | |
3114 | 3114 | $sql = 'SELECT DISTINCT c.code |
3115 | - FROM ' . $tbl_session_course_user . ' sc |
|
3115 | + FROM ' . $tbl_session_course_user.' sc |
|
3116 | 3116 | INNER JOIN '.$tbl_course.' c |
3117 | 3117 | ON (c.id = sc.c_id) |
3118 | 3118 | WHERE user_id = ' . $coach_id.' AND status = 2'; |
3119 | 3119 | |
3120 | 3120 | if (api_is_multiple_url_enabled()) { |
3121 | 3121 | $access_url_id = api_get_current_access_url_id(); |
3122 | - if ($access_url_id != -1){ |
|
3122 | + if ($access_url_id != -1) { |
|
3123 | 3123 | $sql = 'SELECT DISTINCT c.code |
3124 | - FROM ' . $tbl_session_course_user . ' scu |
|
3124 | + FROM ' . $tbl_session_course_user.' scu |
|
3125 | 3125 | INNER JOIN '.$tbl_course.' c |
3126 | 3126 | ON (c.code = scu.c_id) |
3127 | 3127 | INNER JOIN '.$tbl_course_rel_access_url.' cru |
@@ -3134,7 +3134,7 @@ discard block |
||
3134 | 3134 | } |
3135 | 3135 | |
3136 | 3136 | if (!empty($id_session)) { |
3137 | - $sql .= ' AND session_id=' . $id_session; |
|
3137 | + $sql .= ' AND session_id='.$id_session; |
|
3138 | 3138 | } |
3139 | 3139 | |
3140 | 3140 | $courseList = array(); |
@@ -3146,25 +3146,25 @@ discard block |
||
3146 | 3146 | // Then, courses where $coach_id is coach of the session |
3147 | 3147 | |
3148 | 3148 | $sql = 'SELECT DISTINCT course.code |
3149 | - FROM ' . $tbl_session_course . ' as session_course |
|
3150 | - INNER JOIN ' . $tbl_session . ' as session |
|
3149 | + FROM ' . $tbl_session_course.' as session_course |
|
3150 | + INNER JOIN ' . $tbl_session.' as session |
|
3151 | 3151 | ON session.id = session_course.session_id |
3152 | - AND session.id_coach = ' . $coach_id . ' |
|
3153 | - INNER JOIN ' . $tbl_course . ' as course |
|
3152 | + AND session.id_coach = ' . $coach_id.' |
|
3153 | + INNER JOIN ' . $tbl_course.' as course |
|
3154 | 3154 | ON course.id = session_course.c_id'; |
3155 | 3155 | |
3156 | 3156 | if (api_is_multiple_url_enabled()) { |
3157 | 3157 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
3158 | 3158 | $access_url_id = api_get_current_access_url_id(); |
3159 | - if ($access_url_id != -1){ |
|
3159 | + if ($access_url_id != -1) { |
|
3160 | 3160 | $sql = 'SELECT DISTINCT c.code |
3161 | - FROM ' . $tbl_session_course . ' as session_course |
|
3161 | + FROM ' . $tbl_session_course.' as session_course |
|
3162 | 3162 | INNER JOIN '.$tbl_course.' c |
3163 | 3163 | ON (c.id = session_course.c_id) |
3164 | - INNER JOIN ' . $tbl_session . ' as session |
|
3164 | + INNER JOIN ' . $tbl_session.' as session |
|
3165 | 3165 | ON session.id = session_course.session_id |
3166 | - AND session.id_coach = ' . $coach_id . ' |
|
3167 | - INNER JOIN ' . $tbl_course . ' as course |
|
3166 | + AND session.id_coach = ' . $coach_id.' |
|
3167 | + INNER JOIN ' . $tbl_course.' as course |
|
3168 | 3168 | ON course.id = session_course.c_id |
3169 | 3169 | INNER JOIN '.$tbl_course_rel_access_url.' course_rel_url |
3170 | 3170 | ON (course_rel_url.c_id = c.id)'; |
@@ -3172,12 +3172,12 @@ discard block |
||
3172 | 3172 | } |
3173 | 3173 | |
3174 | 3174 | if (!empty ($id_session)) { |
3175 | - $sql .= ' WHERE session_course.session_id=' . $id_session; |
|
3175 | + $sql .= ' WHERE session_course.session_id='.$id_session; |
|
3176 | 3176 | if (api_is_multiple_url_enabled()) |
3177 | - $sql .= ' AND access_url_id = '.$access_url_id; |
|
3178 | - } else { |
|
3177 | + $sql .= ' AND access_url_id = '.$access_url_id; |
|
3178 | + } else { |
|
3179 | 3179 | if (api_is_multiple_url_enabled()) |
3180 | - $sql .= ' WHERE access_url_id = '.$access_url_id; |
|
3180 | + $sql .= ' WHERE access_url_id = '.$access_url_id; |
|
3181 | 3181 | } |
3182 | 3182 | |
3183 | 3183 | $result = Database::query($sql); |
@@ -3233,7 +3233,7 @@ discard block |
||
3233 | 3233 | } |
3234 | 3234 | } |
3235 | 3235 | |
3236 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
3236 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
3237 | 3237 | $access_url_id = api_get_current_access_url_id(); |
3238 | 3238 | |
3239 | 3239 | $sql = " |
@@ -3353,7 +3353,7 @@ discard block |
||
3353 | 3353 | // table definition |
3354 | 3354 | $tbl_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
3355 | 3355 | $tbl_document = Database :: get_course_table(TABLE_DOCUMENT); |
3356 | - $course_id = $a_course['real_id']; |
|
3356 | + $course_id = $a_course['real_id']; |
|
3357 | 3357 | if (is_array($student_id)) { |
3358 | 3358 | $studentList = array_map('intval', $student_id); |
3359 | 3359 | $condition_user = " AND ip.insert_user_id IN ('".implode(',', $studentList)."') "; |
@@ -3404,7 +3404,7 @@ discard block |
||
3404 | 3404 | $a_course = CourseManager::get_course_information($course_code); |
3405 | 3405 | if (!empty($a_course)) { |
3406 | 3406 | $course_id = $a_course['real_id']; |
3407 | - $conditions[]= " ip.c_id = $course_id AND pub.c_id = $course_id "; |
|
3407 | + $conditions[] = " ip.c_id = $course_id AND pub.c_id = $course_id "; |
|
3408 | 3408 | } |
3409 | 3409 | |
3410 | 3410 | // table definition |
@@ -3413,14 +3413,14 @@ discard block |
||
3413 | 3413 | |
3414 | 3414 | if (is_array($student_id)) { |
3415 | 3415 | $studentList = array_map('intval', $student_id); |
3416 | - $conditions[]= " ip.insert_user_id IN ('".implode("','", $studentList)."') "; |
|
3416 | + $conditions[] = " ip.insert_user_id IN ('".implode("','", $studentList)."') "; |
|
3417 | 3417 | } else { |
3418 | 3418 | $student_id = intval($student_id); |
3419 | - $conditions[]= " ip.insert_user_id = '$student_id' "; |
|
3419 | + $conditions[] = " ip.insert_user_id = '$student_id' "; |
|
3420 | 3420 | } |
3421 | 3421 | if (isset($session_id)) { |
3422 | 3422 | $session_id = intval($session_id); |
3423 | - $conditions[]= " pub.session_id = $session_id "; |
|
3423 | + $conditions[] = " pub.session_id = $session_id "; |
|
3424 | 3424 | } |
3425 | 3425 | $conditionToString = implode('AND', $conditions); |
3426 | 3426 | |
@@ -3453,8 +3453,8 @@ discard block |
||
3453 | 3453 | $courseCondition = null; |
3454 | 3454 | $conditions = array(); |
3455 | 3455 | if (!empty($courseInfo)) { |
3456 | - $course_id = $courseInfo['real_id']; |
|
3457 | - $conditions[]= " post.c_id = $course_id AND forum.c_id = $course_id "; |
|
3456 | + $course_id = $courseInfo['real_id']; |
|
3457 | + $conditions[] = " post.c_id = $course_id AND forum.c_id = $course_id "; |
|
3458 | 3458 | } |
3459 | 3459 | |
3460 | 3460 | // Table definition. |
@@ -3463,15 +3463,15 @@ discard block |
||
3463 | 3463 | |
3464 | 3464 | if (is_array($student_id)) { |
3465 | 3465 | $studentList = array_map('intval', $student_id); |
3466 | - $conditions[]= " post.poster_id IN ('".implode("','", $studentList)."') "; |
|
3466 | + $conditions[] = " post.poster_id IN ('".implode("','", $studentList)."') "; |
|
3467 | 3467 | } else { |
3468 | 3468 | $student_id = intval($student_id); |
3469 | - $conditions[]= " post.poster_id = '$student_id' "; |
|
3469 | + $conditions[] = " post.poster_id = '$student_id' "; |
|
3470 | 3470 | } |
3471 | 3471 | |
3472 | 3472 | if (isset($session_id)) { |
3473 | 3473 | $session_id = intval($session_id); |
3474 | - $conditions[]= " forum.session_id = $session_id"; |
|
3474 | + $conditions[] = " forum.session_id = $session_id"; |
|
3475 | 3475 | } |
3476 | 3476 | |
3477 | 3477 | $conditionsToString = implode('AND ', $conditions); |
@@ -3506,7 +3506,7 @@ discard block |
||
3506 | 3506 | $condition_session = ''; |
3507 | 3507 | if (isset($session_id)) { |
3508 | 3508 | $session_id = intval($session_id); |
3509 | - $condition_session = api_get_session_condition($session_id, true, false, 'f.session_id'); |
|
3509 | + $condition_session = api_get_session_condition($session_id, true, false, 'f.session_id'); |
|
3510 | 3510 | } |
3511 | 3511 | |
3512 | 3512 | $course_id = $courseInfo['real_id']; |
@@ -3562,7 +3562,7 @@ discard block |
||
3562 | 3562 | $condition_session = ''; |
3563 | 3563 | if (isset($session_id)) { |
3564 | 3564 | $session_id = intval($session_id); |
3565 | - $condition_session = ' AND f.session_id = '. $session_id; |
|
3565 | + $condition_session = ' AND f.session_id = '.$session_id; |
|
3566 | 3566 | } |
3567 | 3567 | |
3568 | 3568 | $groupId = intval($groupId); |
@@ -3623,7 +3623,7 @@ discard block |
||
3623 | 3623 | $condition_session = ''; |
3624 | 3624 | if (isset($session_id)) { |
3625 | 3625 | $session_id = intval($session_id); |
3626 | - $condition_session = ' AND f.session_id = '. $session_id; |
|
3626 | + $condition_session = ' AND f.session_id = '.$session_id; |
|
3627 | 3627 | } |
3628 | 3628 | |
3629 | 3629 | $groupId = intval($groupId); |
@@ -3702,7 +3702,7 @@ discard block |
||
3702 | 3702 | { |
3703 | 3703 | $student_id = intval($student_id); |
3704 | 3704 | $courseId = intval($courseId); |
3705 | - $session_id = intval($session_id); |
|
3705 | + $session_id = intval($session_id); |
|
3706 | 3706 | $date_time = ''; |
3707 | 3707 | |
3708 | 3708 | // table definition |
@@ -3771,7 +3771,7 @@ discard block |
||
3771 | 3771 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
3772 | 3772 | |
3773 | 3773 | $sql = 'SELECT 1 |
3774 | - FROM ' . $table . ' |
|
3774 | + FROM ' . $table.' |
|
3775 | 3775 | WHERE down_user_id = '.$student_id.' |
3776 | 3776 | AND c_id = "'.$courseId.'" |
3777 | 3777 | AND down_session_id = '.$session_id.' '; |
@@ -3849,30 +3849,30 @@ discard block |
||
3849 | 3849 | '.$inner.' |
3850 | 3850 | WHERE c.id = '.$courseId.' |
3851 | 3851 | GROUP BY stats_login.user_id |
3852 | - HAVING DATE_SUB( "' . $now . '", INTERVAL '.$since.' DAY) > max_date '; |
|
3852 | + HAVING DATE_SUB( "' . $now.'", INTERVAL '.$since.' DAY) > max_date '; |
|
3853 | 3853 | |
3854 | 3854 | if ($since == 'never') { |
3855 | 3855 | if (empty($session_id)) { |
3856 | 3856 | $sql = 'SELECT course_user.user_id |
3857 | - FROM ' . $table_course_rel_user . ' course_user |
|
3858 | - LEFT JOIN ' . $tbl_track_login . ' stats_login |
|
3857 | + FROM ' . $table_course_rel_user.' course_user |
|
3858 | + LEFT JOIN ' . $tbl_track_login.' stats_login |
|
3859 | 3859 | ON course_user.user_id = stats_login.user_id AND |
3860 | - relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' |
|
3861 | - INNER JOIN ' . $tableCourse . ' c |
|
3860 | + relation_type<>' . COURSE_RELATION_TYPE_RRHH.' |
|
3861 | + INNER JOIN ' . $tableCourse.' c |
|
3862 | 3862 | ON (c.id = course_user.c_id) |
3863 | 3863 | WHERE |
3864 | - course_user.c_id = ' . $courseId . ' AND |
|
3864 | + course_user.c_id = ' . $courseId.' AND |
|
3865 | 3865 | stats_login.login_course_date IS NULL |
3866 | 3866 | GROUP BY course_user.user_id'; |
3867 | 3867 | } else { |
3868 | 3868 | $sql = 'SELECT session_course_user.user_id |
3869 | 3869 | FROM '.$tbl_session_course_user.' session_course_user |
3870 | - LEFT JOIN ' . $tbl_track_login . ' stats_login |
|
3870 | + LEFT JOIN ' . $tbl_track_login.' stats_login |
|
3871 | 3871 | ON session_course_user.user_id = stats_login.user_id |
3872 | - INNER JOIN ' . $tableCourse . ' c |
|
3872 | + INNER JOIN ' . $tableCourse.' c |
|
3873 | 3873 | ON (c.id = session_course_user.c_id) |
3874 | 3874 | WHERE |
3875 | - session_course_user.c_id = ' . $courseId . ' AND |
|
3875 | + session_course_user.c_id = ' . $courseId.' AND |
|
3876 | 3876 | stats_login.login_course_date IS NULL |
3877 | 3877 | GROUP BY session_course_user.user_id'; |
3878 | 3878 | |
@@ -3881,7 +3881,7 @@ discard block |
||
3881 | 3881 | |
3882 | 3882 | $rs = Database::query($sql); |
3883 | 3883 | $inactive_users = array(); |
3884 | - while($user = Database::fetch_array($rs)) { |
|
3884 | + while ($user = Database::fetch_array($rs)) { |
|
3885 | 3885 | $inactive_users[] = $user['user_id']; |
3886 | 3886 | } |
3887 | 3887 | |
@@ -3903,10 +3903,10 @@ discard block |
||
3903 | 3903 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
3904 | 3904 | |
3905 | 3905 | $sql = 'SELECT '.$student_id.' |
3906 | - FROM ' . $table . ' |
|
3906 | + FROM ' . $table.' |
|
3907 | 3907 | WHERE |
3908 | - access_user_id=' . $student_id . ' AND |
|
3909 | - c_id="' . $courseId . '" AND |
|
3908 | + access_user_id=' . $student_id.' AND |
|
3909 | + c_id="' . $courseId.'" AND |
|
3910 | 3910 | access_session_id = "'.$session_id.'" '; |
3911 | 3911 | |
3912 | 3912 | $rs = Database::query($sql); |
@@ -3924,13 +3924,13 @@ discard block |
||
3924 | 3924 | { |
3925 | 3925 | $hr_dept_id = intval($hr_dept_id); |
3926 | 3926 | $a_students = array(); |
3927 | - $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
3927 | + $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
3928 | 3928 | |
3929 | 3929 | $sql = 'SELECT DISTINCT user_id FROM '.$tbl_user.' as user |
3930 | 3930 | WHERE hr_dept_id='.$hr_dept_id; |
3931 | 3931 | $rs = Database::query($sql); |
3932 | 3932 | |
3933 | - while($user = Database :: fetch_array($rs)) { |
|
3933 | + while ($user = Database :: fetch_array($rs)) { |
|
3934 | 3934 | $a_students[$user['user_id']] = $user['user_id']; |
3935 | 3935 | } |
3936 | 3936 | |
@@ -3955,7 +3955,7 @@ discard block |
||
3955 | 3955 | $condition_session = ''; |
3956 | 3956 | if (isset($session_id)) { |
3957 | 3957 | $session_id = intval($session_id); |
3958 | - $condition_session = ' AND access_session_id = '. $session_id; |
|
3958 | + $condition_session = ' AND access_session_id = '.$session_id; |
|
3959 | 3959 | } |
3960 | 3960 | $sql = "SELECT |
3961 | 3961 | access_tool, |
@@ -4067,7 +4067,7 @@ discard block |
||
4067 | 4067 | if (!empty($date_from) && !empty($date_to)) { |
4068 | 4068 | $fieldStartDate = $fields['start_date']; |
4069 | 4069 | if (!isset($fields['end_date'])) { |
4070 | - $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to) ; |
|
4070 | + $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to); |
|
4071 | 4071 | } else { |
4072 | 4072 | $fieldEndDate = $fields['end_date']; |
4073 | 4073 | $where .= sprintf(" AND fieldStartDate >= '%s' |
@@ -4083,12 +4083,12 @@ discard block |
||
4083 | 4083 | $where |
4084 | 4084 | GROUP BY %s"; |
4085 | 4085 | $sql = sprintf($sql, |
4086 | - $fields['user'], //user field |
|
4087 | - $tableName, //FROM |
|
4088 | - $fields['course'], //course condition |
|
4089 | - $course['real_id'], //course condition |
|
4090 | - $fields['user'], //user condition |
|
4091 | - $userId, //user condition |
|
4086 | + $fields['user'], //user field |
|
4087 | + $tableName, //FROM |
|
4088 | + $fields['course'], //course condition |
|
4089 | + $course['real_id'], //course condition |
|
4090 | + $fields['user'], //user condition |
|
4091 | + $userId, //user condition |
|
4092 | 4092 | $fields['user'] //GROUP BY |
4093 | 4093 | ); |
4094 | 4094 | $rs = Database::query($sql); |
@@ -4096,7 +4096,7 @@ discard block |
||
4096 | 4096 | //iterate query |
4097 | 4097 | if (Database::num_rows($rs) > 0) { |
4098 | 4098 | while ($row = Database::fetch_array($rs)) { |
4099 | - $data[$row['user']] = (isset($data[$row['user']])) ? $data[$row['user']] + $row[total]: $row['total']; |
|
4099 | + $data[$row['user']] = (isset($data[$row['user']])) ? $data[$row['user']] + $row[total] : $row['total']; |
|
4100 | 4100 | } |
4101 | 4101 | } |
4102 | 4102 | } |
@@ -4119,11 +4119,11 @@ discard block |
||
4119 | 4119 | $courseId = api_get_course_int_id($course_code); |
4120 | 4120 | $data = array(); |
4121 | 4121 | |
4122 | - $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
|
4122 | + $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
|
4123 | 4123 | $condition_session = ''; |
4124 | 4124 | if (isset($session_id)) { |
4125 | 4125 | $session_id = intval($session_id); |
4126 | - $condition_session = ' AND down_session_id = '. $session_id; |
|
4126 | + $condition_session = ' AND down_session_id = '.$session_id; |
|
4127 | 4127 | } |
4128 | 4128 | $sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path) as count_down |
4129 | 4129 | FROM $TABLETRACK_DOWNLOADS |
@@ -4308,7 +4308,7 @@ discard block |
||
4308 | 4308 | |
4309 | 4309 | $final_course_data = array(); |
4310 | 4310 | |
4311 | - foreach($my_course_data as $course_id => $value) { |
|
4311 | + foreach ($my_course_data as $course_id => $value) { |
|
4312 | 4312 | $final_course_data[$course_id] = $course_list[$course_id]; |
4313 | 4313 | } |
4314 | 4314 | $course_in_session[$my_session_id]['course_list'] = $final_course_data; |
@@ -4329,7 +4329,7 @@ discard block |
||
4329 | 4329 | '.Display::tag('th', get_lang('Course'), array('width'=>'300px')).' |
4330 | 4330 | '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
4331 | 4331 | '.Display::tag('th', get_lang('Progress'), array('class'=>'head')).' |
4332 | - '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')),array('class'=>'head')).' |
|
4332 | + '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
4333 | 4333 | '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
4334 | 4334 | '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
4335 | 4335 | </tr>'; |
@@ -4416,7 +4416,7 @@ discard block |
||
4416 | 4416 | $all_exercise_start_time = array(); |
4417 | 4417 | |
4418 | 4418 | foreach ($course_in_session as $my_session_id => $session_data) { |
4419 | - $course_list = $session_data['course_list']; |
|
4419 | + $course_list = $session_data['course_list']; |
|
4420 | 4420 | $user_count = count(SessionManager::get_users_by_session($my_session_id)); |
4421 | 4421 | $exercise_graph_name_list = array(); |
4422 | 4422 | //$user_results = array(); |
@@ -4461,20 +4461,20 @@ discard block |
||
4461 | 4461 | |
4462 | 4462 | $score = 0; |
4463 | 4463 | if (!empty($user_result_data['exe_weighting']) && intval($user_result_data['exe_weighting']) != 0) { |
4464 | - $score = intval($user_result_data['exe_result']/$user_result_data['exe_weighting'] * 100); |
|
4464 | + $score = intval($user_result_data['exe_result'] / $user_result_data['exe_weighting'] * 100); |
|
4465 | 4465 | } |
4466 | 4466 | $time = api_strtotime($exercise_data['start_time']) ? api_strtotime($exercise_data['start_time'], 'UTC') : 0; |
4467 | 4467 | $all_exercise_start_time[] = $time; |
4468 | 4468 | $my_results[] = $score; |
4469 | - if (count($exercise_list)<=10) { |
|
4469 | + if (count($exercise_list) <= 10) { |
|
4470 | 4470 | $title = cut($course_data['title'], 30)." \n ".cut($exercise_data['title'], 30); |
4471 | - $exercise_graph_name_list[]= $title; |
|
4471 | + $exercise_graph_name_list[] = $title; |
|
4472 | 4472 | $all_exercise_graph_name_list[] = $title; |
4473 | 4473 | } else { |
4474 | 4474 | // if there are more than 10 results, space becomes difficult to find, so only show the title of the exercise, not the tool |
4475 | 4475 | $title = cut($exercise_data['title'], 30); |
4476 | - $exercise_graph_name_list[]= $title; |
|
4477 | - $all_exercise_graph_name_list[]= $title; |
|
4476 | + $exercise_graph_name_list[] = $title; |
|
4477 | + $all_exercise_graph_name_list[] = $title; |
|
4478 | 4478 | } |
4479 | 4479 | } |
4480 | 4480 | } |
@@ -4507,7 +4507,7 @@ discard block |
||
4507 | 4507 | } |
4508 | 4508 | |
4509 | 4509 | $html .= Display::page_subheader( |
4510 | - Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('Sessions') |
|
4510 | + Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL).' '.get_lang('Sessions') |
|
4511 | 4511 | ); |
4512 | 4512 | |
4513 | 4513 | $html .= '<table class="data_table" width="100%">'; |
@@ -4557,7 +4557,7 @@ discard block |
||
4557 | 4557 | $courseInfo['real_id'], |
4558 | 4558 | $my_session_id |
4559 | 4559 | ); |
4560 | - if ($attempts > 1) { |
|
4560 | + if ($attempts > 1) { |
|
4561 | 4561 | $answered_exercises++; |
4562 | 4562 | } |
4563 | 4563 | } |
@@ -4570,7 +4570,7 @@ discard block |
||
4570 | 4570 | $all_average += $average; |
4571 | 4571 | } |
4572 | 4572 | |
4573 | - $all_average = $all_average / count($course_list); |
|
4573 | + $all_average = $all_average / count($course_list); |
|
4574 | 4574 | |
4575 | 4575 | if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) { |
4576 | 4576 | $html .= '<tr style="background-color:#FBF09D">'; |
@@ -4595,31 +4595,31 @@ discard block |
||
4595 | 4595 | $html .= '</tr>'; |
4596 | 4596 | } |
4597 | 4597 | $html .= '</table><br />'; |
4598 | - $html .= Display::div($main_session_graph, array('id'=>'session_graph','class'=>'chart-session', 'style'=>'position:relative; text-align: center;') ); |
|
4598 | + $html .= Display::div($main_session_graph, array('id'=>'session_graph', 'class'=>'chart-session', 'style'=>'position:relative; text-align: center;')); |
|
4599 | 4599 | |
4600 | 4600 | // Checking selected session. |
4601 | 4601 | |
4602 | 4602 | if (isset($_GET['session_id'])) { |
4603 | 4603 | $session_id_from_get = intval($_GET['session_id']); |
4604 | - $session_data = $course_in_session[$session_id_from_get]; |
|
4605 | - $course_list = $session_data['course_list']; |
|
4604 | + $session_data = $course_in_session[$session_id_from_get]; |
|
4605 | + $course_list = $session_data['course_list']; |
|
4606 | 4606 | |
4607 | - $html .= Display::tag('h3',$session_data['name'].' - '.get_lang('CourseList')); |
|
4607 | + $html .= Display::tag('h3', $session_data['name'].' - '.get_lang('CourseList')); |
|
4608 | 4608 | |
4609 | 4609 | $html .= '<table class="data_table" width="100%">'; |
4610 | 4610 | //'.Display::tag('th', get_lang('DoneExercises'), array('class'=>'head')).' |
4611 | 4611 | $html .= ' |
4612 | 4612 | <tr> |
4613 | 4613 | <th width="300px">'.get_lang('Course').'</th> |
4614 | - '.Display::tag('th', get_lang('PublishedExercises'), array('class'=>'head')).' |
|
4615 | - '.Display::tag('th', get_lang('NewExercises'), array('class'=>'head')).' |
|
4616 | - '.Display::tag('th', get_lang('MyAverage'), array('class'=>'head')).' |
|
4617 | - '.Display::tag('th', get_lang('AverageExerciseResult'), array('class'=>'head')).' |
|
4618 | - '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
|
4619 | - '.Display::tag('th', get_lang('LPProgress') , array('class'=>'head')).' |
|
4620 | - '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
4621 | - '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
|
4622 | - '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
|
4614 | + '.Display::tag('th', get_lang('PublishedExercises'), array('class'=>'head')).' |
|
4615 | + '.Display::tag('th', get_lang('NewExercises'), array('class'=>'head')).' |
|
4616 | + '.Display::tag('th', get_lang('MyAverage'), array('class'=>'head')).' |
|
4617 | + '.Display::tag('th', get_lang('AverageExerciseResult'), array('class'=>'head')).' |
|
4618 | + '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
|
4619 | + '.Display::tag('th', get_lang('LPProgress'), array('class'=>'head')).' |
|
4620 | + '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
4621 | + '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
|
4622 | + '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
|
4623 | 4623 | </tr>'; |
4624 | 4624 | |
4625 | 4625 | foreach ($course_list as $course_data) { |
@@ -4635,14 +4635,14 @@ discard block |
||
4635 | 4635 | $count_exercises = count($exercises); |
4636 | 4636 | } |
4637 | 4637 | $answered_exercises = 0; |
4638 | - foreach($exercises as $exercise_item) { |
|
4638 | + foreach ($exercises as $exercise_item) { |
|
4639 | 4639 | $attempts = Event::count_exercise_attempts_by_user( |
4640 | 4640 | api_get_user_id(), |
4641 | 4641 | $exercise_item['id'], |
4642 | 4642 | $courseId, |
4643 | 4643 | $session_id_from_get |
4644 | 4644 | ); |
4645 | - if ($attempts > 1) { |
|
4645 | + if ($attempts > 1) { |
|
4646 | 4646 | $answered_exercises++; |
4647 | 4647 | } |
4648 | 4648 | } |
@@ -4651,7 +4651,7 @@ discard block |
||
4651 | 4651 | |
4652 | 4652 | // Average |
4653 | 4653 | $average = ExerciseLib::get_average_score_by_course($courseId, $session_id_from_get); |
4654 | - $my_average = ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get); |
|
4654 | + $my_average = ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get); |
|
4655 | 4655 | |
4656 | 4656 | $stats_array[$course_code] = array( |
4657 | 4657 | 'exercises' => $count_exercises, |
@@ -4721,11 +4721,11 @@ discard block |
||
4721 | 4721 | } |
4722 | 4722 | //Score |
4723 | 4723 | $html .= Display::tag('td', $percentage_score, array('align'=>'center')); |
4724 | - $html .= Display::tag('td', $last_connection, array('align'=>'center')); |
|
4724 | + $html .= Display::tag('td', $last_connection, array('align'=>'center')); |
|
4725 | 4725 | |
4726 | 4726 | if ($course_code == $courseCodeFromGet && $_GET['session_id'] == $session_id_from_get) { |
4727 | 4727 | $details = '<a href="#">'; |
4728 | - $details .=Display::return_icon('2rightarrow_na.png', get_lang('Details')); |
|
4728 | + $details .= Display::return_icon('2rightarrow_na.png', get_lang('Details')); |
|
4729 | 4729 | } else { |
4730 | 4730 | $details = '<a href="'.api_get_self().'?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'">'; |
4731 | 4731 | $details .= Display::return_icon('2rightarrow.png', get_lang('Details')); |
@@ -4848,7 +4848,7 @@ discard block |
||
4848 | 4848 | ); |
4849 | 4849 | |
4850 | 4850 | $latest_attempt_url = ''; |
4851 | - $best_score = $position = $percentage_score_result = '-'; |
|
4851 | + $best_score = $position = $percentage_score_result = '-'; |
|
4852 | 4852 | $graph = $normal_graph = null; |
4853 | 4853 | |
4854 | 4854 | // Getting best results |
@@ -4884,7 +4884,7 @@ discard block |
||
4884 | 4884 | $percentage_score_result = Display::url(ExerciseLib::show_score($score, $weighting), $latest_attempt_url); |
4885 | 4885 | $my_score = 0; |
4886 | 4886 | if (!empty($weighting) && intval($weighting) != 0) { |
4887 | - $my_score = $score/$weighting; |
|
4887 | + $my_score = $score / $weighting; |
|
4888 | 4888 | } |
4889 | 4889 | //@todo this function slows the page |
4890 | 4890 | $position = ExerciseLib::get_exercise_result_ranking($my_score, $exe_id, $exercices['id'], $course_info['code'], $session_id, $user_list); |
@@ -4895,14 +4895,14 @@ discard block |
||
4895 | 4895 | } |
4896 | 4896 | $html .= Display::div( |
4897 | 4897 | $normal_graph, |
4898 | - array('id'=>'main_graph_'.$exercices['id'],'class'=>'dialog', 'style'=>'display:none') |
|
4898 | + array('id'=>'main_graph_'.$exercices['id'], 'class'=>'dialog', 'style'=>'display:none') |
|
4899 | 4899 | ); |
4900 | 4900 | |
4901 | 4901 | if (empty($graph)) { |
4902 | 4902 | $graph = '-'; |
4903 | 4903 | } else { |
4904 | 4904 | $graph = Display::url( |
4905 | - '<img src="' . $graph . '" >', |
|
4905 | + '<img src="'.$graph.'" >', |
|
4906 | 4906 | $normal_graph, |
4907 | 4907 | array( |
4908 | 4908 | 'id' => $exercices['id'], |
@@ -4935,7 +4935,7 @@ discard block |
||
4935 | 4935 | |
4936 | 4936 | |
4937 | 4937 | // LP table results |
4938 | - $html .='<table class="data_table">'; |
|
4938 | + $html .= '<table class="data_table">'; |
|
4939 | 4939 | $html .= Display::tag('th', get_lang('Learnpaths'), array('class'=>'head', 'style'=>'color:#000')); |
4940 | 4940 | $html .= Display::tag('th', get_lang('LatencyTimeSpent'), array('class'=>'head', 'style'=>'color:#000')); |
4941 | 4941 | $html .= Display::tag('th', get_lang('Progress'), array('class'=>'head', 'style'=>'color:#000')); |
@@ -4989,7 +4989,7 @@ discard block |
||
4989 | 4989 | if (!empty($last_connection_in_lp)) { |
4990 | 4990 | $last_connection = api_convert_and_format_date($last_connection_in_lp, DATE_TIME_FORMAT_LONG); |
4991 | 4991 | } |
4992 | - $html .= Display::tag('td', $last_connection, array('align'=>'center','width'=>'180px')); |
|
4992 | + $html .= Display::tag('td', $last_connection, array('align'=>'center', 'width'=>'180px')); |
|
4993 | 4993 | $html .= "</tr>"; |
4994 | 4994 | } |
4995 | 4995 | } else { |
@@ -4999,7 +4999,7 @@ discard block |
||
4999 | 4999 | </td> |
5000 | 5000 | </tr>'; |
5001 | 5001 | } |
5002 | - $html .='</table>'; |
|
5002 | + $html .= '</table>'; |
|
5003 | 5003 | } |
5004 | 5004 | |
5005 | 5005 | return $html; |
@@ -5026,7 +5026,7 @@ discard block |
||
5026 | 5026 | $myData->setSerieDescription('Serie1', get_lang('MyResults')); |
5027 | 5027 | $myData->setSerieDescription('Serie2', get_lang('AverageScore')); |
5028 | 5028 | $myData->setAxisUnit(0, '%'); |
5029 | - $myData->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
5029 | + $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
5030 | 5030 | // Cache definition |
5031 | 5031 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
5032 | 5032 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
@@ -5034,9 +5034,9 @@ discard block |
||
5034 | 5034 | |
5035 | 5035 | if ($myCache->isInCache($chartHash)) { |
5036 | 5036 | //if we already created the img |
5037 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5037 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5038 | 5038 | $myCache->saveFromCache($chartHash, $imgPath); |
5039 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5039 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5040 | 5040 | } else { |
5041 | 5041 | /* Define width, height and angle */ |
5042 | 5042 | $mainWidth = 860; |
@@ -5065,7 +5065,7 @@ discard block |
||
5065 | 5065 | /* Set the default font */ |
5066 | 5066 | $myPicture->setFontProperties( |
5067 | 5067 | array( |
5068 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
5068 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
5069 | 5069 | 'FontSize' => 10) |
5070 | 5070 | ); |
5071 | 5071 | /* Write the chart title */ |
@@ -5082,7 +5082,7 @@ discard block |
||
5082 | 5082 | /* Set the default font */ |
5083 | 5083 | $myPicture->setFontProperties( |
5084 | 5084 | array( |
5085 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
5085 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
5086 | 5086 | 'FontSize' => 6 |
5087 | 5087 | ) |
5088 | 5088 | ); |
@@ -5124,7 +5124,7 @@ discard block |
||
5124 | 5124 | /* Draw the line chart */ |
5125 | 5125 | $myPicture->setFontProperties( |
5126 | 5126 | array( |
5127 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
5127 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
5128 | 5128 | 'FontSize' => 10 |
5129 | 5129 | ) |
5130 | 5130 | ); |
@@ -5157,12 +5157,12 @@ discard block |
||
5157 | 5157 | ); |
5158 | 5158 | |
5159 | 5159 | $myCache->writeToCache($chartHash, $myPicture); |
5160 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5160 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5161 | 5161 | $myCache->saveFromCache($chartHash, $imgPath); |
5162 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5162 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5163 | 5163 | } |
5164 | 5164 | |
5165 | - $html = '<img src="' . $imgPath . '">'; |
|
5165 | + $html = '<img src="'.$imgPath.'">'; |
|
5166 | 5166 | |
5167 | 5167 | return $html; |
5168 | 5168 | } |
@@ -5183,12 +5183,12 @@ discard block |
||
5183 | 5183 | |
5184 | 5184 | foreach ($attempts as $attempt) { |
5185 | 5185 | if (api_get_user_id() == $attempt['exe_user_id']) { |
5186 | - if ($attempt['exe_weighting'] != 0 ) { |
|
5187 | - $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
5186 | + if ($attempt['exe_weighting'] != 0) { |
|
5187 | + $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
5188 | 5188 | } |
5189 | 5189 | } else { |
5190 | - if ($attempt['exe_weighting'] != 0 ) { |
|
5191 | - $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
5190 | + if ($attempt['exe_weighting'] != 0) { |
|
5191 | + $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
5192 | 5192 | } |
5193 | 5193 | } |
5194 | 5194 | } |
@@ -5197,27 +5197,27 @@ discard block |
||
5197 | 5197 | rsort($my_exercise_result_array); |
5198 | 5198 | $my_exercise_result = 0; |
5199 | 5199 | if (isset($my_exercise_result_array[0])) { |
5200 | - $my_exercise_result = $my_exercise_result_array[0] *100; |
|
5200 | + $my_exercise_result = $my_exercise_result_array[0] * 100; |
|
5201 | 5201 | } |
5202 | 5202 | |
5203 | 5203 | $max = 100; |
5204 | - $pieces = 5 ; |
|
5204 | + $pieces = 5; |
|
5205 | 5205 | $part = round($max / $pieces); |
5206 | 5206 | $x_axis = array(); |
5207 | 5207 | $final_array = array(); |
5208 | 5208 | $my_final_array = array(); |
5209 | 5209 | |
5210 | - for ($i=1; $i <=$pieces; $i++) { |
|
5210 | + for ($i = 1; $i <= $pieces; $i++) { |
|
5211 | 5211 | $sum = 1; |
5212 | 5212 | if ($i == 1) { |
5213 | 5213 | $sum = 0; |
5214 | 5214 | } |
5215 | - $min = ($i-1)*$part + $sum; |
|
5216 | - $max = ($i)*$part; |
|
5217 | - $x_axis[]= $min." - ".$max; |
|
5215 | + $min = ($i - 1) * $part + $sum; |
|
5216 | + $max = ($i) * $part; |
|
5217 | + $x_axis[] = $min." - ".$max; |
|
5218 | 5218 | $count = 0; |
5219 | - foreach($exercise_result as $result) { |
|
5220 | - $percentage = $result*100; |
|
5219 | + foreach ($exercise_result as $result) { |
|
5220 | + $percentage = $result * 100; |
|
5221 | 5221 | //echo $percentage.' - '.$min.' - '.$max."<br />"; |
5222 | 5222 | if ($percentage >= $min && $percentage <= $max) { |
5223 | 5223 | //echo ' is > '; |
@@ -5225,7 +5225,7 @@ discard block |
||
5225 | 5225 | } |
5226 | 5226 | } |
5227 | 5227 | //echo '<br />'; |
5228 | - $final_array[]= $count; |
|
5228 | + $final_array[] = $count; |
|
5229 | 5229 | |
5230 | 5230 | if ($my_exercise_result >= $min && $my_exercise_result <= $max) { |
5231 | 5231 | $my_final_array[] = 1; |
@@ -5235,9 +5235,9 @@ discard block |
||
5235 | 5235 | } |
5236 | 5236 | |
5237 | 5237 | //Fix to remove the data of the user with my data |
5238 | - for($i = 0; $i<=count($my_final_array); $i++) { |
|
5238 | + for ($i = 0; $i <= count($my_final_array); $i++) { |
|
5239 | 5239 | if (!empty($my_final_array[$i])) { |
5240 | - $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
5240 | + $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
5241 | 5241 | $final_array[$i] = 0; |
5242 | 5242 | } |
5243 | 5243 | } |
@@ -5247,16 +5247,16 @@ discard block |
||
5247 | 5247 | $dataSet->addPoints($final_array, 'Serie1'); |
5248 | 5248 | $dataSet->addPoints($my_final_array, 'Serie2'); |
5249 | 5249 | $dataSet->normalize(100, "%"); |
5250 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
5250 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
5251 | 5251 | |
5252 | 5252 | // Cache definition |
5253 | 5253 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
5254 | 5254 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
5255 | 5255 | $chartHash = $myCache->getHash($dataSet); |
5256 | 5256 | if ($myCache->isInCache($chartHash)) { |
5257 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5257 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5258 | 5258 | $myCache->saveFromCache($chartHash, $imgPath); |
5259 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5259 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5260 | 5260 | } else { |
5261 | 5261 | /* Create the pChart object */ |
5262 | 5262 | $widthSize = 80; |
@@ -5272,7 +5272,7 @@ discard block |
||
5272 | 5272 | $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); |
5273 | 5273 | |
5274 | 5274 | /* Set the default font */ |
5275 | - $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize)); |
|
5275 | + $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize)); |
|
5276 | 5276 | |
5277 | 5277 | /* Do not write the chart title */ |
5278 | 5278 | |
@@ -5336,9 +5336,9 @@ discard block |
||
5336 | 5336 | |
5337 | 5337 | /* Save and write in cache */ |
5338 | 5338 | $myCache->writeToCache($chartHash, $myPicture); |
5339 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5339 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5340 | 5340 | $myCache->saveFromCache($chartHash, $imgPath); |
5341 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5341 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5342 | 5342 | } |
5343 | 5343 | |
5344 | 5344 | return $imgPath; |
@@ -5358,12 +5358,12 @@ discard block |
||
5358 | 5358 | } |
5359 | 5359 | foreach ($attempts as $attempt) { |
5360 | 5360 | if (api_get_user_id() == $attempt['exe_user_id']) { |
5361 | - if ($attempt['exe_weighting'] != 0 ) { |
|
5362 | - $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
5361 | + if ($attempt['exe_weighting'] != 0) { |
|
5362 | + $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
5363 | 5363 | } |
5364 | 5364 | } else { |
5365 | - if ($attempt['exe_weighting'] != 0 ) { |
|
5366 | - $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
5365 | + if ($attempt['exe_weighting'] != 0) { |
|
5366 | + $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
5367 | 5367 | } |
5368 | 5368 | } |
5369 | 5369 | } |
@@ -5372,32 +5372,32 @@ discard block |
||
5372 | 5372 | rsort($my_exercise_result_array); |
5373 | 5373 | $my_exercise_result = 0; |
5374 | 5374 | if (isset($my_exercise_result_array[0])) { |
5375 | - $my_exercise_result = $my_exercise_result_array[0] *100; |
|
5375 | + $my_exercise_result = $my_exercise_result_array[0] * 100; |
|
5376 | 5376 | } |
5377 | 5377 | |
5378 | 5378 | $max = 100; |
5379 | - $pieces = 5 ; |
|
5379 | + $pieces = 5; |
|
5380 | 5380 | $part = round($max / $pieces); |
5381 | 5381 | $x_axis = array(); |
5382 | 5382 | $final_array = array(); |
5383 | 5383 | $my_final_array = array(); |
5384 | 5384 | |
5385 | - for ($i=1; $i <=$pieces; $i++) { |
|
5385 | + for ($i = 1; $i <= $pieces; $i++) { |
|
5386 | 5386 | $sum = 1; |
5387 | 5387 | if ($i == 1) { |
5388 | 5388 | $sum = 0; |
5389 | 5389 | } |
5390 | - $min = ($i-1)*$part + $sum; |
|
5391 | - $max = ($i)*$part; |
|
5392 | - $x_axis[]= $min." - ".$max; |
|
5390 | + $min = ($i - 1) * $part + $sum; |
|
5391 | + $max = ($i) * $part; |
|
5392 | + $x_axis[] = $min." - ".$max; |
|
5393 | 5393 | $count = 0; |
5394 | - foreach($exercise_result as $result) { |
|
5395 | - $percentage = $result*100; |
|
5394 | + foreach ($exercise_result as $result) { |
|
5395 | + $percentage = $result * 100; |
|
5396 | 5396 | if ($percentage >= $min && $percentage <= $max) { |
5397 | 5397 | $count++; |
5398 | 5398 | } |
5399 | 5399 | } |
5400 | - $final_array[]= $count; |
|
5400 | + $final_array[] = $count; |
|
5401 | 5401 | |
5402 | 5402 | if ($my_exercise_result >= $min && $my_exercise_result <= $max) { |
5403 | 5403 | $my_final_array[] = 1; |
@@ -5408,9 +5408,9 @@ discard block |
||
5408 | 5408 | |
5409 | 5409 | //Fix to remove the data of the user with my data |
5410 | 5410 | |
5411 | - for($i = 0; $i<=count($my_final_array); $i++) { |
|
5411 | + for ($i = 0; $i <= count($my_final_array); $i++) { |
|
5412 | 5412 | if (!empty($my_final_array[$i])) { |
5413 | - $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
5413 | + $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
5414 | 5414 | $final_array[$i] = 0; |
5415 | 5415 | } |
5416 | 5416 | } |
@@ -5428,7 +5428,7 @@ discard block |
||
5428 | 5428 | $dataSet->setXAxisName(get_lang('Score')); |
5429 | 5429 | $dataSet->normalize(100, "%"); |
5430 | 5430 | |
5431 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
5431 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
5432 | 5432 | |
5433 | 5433 | // Cache definition |
5434 | 5434 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
@@ -5436,9 +5436,9 @@ discard block |
||
5436 | 5436 | $chartHash = $myCache->getHash($dataSet); |
5437 | 5437 | |
5438 | 5438 | if ($myCache->isInCache($chartHash)) { |
5439 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5439 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5440 | 5440 | $myCache->saveFromCache($chartHash, $imgPath); |
5441 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5441 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5442 | 5442 | } else { |
5443 | 5443 | /* Create the pChart object */ |
5444 | 5444 | $widthSize = 480; |
@@ -5454,7 +5454,7 @@ discard block |
||
5454 | 5454 | $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); |
5455 | 5455 | |
5456 | 5456 | /* Set the default font */ |
5457 | - $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
5457 | + $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
5458 | 5458 | |
5459 | 5459 | /* Write the chart title */ |
5460 | 5460 | $myPicture->drawText( |
@@ -5513,9 +5513,9 @@ discard block |
||
5513 | 5513 | |
5514 | 5514 | /* Write and save into cache */ |
5515 | 5515 | $myCache->writeToCache($chartHash, $myPicture); |
5516 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
5516 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
5517 | 5517 | $myCache->saveFromCache($chartHash, $imgPath); |
5518 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
5518 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
5519 | 5519 | } |
5520 | 5520 | |
5521 | 5521 | return $imgPath; |
@@ -5641,7 +5641,7 @@ discard block |
||
5641 | 5641 | $whereSessionParams .= $sessionIdx.','; |
5642 | 5642 | } |
5643 | 5643 | } |
5644 | - $whereSessionParams = substr($whereSessionParams,0,-1); |
|
5644 | + $whereSessionParams = substr($whereSessionParams, 0, -1); |
|
5645 | 5645 | } |
5646 | 5646 | |
5647 | 5647 | if (!empty($exerciseId)) { |
@@ -5702,7 +5702,7 @@ discard block |
||
5702 | 5702 | qq.position = rq.question_order AND |
5703 | 5703 | ta.question_id = rq.question_id |
5704 | 5704 | WHERE |
5705 | - te.c_id = $courseIdx ".(empty($whereSessionParams)?'':"AND te.session_id IN ($whereSessionParams)")." |
|
5705 | + te.c_id = $courseIdx ".(empty($whereSessionParams) ? '' : "AND te.session_id IN ($whereSessionParams)")." |
|
5706 | 5706 | AND q.c_id = $courseIdx |
5707 | 5707 | $where $order $limit"; |
5708 | 5708 | $sql_query = vsprintf($sql, $whereParams); |
@@ -5750,7 +5750,7 @@ discard block |
||
5750 | 5750 | // Now fill users data |
5751 | 5751 | $sqlUsers = "SELECT user_id, username, lastname, firstname |
5752 | 5752 | FROM $tuser |
5753 | - WHERE user_id IN (".implode(',',$userIds).")"; |
|
5753 | + WHERE user_id IN (".implode(',', $userIds).")"; |
|
5754 | 5754 | $resUsers = Database::query($sqlUsers); |
5755 | 5755 | while ($rowUser = Database::fetch_assoc($resUsers)) { |
5756 | 5756 | $users[$rowUser['user_id']] = $rowUser; |
@@ -5846,7 +5846,7 @@ discard block |
||
5846 | 5846 | WHERE |
5847 | 5847 | track_resource.c_id = $course_id AND |
5848 | 5848 | track_resource.insert_user_id = user.user_id AND |
5849 | - session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
5849 | + session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
5850 | 5850 | |
5851 | 5851 | if (isset($_GET['keyword'])) { |
5852 | 5852 | $keyword = Database::escape_string(trim($_GET['keyword'])); |
@@ -5904,7 +5904,7 @@ discard block |
||
5904 | 5904 | WHERE |
5905 | 5905 | track_resource.c_id = $course_id AND |
5906 | 5906 | track_resource.insert_user_id = user.user_id AND |
5907 | - session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
5907 | + session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
5908 | 5908 | |
5909 | 5909 | if (isset($_GET['keyword'])) { |
5910 | 5910 | $keyword = Database::escape_string(trim($_GET['keyword'])); |
@@ -6198,7 +6198,7 @@ discard block |
||
6198 | 6198 | public static function display_additional_profile_fields() |
6199 | 6199 | { |
6200 | 6200 | // getting all the extra profile fields that are defined by the platform administrator |
6201 | - $extra_fields = UserManager :: get_extra_fields(0,50,5,'ASC'); |
|
6201 | + $extra_fields = UserManager :: get_extra_fields(0, 50, 5, 'ASC'); |
|
6202 | 6202 | |
6203 | 6203 | // creating the form |
6204 | 6204 | $return = '<form action="courseLog.php" method="get" name="additional_profile_field_form" id="additional_profile_field_form">'; |
@@ -6210,8 +6210,8 @@ discard block |
||
6210 | 6210 | $extra_fields_to_show = 0; |
6211 | 6211 | foreach ($extra_fields as $key=>$field) { |
6212 | 6212 | // show only extra fields that are visible + and can be filtered, added by J.Montoya |
6213 | - if ($field[6]==1 && $field[8] == 1) { |
|
6214 | - if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field'] ) { |
|
6213 | + if ($field[6] == 1 && $field[8] == 1) { |
|
6214 | + if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field']) { |
|
6215 | 6215 | $selected = 'selected="selected"'; |
6216 | 6216 | } else { |
6217 | 6217 | $selected = ''; |
@@ -6223,8 +6223,8 @@ discard block |
||
6223 | 6223 | $return .= '</select>'; |
6224 | 6224 | |
6225 | 6225 | // the form elements for the $_GET parameters (because the form is passed through GET |
6226 | - foreach ($_GET as $key=>$value){ |
|
6227 | - if ($key <> 'additional_profile_field') { |
|
6226 | + foreach ($_GET as $key=>$value) { |
|
6227 | + if ($key <> 'additional_profile_field') { |
|
6228 | 6228 | $return .= '<input type="hidden" name="'.Security::remove_XSS($key).'" value="'.Security::remove_XSS($value).'" />'; |
6229 | 6229 | } |
6230 | 6230 | } |
@@ -6261,21 +6261,21 @@ discard block |
||
6261 | 6261 | $result_extra_field = UserManager::get_extra_field_information($field_id); |
6262 | 6262 | |
6263 | 6263 | if (!empty($users)) { |
6264 | - if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG ) { |
|
6265 | - foreach($users as $user_id) { |
|
6264 | + if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG) { |
|
6265 | + foreach ($users as $user_id) { |
|
6266 | 6266 | $user_result = UserManager::get_user_tags($user_id, $field_id); |
6267 | 6267 | $tag_list = array(); |
6268 | - foreach($user_result as $item) { |
|
6268 | + foreach ($user_result as $item) { |
|
6269 | 6269 | $tag_list[] = $item['tag']; |
6270 | 6270 | } |
6271 | - $return[$user_id][] = implode(', ',$tag_list); |
|
6271 | + $return[$user_id][] = implode(', ', $tag_list); |
|
6272 | 6272 | } |
6273 | 6273 | } else { |
6274 | 6274 | $new_user_array = array(); |
6275 | 6275 | foreach ($users as $user_id) { |
6276 | - $new_user_array[]= "'".$user_id."'"; |
|
6276 | + $new_user_array[] = "'".$user_id."'"; |
|
6277 | 6277 | } |
6278 | - $users = implode(',',$new_user_array); |
|
6278 | + $users = implode(',', $new_user_array); |
|
6279 | 6279 | $extraFieldType = EntityExtraField::USER_FIELD_TYPE; |
6280 | 6280 | // Selecting only the necessary information NOT ALL the user list |
6281 | 6281 | $sql = "SELECT user.user_id, v.value |
@@ -6290,7 +6290,7 @@ discard block |
||
6290 | 6290 | user.user_id IN ($users)"; |
6291 | 6291 | |
6292 | 6292 | $result = Database::query($sql); |
6293 | - while($row = Database::fetch_array($result)) { |
|
6293 | + while ($row = Database::fetch_array($result)) { |
|
6294 | 6294 | // get option value for field type double select by id |
6295 | 6295 | if (!empty($row['value'])) { |
6296 | 6296 | if ($result_extra_field['field_type'] == |
@@ -6329,7 +6329,7 @@ discard block |
||
6329 | 6329 | |
6330 | 6330 | public function sort_users_desc($a, $b) |
6331 | 6331 | { |
6332 | - return strcmp( trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']]))); |
|
6332 | + return strcmp(trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']]))); |
|
6333 | 6333 | } |
6334 | 6334 | |
6335 | 6335 | /** |
@@ -6364,7 +6364,7 @@ discard block |
||
6364 | 6364 | // get all users data from a course for sortable with limit |
6365 | 6365 | if (is_array($user_ids)) { |
6366 | 6366 | $user_ids = array_map('intval', $user_ids); |
6367 | - $condition_user = " WHERE user.user_id IN (".implode(',',$user_ids).") "; |
|
6367 | + $condition_user = " WHERE user.user_id IN (".implode(',', $user_ids).") "; |
|
6368 | 6368 | } else { |
6369 | 6369 | $user_ids = intval($user_ids); |
6370 | 6370 | $condition_user = " WHERE user.user_id = $user_ids "; |
@@ -6372,7 +6372,7 @@ discard block |
||
6372 | 6372 | |
6373 | 6373 | if (!empty($_GET['user_keyword'])) { |
6374 | 6374 | $keyword = trim(Database::escape_string($_GET['user_keyword'])); |
6375 | - $condition_user .= " AND ( |
|
6375 | + $condition_user .= " AND ( |
|
6376 | 6376 | user.firstname LIKE '%".$keyword."%' OR |
6377 | 6377 | user.lastname LIKE '%".$keyword."%' OR |
6378 | 6378 | user.username LIKE '%".$keyword."%' OR |
@@ -6390,7 +6390,7 @@ discard block |
||
6390 | 6390 | $invitedUsersCondition = ''; |
6391 | 6391 | |
6392 | 6392 | if (!$includeInvitedUsers) { |
6393 | - $invitedUsersCondition = " AND user.status != " . INVITEE; |
|
6393 | + $invitedUsersCondition = " AND user.status != ".INVITEE; |
|
6394 | 6394 | } |
6395 | 6395 | |
6396 | 6396 | $sql = "SELECT user.user_id as user_id, |
@@ -6401,7 +6401,7 @@ discard block |
||
6401 | 6401 | FROM $tbl_user as user $url_table |
6402 | 6402 | $condition_user $url_condition $invitedUsersCondition"; |
6403 | 6403 | |
6404 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
6404 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
6405 | 6405 | $direction = 'ASC'; |
6406 | 6406 | } |
6407 | 6407 | |
@@ -6538,7 +6538,7 @@ discard block |
||
6538 | 6538 | } |
6539 | 6539 | |
6540 | 6540 | if (empty($session_id)) { |
6541 | - $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0) .' / '.$total_surveys; |
|
6541 | + $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0).' / '.$total_surveys; |
|
6542 | 6542 | } |
6543 | 6543 | |
6544 | 6544 | $user['link'] = '<center> |
@@ -6550,37 +6550,37 @@ discard block |
||
6550 | 6550 | // store columns in array $users |
6551 | 6551 | $is_western_name_order = api_is_western_name_order(); |
6552 | 6552 | $user_row = array(); |
6553 | - $user_row[]= $user['official_code']; //0 |
|
6553 | + $user_row[] = $user['official_code']; //0 |
|
6554 | 6554 | if ($is_western_name_order) { |
6555 | - $user_row[]= $user['firstname']; |
|
6556 | - $user_row[]= $user['lastname']; |
|
6555 | + $user_row[] = $user['firstname']; |
|
6556 | + $user_row[] = $user['lastname']; |
|
6557 | 6557 | } else { |
6558 | - $user_row[]= $user['lastname']; |
|
6559 | - $user_row[]= $user['firstname']; |
|
6558 | + $user_row[] = $user['lastname']; |
|
6559 | + $user_row[] = $user['firstname']; |
|
6560 | 6560 | } |
6561 | - $user_row[]= $user['username']; |
|
6562 | - $user_row[]= $user['time']; |
|
6563 | - $user_row[]= $user['average_progress']; |
|
6564 | - $user_row[]= $user['exercise_progress']; |
|
6565 | - $user_row[]= $user['exercise_average_best_attempt']; |
|
6566 | - $user_row[]= $user['student_score']; |
|
6567 | - $user_row[]= $user['count_assignments']; |
|
6568 | - $user_row[]= $user['count_messages']; |
|
6561 | + $user_row[] = $user['username']; |
|
6562 | + $user_row[] = $user['time']; |
|
6563 | + $user_row[] = $user['average_progress']; |
|
6564 | + $user_row[] = $user['exercise_progress']; |
|
6565 | + $user_row[] = $user['exercise_average_best_attempt']; |
|
6566 | + $user_row[] = $user['student_score']; |
|
6567 | + $user_row[] = $user['count_assignments']; |
|
6568 | + $user_row[] = $user['count_messages']; |
|
6569 | 6569 | |
6570 | 6570 | $userGroupManager = new UserGroup(); |
6571 | 6571 | $user_row[] = $userGroupManager->getLabelsFromNameList($user['user_id'], UserGroup::NORMAL_CLASS); |
6572 | 6572 | |
6573 | 6573 | if (empty($session_id)) { |
6574 | - $user_row[]= $user['survey']; |
|
6574 | + $user_row[] = $user['survey']; |
|
6575 | 6575 | } |
6576 | 6576 | |
6577 | - $user_row[]= $user['first_connection']; |
|
6578 | - $user_row[]= $user['last_connection']; |
|
6577 | + $user_row[] = $user['first_connection']; |
|
6578 | + $user_row[] = $user['last_connection']; |
|
6579 | 6579 | if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) { |
6580 | - $user_row[]= $user['additional']; |
|
6580 | + $user_row[] = $user['additional']; |
|
6581 | 6581 | } |
6582 | 6582 | |
6583 | - $user_row[]= $user['link']; |
|
6583 | + $user_row[] = $user['link']; |
|
6584 | 6584 | |
6585 | 6585 | $users[] = $user_row; |
6586 | 6586 | |
@@ -6625,8 +6625,8 @@ discard block |
||
6625 | 6625 | |
6626 | 6626 | $track_access_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
6627 | 6627 | $tempView = $view; |
6628 | - if(substr($view,0,1) == '1') { |
|
6629 | - $new_view = substr_replace($view,'0',0,1); |
|
6628 | + if (substr($view, 0, 1) == '1') { |
|
6629 | + $new_view = substr_replace($view, '0', 0, 1); |
|
6630 | 6630 | echo " |
6631 | 6631 | <tr> |
6632 | 6632 | <td valign='top'> |
@@ -6659,9 +6659,9 @@ discard block |
||
6659 | 6659 | </tr>"; |
6660 | 6660 | $total = 0; |
6661 | 6661 | if (is_array($results)) { |
6662 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
6662 | + for ($j = 0; $j < count($results); $j++) { |
|
6663 | 6663 | echo "<tr>"; |
6664 | - echo "<td class='content'><a href='logins_details.php?uInfo=".$user_id."&reqdate=".$results[$j][0]."&view=".Security::remove_XSS($view)."'>".$MonthsLong[date('n', $results[$j][0])-1].' '.date('Y', $results[$j][0])."</a></td>"; |
|
6664 | + echo "<td class='content'><a href='logins_details.php?uInfo=".$user_id."&reqdate=".$results[$j][0]."&view=".Security::remove_XSS($view)."'>".$MonthsLong[date('n', $results[$j][0]) - 1].' '.date('Y', $results[$j][0])."</a></td>"; |
|
6665 | 6665 | echo "<td valign='top' align='right' class='content'>".$results[$j][1]."</td>"; |
6666 | 6666 | echo"</tr>"; |
6667 | 6667 | $total = $total + $results[$j][1]; |
@@ -6678,7 +6678,7 @@ discard block |
||
6678 | 6678 | echo "</table>"; |
6679 | 6679 | echo "</td></tr>"; |
6680 | 6680 | } else { |
6681 | - $new_view = substr_replace($view,'1',0,1); |
|
6681 | + $new_view = substr_replace($view, '1', 0, 1); |
|
6682 | 6682 | echo " |
6683 | 6683 | <tr> |
6684 | 6684 | <td valign='top'> |
@@ -6701,8 +6701,8 @@ discard block |
||
6701 | 6701 | { |
6702 | 6702 | global $TBL_TRACK_HOTPOTATOES, $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $dateTimeFormatLong; |
6703 | 6703 | $courseId = api_get_course_int_id($courseCode); |
6704 | - if(substr($view,1,1) == '1') { |
|
6705 | - $new_view = substr_replace($view,'0',1,1); |
|
6704 | + if (substr($view, 1, 1) == '1') { |
|
6705 | + $new_view = substr_replace($view, '0', 1, 1); |
|
6706 | 6706 | echo "<tr> |
6707 | 6707 | <td valign='top'> |
6708 | 6708 | <font color='#0000FF'>- </font><b>".get_lang('ExercicesResults')."</b> [<a href='".api_get_self()."?uInfo=".Security::remove_XSS($user_id)."&view=".Security::remove_XSS($new_view)."'>".get_lang('Close')."</a>] [<a href='userLogCSV.php?".api_get_cidreq()."&uInfo=".Security::remove_XSS($_GET['uInfo'])."&view=01000'>".get_lang('ExportAsCSV')."</a>] |
@@ -6744,7 +6744,7 @@ discard block |
||
6744 | 6744 | </tr>"; |
6745 | 6745 | |
6746 | 6746 | if (is_array($results)) { |
6747 | - for($i = 0; $i < sizeof($results); $i++) { |
|
6747 | + for ($i = 0; $i < sizeof($results); $i++) { |
|
6748 | 6748 | $display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get()); |
6749 | 6749 | echo "<tr>\n"; |
6750 | 6750 | echo "<td class='content'>".$results[$i][0]."</td>\n"; |
@@ -6759,8 +6759,8 @@ discard block |
||
6759 | 6759 | |
6760 | 6760 | // The Result of Tests |
6761 | 6761 | if (is_array($hpresults)) { |
6762 | - for($i = 0; $i < sizeof($hpresults); $i++) { |
|
6763 | - $title = GetQuizName($hpresults[$i][0],''); |
|
6762 | + for ($i = 0; $i < sizeof($hpresults); $i++) { |
|
6763 | + $title = GetQuizName($hpresults[$i][0], ''); |
|
6764 | 6764 | if ($title == '') |
6765 | 6765 | $title = basename($hpresults[$i][0]); |
6766 | 6766 | $display_date = api_convert_and_format_date($hpresults[$i][3], null, date_default_timezone_get()); |
@@ -6786,7 +6786,7 @@ discard block |
||
6786 | 6786 | echo "</table>"; |
6787 | 6787 | echo "</td>\n</tr>\n"; |
6788 | 6788 | } else { |
6789 | - $new_view = substr_replace($view,'1',1,1); |
|
6789 | + $new_view = substr_replace($view, '1', 1, 1); |
|
6790 | 6790 | echo " |
6791 | 6791 | <tr> |
6792 | 6792 | <td valign='top'> |
@@ -6805,8 +6805,8 @@ discard block |
||
6805 | 6805 | global $TABLETRACK_UPLOADS, $TABLECOURSE_WORK; |
6806 | 6806 | $_course = api_get_course_info_by_id($course_id); |
6807 | 6807 | |
6808 | - if (substr($view,2,1) == '1') { |
|
6809 | - $new_view = substr_replace($view,'0',2,1); |
|
6808 | + if (substr($view, 2, 1) == '1') { |
|
6809 | + $new_view = substr_replace($view, '0', 2, 1); |
|
6810 | 6810 | echo "<tr> |
6811 | 6811 | <td valign='top'> |
6812 | 6812 | <font color='#0000FF'>- </font><b>".get_lang('WorkUploads')."</b> [<a href='".api_get_self()."?uInfo=".Security::remove_XSS($user_id)."&view=".Security::remove_XSS($new_view)."'>".get_lang('Close')."</a>] [<a href='userLogCSV.php?".api_get_cidreq()."&uInfo=".Security::remove_XSS($_GET['uInfo'])."&view=00100'>".get_lang('ExportAsCSV')."</a>] |
@@ -6820,7 +6820,7 @@ discard block |
||
6820 | 6820 | AND u.c_id = '".intval($course_id)."' |
6821 | 6821 | ORDER BY u.upload_date DESC"; |
6822 | 6822 | echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>"; |
6823 | - $results = StatsUtils::getManyResultsXCol($sql,4); |
|
6823 | + $results = StatsUtils::getManyResultsXCol($sql, 4); |
|
6824 | 6824 | echo "<table cellpadding='2' cellspacing='1' border='0' align=center>"; |
6825 | 6825 | echo "<tr> |
6826 | 6826 | <td class='secLine' width='40%'> |
@@ -6834,7 +6834,7 @@ discard block |
||
6834 | 6834 | </td> |
6835 | 6835 | </tr>"; |
6836 | 6836 | if (is_array($results)) { |
6837 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
6837 | + for ($j = 0; $j < count($results); $j++) { |
|
6838 | 6838 | $pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3]; |
6839 | 6839 | $beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get()); |
6840 | 6840 | echo "<tr>"; |
@@ -6853,7 +6853,7 @@ discard block |
||
6853 | 6853 | echo "</table>"; |
6854 | 6854 | echo "</td></tr>"; |
6855 | 6855 | } else { |
6856 | - $new_view = substr_replace($view,'1',2,1); |
|
6856 | + $new_view = substr_replace($view, '1', 2, 1); |
|
6857 | 6857 | echo " |
6858 | 6858 | <tr> |
6859 | 6859 | <td valign='top'> |
@@ -6872,8 +6872,8 @@ discard block |
||
6872 | 6872 | { |
6873 | 6873 | global $TABLETRACK_LINKS, $TABLECOURSE_LINKS; |
6874 | 6874 | $courseId = api_get_course_int_id($courseCode); |
6875 | - if (substr($view,3,1) == '1') { |
|
6876 | - $new_view = substr_replace($view,'0',3,1); |
|
6875 | + if (substr($view, 3, 1) == '1') { |
|
6876 | + $new_view = substr_replace($view, '0', 3, 1); |
|
6877 | 6877 | echo " |
6878 | 6878 | <tr> |
6879 | 6879 | <td valign='top'> |
@@ -6897,7 +6897,7 @@ discard block |
||
6897 | 6897 | </td> |
6898 | 6898 | </tr>"; |
6899 | 6899 | if (is_array($results)) { |
6900 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
6900 | + for ($j = 0; $j < count($results); $j++) { |
|
6901 | 6901 | echo "<tr>"; |
6902 | 6902 | echo "<td class='content'><a href='".$results[$j][1]."'>".$results[$j][0]."</a></td>"; |
6903 | 6903 | echo"</tr>"; |
@@ -6910,7 +6910,7 @@ discard block |
||
6910 | 6910 | echo "</table>"; |
6911 | 6911 | echo "</td></tr>"; |
6912 | 6912 | } else { |
6913 | - $new_view = substr_replace($view,'1',3,1); |
|
6913 | + $new_view = substr_replace($view, '1', 3, 1); |
|
6914 | 6914 | echo " |
6915 | 6915 | <tr> |
6916 | 6916 | <td valign='top'> |
@@ -6937,8 +6937,8 @@ discard block |
||
6937 | 6937 | $session_id = intval($session_id); |
6938 | 6938 | |
6939 | 6939 | $downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
6940 | - if(substr($view,4,1) == '1') { |
|
6941 | - $new_view = substr_replace($view,'0',4,1); |
|
6940 | + if (substr($view, 4, 1) == '1') { |
|
6941 | + $new_view = substr_replace($view, '0', 4, 1); |
|
6942 | 6942 | echo " |
6943 | 6943 | <tr> |
6944 | 6944 | <td valign='top'> |
@@ -6964,7 +6964,7 @@ discard block |
||
6964 | 6964 | </td> |
6965 | 6965 | </tr>"; |
6966 | 6966 | if (is_array($results)) { |
6967 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
6967 | + for ($j = 0; $j < count($results); $j++) { |
|
6968 | 6968 | echo "<tr>"; |
6969 | 6969 | echo "<td class='content'>".$results[$j]."</td>"; |
6970 | 6970 | echo"</tr>"; |
@@ -6977,7 +6977,7 @@ discard block |
||
6977 | 6977 | echo "</table>"; |
6978 | 6978 | echo "</td></tr>"; |
6979 | 6979 | } else { |
6980 | - $new_view = substr_replace($view,'1',4,1); |
|
6980 | + $new_view = substr_replace($view, '1', 4, 1); |
|
6981 | 6981 | echo " |
6982 | 6982 | <tr> |
6983 | 6983 | <td valign='top'> |
@@ -7011,11 +7011,11 @@ discard block |
||
7011 | 7011 | ORDER BY login_date DESC LIMIT 1"; |
7012 | 7012 | $ip = ''; |
7013 | 7013 | $res_ip = Database::query($sql_ip); |
7014 | - if ($res_ip !== false && Database::num_rows($res_ip)>0) { |
|
7014 | + if ($res_ip !== false && Database::num_rows($res_ip) > 0) { |
|
7015 | 7015 | $row_ip = Database::fetch_row($res_ip); |
7016 | 7016 | if ($return_as_link) { |
7017 | 7017 | $ip = Display::url( |
7018 | - (empty($body_replace)?$row_ip[1]:$body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], |
|
7018 | + (empty($body_replace) ? $row_ip[1] : $body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], |
|
7019 | 7019 | array('title'=>get_lang('TraceIP'), 'target'=>'_blank') |
7020 | 7020 | ); |
7021 | 7021 | } else { |
@@ -7051,9 +7051,9 @@ discard block |
||
7051 | 7051 | $course_id = intval($course_id); |
7052 | 7052 | |
7053 | 7053 | $tempView = $view; |
7054 | - if (substr($view,0,1) == '1') { |
|
7055 | - $new_view = substr_replace($view,'0',0,1); |
|
7056 | - $title[1]= get_lang('LoginsAndAccessTools').get_lang('LoginsDetails'); |
|
7054 | + if (substr($view, 0, 1) == '1') { |
|
7055 | + $new_view = substr_replace($view, '0', 0, 1); |
|
7056 | + $title[1] = get_lang('LoginsAndAccessTools').get_lang('LoginsDetails'); |
|
7057 | 7057 | $sql = "SELECT UNIX_TIMESTAMP(access_date), count(access_date) |
7058 | 7058 | FROM $track_access_table |
7059 | 7059 | WHERE access_user_id = $user_id |
@@ -7063,20 +7063,20 @@ discard block |
||
7063 | 7063 | ORDER BY YEAR(access_date),MONTH(access_date) ASC"; |
7064 | 7064 | //$results = getManyResults2Col($sql); |
7065 | 7065 | $results = getManyResults3Col($sql); |
7066 | - $title_line= get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n"; |
|
7067 | - $line=''; |
|
7066 | + $title_line = get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n"; |
|
7067 | + $line = ''; |
|
7068 | 7068 | $total = 0; |
7069 | 7069 | if (is_array($results)) { |
7070 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
7070 | + for ($j = 0; $j < count($results); $j++) { |
|
7071 | 7071 | $line .= $results[$j][0].';'.$results[$j][1]."\n"; |
7072 | 7072 | $total = $total + $results[$j][1]; |
7073 | 7073 | } |
7074 | 7074 | $line .= get_lang('Total').";".$total."\n"; |
7075 | 7075 | } else { |
7076 | - $line= get_lang('NoResult')."</center></td>"; |
|
7076 | + $line = get_lang('NoResult')."</center></td>"; |
|
7077 | 7077 | } |
7078 | 7078 | } else { |
7079 | - $new_view = substr_replace($view,'1',0,1); |
|
7079 | + $new_view = substr_replace($view, '1', 0, 1); |
|
7080 | 7080 | } |
7081 | 7081 | return array($title_line, $line); |
7082 | 7082 | } |
@@ -7094,8 +7094,8 @@ discard block |
||
7094 | 7094 | global $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $TABLETRACK_HOTPOTATOES, $dateTimeFormatLong; |
7095 | 7095 | $courseId = api_get_course_int_id($courseCode); |
7096 | 7096 | $userId = intval($userId); |
7097 | - if (substr($view,1,1) == '1') { |
|
7098 | - $new_view = substr_replace($view,'0',1,1); |
|
7097 | + if (substr($view, 1, 1) == '1') { |
|
7098 | + $new_view = substr_replace($view, '0', 1, 1); |
|
7099 | 7099 | $title[1] = get_lang('ExercicesDetails'); |
7100 | 7100 | $line = ''; |
7101 | 7101 | $sql = "SELECT ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date) |
@@ -7119,7 +7119,7 @@ discard block |
||
7119 | 7119 | $title_line = get_lang('ExercicesTitleExerciceColumn').";".get_lang('Date').';'.get_lang('ExercicesTitleScoreColumn')."\n"; |
7120 | 7120 | |
7121 | 7121 | if (is_array($results)) { |
7122 | - for($i = 0; $i < sizeof($results); $i++) |
|
7122 | + for ($i = 0; $i < sizeof($results); $i++) |
|
7123 | 7123 | { |
7124 | 7124 | $display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get()); |
7125 | 7125 | $line .= $results[$i][0].";".$display_date.";".$results[$i][1]." / ".$results[$i][2]."\n"; |
@@ -7131,8 +7131,8 @@ discard block |
||
7131 | 7131 | |
7132 | 7132 | // The Result of Tests |
7133 | 7133 | if (is_array($hpresults)) { |
7134 | - for($i = 0; $i < sizeof($hpresults); $i++) { |
|
7135 | - $title = GetQuizName($hpresults[$i][0],''); |
|
7134 | + for ($i = 0; $i < sizeof($hpresults); $i++) { |
|
7135 | + $title = GetQuizName($hpresults[$i][0], ''); |
|
7136 | 7136 | |
7137 | 7137 | if ($title == '') |
7138 | 7138 | $title = basename($hpresults[$i][0]); |
@@ -7146,10 +7146,10 @@ discard block |
||
7146 | 7146 | } |
7147 | 7147 | |
7148 | 7148 | if ($NoTestRes == 1 && $NoHPTestRes == 1) { |
7149 | - $line=get_lang('NoResult'); |
|
7149 | + $line = get_lang('NoResult'); |
|
7150 | 7150 | } |
7151 | 7151 | } else { |
7152 | - $new_view = substr_replace($view,'1',1,1); |
|
7152 | + $new_view = substr_replace($view, '1', 1, 1); |
|
7153 | 7153 | } |
7154 | 7154 | return array($title_line, $line); |
7155 | 7155 | } |
@@ -7165,7 +7165,7 @@ discard block |
||
7165 | 7165 | $user_id = intval($user_id); |
7166 | 7166 | $course_id = intval($course_id); |
7167 | 7167 | |
7168 | - if (substr($view,2,1) == '1') { |
|
7168 | + if (substr($view, 2, 1) == '1') { |
|
7169 | 7169 | $sql = "SELECT u.upload_date, w.title, w.author, w.url |
7170 | 7170 | FROM $TABLETRACK_UPLOADS u , $TABLECOURSE_WORK w |
7171 | 7171 | WHERE |
@@ -7173,21 +7173,21 @@ discard block |
||
7173 | 7173 | u.upload_user_id = '$user_id' AND |
7174 | 7174 | u.c_id = '$course_id' |
7175 | 7175 | ORDER BY u.upload_date DESC"; |
7176 | - $results = StatsUtils::getManyResultsXCol($sql,4); |
|
7176 | + $results = StatsUtils::getManyResultsXCol($sql, 4); |
|
7177 | 7177 | |
7178 | - $title[1]=get_lang('WorksDetails'); |
|
7179 | - $line=''; |
|
7180 | - $title_line=get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n"; |
|
7178 | + $title[1] = get_lang('WorksDetails'); |
|
7179 | + $line = ''; |
|
7180 | + $title_line = get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n"; |
|
7181 | 7181 | |
7182 | 7182 | if (is_array($results)) { |
7183 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
7183 | + for ($j = 0; $j < count($results); $j++) { |
|
7184 | 7184 | $pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3]; |
7185 | 7185 | $beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get()); |
7186 | 7186 | $line .= $results[$j][1].";".$results[$j][2].";".$beautifulDate."\n"; |
7187 | 7187 | } |
7188 | 7188 | |
7189 | 7189 | } else { |
7190 | - $line= get_lang('NoResult'); |
|
7190 | + $line = get_lang('NoResult'); |
|
7191 | 7191 | } |
7192 | 7192 | } |
7193 | 7193 | return array($title_line, $line); |
@@ -7203,9 +7203,9 @@ discard block |
||
7203 | 7203 | $courseId = api_get_course_int_id($courseCode); |
7204 | 7204 | $userId = intval($userId); |
7205 | 7205 | $line = null; |
7206 | - if (substr($view,3,1) == '1') { |
|
7207 | - $new_view = substr_replace($view,'0',3,1); |
|
7208 | - $title[1]=get_lang('LinksDetails'); |
|
7206 | + if (substr($view, 3, 1) == '1') { |
|
7207 | + $new_view = substr_replace($view, '0', 3, 1); |
|
7208 | + $title[1] = get_lang('LinksDetails'); |
|
7209 | 7209 | $sql = "SELECT cl.title, cl.url |
7210 | 7210 | FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl |
7211 | 7211 | WHERE sl.links_link_id = cl.id |
@@ -7213,16 +7213,16 @@ discard block |
||
7213 | 7213 | AND sl.links_user_id = $userId |
7214 | 7214 | GROUP BY cl.title, cl.url"; |
7215 | 7215 | $results = StatsUtils::getManyResults2Col($sql); |
7216 | - $title_line= get_lang('LinksTitleLinkColumn')."\n"; |
|
7216 | + $title_line = get_lang('LinksTitleLinkColumn')."\n"; |
|
7217 | 7217 | if (is_array($results)) { |
7218 | - for ($j = 0 ; $j < count($results) ; $j++) { |
|
7218 | + for ($j = 0; $j < count($results); $j++) { |
|
7219 | 7219 | $line .= $results[$j][0]."\n"; |
7220 | 7220 | } |
7221 | 7221 | } else { |
7222 | - $line=get_lang('NoResult'); |
|
7222 | + $line = get_lang('NoResult'); |
|
7223 | 7223 | } |
7224 | 7224 | } else { |
7225 | - $new_view = substr_replace($view,'1',3,1); |
|
7225 | + $new_view = substr_replace($view, '1', 3, 1); |
|
7226 | 7226 | } |
7227 | 7227 | return array($title_line, $line); |
7228 | 7228 | } |
@@ -7244,9 +7244,9 @@ discard block |
||
7244 | 7244 | |
7245 | 7245 | $downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
7246 | 7246 | |
7247 | - if (substr($view,4,1) == '1') { |
|
7248 | - $new_view = substr_replace($view,'0',4,1); |
|
7249 | - $title[1]= get_lang('DocumentsDetails'); |
|
7247 | + if (substr($view, 4, 1) == '1') { |
|
7248 | + $new_view = substr_replace($view, '0', 4, 1); |
|
7249 | + $title[1] = get_lang('DocumentsDetails'); |
|
7250 | 7250 | |
7251 | 7251 | $sql = "SELECT down_doc_path |
7252 | 7252 | FROM $downloads_table |
@@ -7259,14 +7259,14 @@ discard block |
||
7259 | 7259 | $title_line = get_lang('DocumentsTitleDocumentColumn')."\n"; |
7260 | 7260 | $line = null; |
7261 | 7261 | if (is_array($results)) { |
7262 | - for ($j = 0 ; $j < count($results) ; $j++) { |
|
7262 | + for ($j = 0; $j < count($results); $j++) { |
|
7263 | 7263 | $line .= $results[$j]."\n"; |
7264 | 7264 | } |
7265 | 7265 | } else { |
7266 | 7266 | $line = get_lang('NoResult'); |
7267 | 7267 | } |
7268 | 7268 | } else { |
7269 | - $new_view = substr_replace($view,'1',4,1); |
|
7269 | + $new_view = substr_replace($view, '1', 4, 1); |
|
7270 | 7270 | } |
7271 | 7271 | return array($title_line, $line); |
7272 | 7272 | } |