@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $extendedAttempt = null, |
| 112 | 112 | $extendedAll = null, |
| 113 | 113 | $type = 'classic', |
| 114 | - $allowExtend = true |
|
| 114 | + $allowExtend = true |
|
| 115 | 115 | ) { |
| 116 | 116 | if (empty($courseInfo) || empty($lp_id)) { |
| 117 | 117 | return null; |
@@ -135,22 +135,22 @@ discard block |
||
| 135 | 135 | $extend_all = 0; |
| 136 | 136 | |
| 137 | 137 | if ($origin == 'tracking') { |
| 138 | - $url_suffix = '&session_id=' . $session_id . '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . $lp_id . '&origin=' . $origin; |
|
| 138 | + $url_suffix = '&session_id='.$session_id.'&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.$lp_id.'&origin='.$origin; |
|
| 139 | 139 | } else { |
| 140 | - $url_suffix = '&lp_id=' . $lp_id; |
|
| 140 | + $url_suffix = '&lp_id='.$lp_id; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if (!empty($extendedAll)) { |
| 144 | 144 | $extend_all_link = Display::url( |
| 145 | 145 | Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')), |
| 146 | - api_get_self() . '?action=stats' . $url_suffix |
|
| 146 | + api_get_self().'?action=stats'.$url_suffix |
|
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | $extend_all = 1; |
| 150 | 150 | } else { |
| 151 | 151 | $extend_all_link = Display::url( |
| 152 | 152 | Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttempts')), |
| 153 | - api_get_self() . '?action=stats&extend_all=1' . $url_suffix |
|
| 153 | + api_get_self().'?action=stats&extend_all=1'.$url_suffix |
|
| 154 | 154 | ); |
| 155 | 155 | } |
| 156 | 156 | |
@@ -162,24 +162,24 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $actionColumn = null; |
| 164 | 164 | if ($type == 'classic') { |
| 165 | - $actionColumn = ' <th>' . get_lang('Actions') . '</th>'; |
|
| 165 | + $actionColumn = ' <th>'.get_lang('Actions').'</th>'; |
|
| 166 | 166 | } |
| 167 | 167 | $output .= '<div class="table-responsive">'; |
| 168 | 168 | $output .= '<table class="table tracking"> |
| 169 | 169 | <thead> |
| 170 | 170 | <tr class="table-header"> |
| 171 | - <th width="16">' . ($allowExtend == true ? $extend_all_link : ' ') . '</th> |
|
| 171 | + <th width="16">' . ($allowExtend == true ? $extend_all_link : ' ').'</th> |
|
| 172 | 172 | <th colspan="4"> |
| 173 | - ' . get_lang('ScormLessonTitle') .' |
|
| 173 | + ' . get_lang('ScormLessonTitle').' |
|
| 174 | 174 | </th> |
| 175 | 175 | <th colspan="2"> |
| 176 | - ' . get_lang('ScormStatus') . ' |
|
| 176 | + ' . get_lang('ScormStatus').' |
|
| 177 | 177 | </th> |
| 178 | 178 | <th colspan="2"> |
| 179 | - ' . get_lang('ScormScore') . ' |
|
| 179 | + ' . get_lang('ScormScore').' |
|
| 180 | 180 | </th> |
| 181 | 181 | <th colspan="2"> |
| 182 | - ' . get_lang('ScormTime') . ' |
|
| 182 | + ' . get_lang('ScormTime').' |
|
| 183 | 183 | </th> |
| 184 | 184 | '.$actionColumn.' |
| 185 | 185 | </tr> |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | // Prepare statement to go through each attempt. |
| 243 | 243 | $viewCondition = null; |
| 244 | 244 | if (!empty($view)) { |
| 245 | - $viewCondition = " AND v.view_count = $view "; |
|
| 245 | + $viewCondition = " AND v.view_count = $view "; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | $sql = "SELECT |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | FROM $TBL_QUIZ |
| 291 | 291 | WHERE |
| 292 | 292 | c_id = $course_id AND |
| 293 | - id ='" . $my_path . "'"; |
|
| 293 | + id ='".$my_path."'"; |
|
| 294 | 294 | $res_result_disabled = Database::query($sql); |
| 295 | 295 | $row_result_disabled = Database::fetch_row($res_result_disabled); |
| 296 | 296 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | if (!empty($inter_num)) { |
| 313 | 313 | $extend_link = Display::url( |
| 314 | 314 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
| 315 | - api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix |
|
| 315 | + api_get_self().'?action=stats&fold_id='.$my_item_id.$url_suffix |
|
| 316 | 316 | ); |
| 317 | 317 | } |
| 318 | 318 | $title = $row['mytitle']; |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $action = null; |
| 332 | 332 | if ($type == 'classic') { |
| 333 | - $action = '<td></td>'; |
|
| 333 | + $action = '<td></td>'; |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | if (in_array($row['item_type'], $chapterTypes)) { |
@@ -374,13 +374,13 @@ discard block |
||
| 374 | 374 | $extend_this_attempt = 1; |
| 375 | 375 | $extend_attempt_link = Display::url( |
| 376 | 376 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
| 377 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix |
|
| 377 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix |
|
| 378 | 378 | ); |
| 379 | 379 | } else { // Same case if fold_attempt_id is set, so not implemented explicitly. |
| 380 | 380 | // The extend button for this attempt has not been clicked. |
| 381 | 381 | $extend_attempt_link = Display::url( |
| 382 | 382 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
| 383 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
| 383 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
| 384 | 384 | ); |
| 385 | 385 | } |
| 386 | 386 | } |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | // Remove "NaN" if any (@todo: locate the source of these NaN) |
| 416 | - $time = str_replace('NaN', '00' . $h . '00\'00"', $time); |
|
| 416 | + $time = str_replace('NaN', '00'.$h.'00\'00"', $time); |
|
| 417 | 417 | |
| 418 | 418 | if ($row['item_type'] != 'dokeos_chapter') { |
| 419 | 419 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
@@ -441,13 +441,13 @@ discard block |
||
| 441 | 441 | $action = '<td></td>'; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $output .= '<tr class="' . $oddclass . '"> |
|
| 444 | + $output .= '<tr class="'.$oddclass.'"> |
|
| 445 | 445 | <td></td> |
| 446 | - <td>' . $extend_attempt_link . '</td> |
|
| 447 | - <td colspan="3">' . get_lang('Attempt') . ' ' . $attemptCount . '</td> |
|
| 448 | - <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type) . '</td> |
|
| 449 | - <td colspan="2">' . $view_score . '</td> |
|
| 450 | - <td colspan="2">' . $time . '</td> |
|
| 446 | + <td>' . $extend_attempt_link.'</td> |
|
| 447 | + <td colspan="3">' . get_lang('Attempt').' '.$attemptCount.'</td> |
|
| 448 | + <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type).'</td> |
|
| 449 | + <td colspan="2">' . $view_score.'</td> |
|
| 450 | + <td colspan="2">' . $time.'</td> |
|
| 451 | 451 | '.$action.' |
| 452 | 452 | </tr>'; |
| 453 | 453 | $attemptCount++; |
@@ -460,10 +460,10 @@ discard block |
||
| 460 | 460 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
| 461 | 461 | $temp[] = '/'; |
| 462 | 462 | } else { |
| 463 | - $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
| 463 | + $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
| 464 | 464 | } |
| 465 | 465 | } else { |
| 466 | - $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
| 466 | + $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
| 467 | 467 | } |
| 468 | 468 | $temp[] = $time; |
| 469 | 469 | $csv_content[] = $temp; |
@@ -500,13 +500,13 @@ discard block |
||
| 500 | 500 | <td></td> |
| 501 | 501 | <td></td> |
| 502 | 502 | <td></td> |
| 503 | - <td>'.$interaction['order_id'] . '</td> |
|
| 504 | - <td>'.$interaction['id'] . '</td> |
|
| 503 | + <td>'.$interaction['order_id'].'</td> |
|
| 504 | + <td>'.$interaction['id'].'</td> |
|
| 505 | 505 | <td colspan="2">' . $interaction['type'].'</td> |
| 506 | - <td>'.$student_response . '</td> |
|
| 507 | - <td>'.$interaction['result'] . '</td> |
|
| 508 | - <td>'.$interaction['latency'] . '</td> |
|
| 509 | - <td>'.$interaction['time'] . '</td> |
|
| 506 | + <td>'.$student_response.'</td> |
|
| 507 | + <td>'.$interaction['result'].'</td> |
|
| 508 | + <td>'.$interaction['latency'].'</td> |
|
| 509 | + <td>'.$interaction['time'].'</td> |
|
| 510 | 510 | '.$action.' |
| 511 | 511 | </tr>'; |
| 512 | 512 | $counter++; |
@@ -523,12 +523,12 @@ discard block |
||
| 523 | 523 | <td></td> |
| 524 | 524 | <td></td> |
| 525 | 525 | <td></td> |
| 526 | - <td>' . $interaction['order_id'] . '</td> |
|
| 527 | - <td colspan="2">' . $interaction['objective_id'] . '</td> |
|
| 528 | - <td colspan="2">' . $interaction['status'] .'</td> |
|
| 529 | - <td>' . $interaction['score_raw'] . '</td> |
|
| 530 | - <td>' . $interaction['score_max'] . '</td> |
|
| 531 | - <td>' . $interaction['score_min'] . '</td> |
|
| 526 | + <td>' . $interaction['order_id'].'</td> |
|
| 527 | + <td colspan="2">' . $interaction['objective_id'].'</td> |
|
| 528 | + <td colspan="2">' . $interaction['status'].'</td> |
|
| 529 | + <td>' . $interaction['score_raw'].'</td> |
|
| 530 | + <td>' . $interaction['score_max'].'</td> |
|
| 531 | + <td>' . $interaction['score_min'].'</td> |
|
| 532 | 532 | '.$action.' |
| 533 | 533 | </tr>'; |
| 534 | 534 | $counter++; |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | $my_path = Database::escape_string($my_path); |
| 552 | 552 | $sql = "SELECT results_disabled |
| 553 | 553 | FROM $TBL_QUIZ |
| 554 | - WHERE c_id = $course_id AND id ='" . $my_path . "'"; |
|
| 554 | + WHERE c_id = $course_id AND id ='".$my_path."'"; |
|
| 555 | 555 | $res_result_disabled = Database::query($sql); |
| 556 | 556 | $row_result_disabled = Database::fetch_row($res_result_disabled); |
| 557 | 557 | |
@@ -575,14 +575,14 @@ discard block |
||
| 575 | 575 | $extend_this_attempt = 1; |
| 576 | 576 | $extend_attempt_link = Display::url( |
| 577 | 577 | Display::return_icon('visible.gif', get_lang('HideAttemptView')), |
| 578 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix |
|
| 578 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix |
|
| 579 | 579 | ); |
| 580 | 580 | } else { |
| 581 | 581 | // Same case if fold_attempt_id is set, so not implemented explicitly. |
| 582 | 582 | // The extend button for this attempt has not been clicked. |
| 583 | 583 | $extend_attempt_link = Display::url( |
| 584 | 584 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
| 585 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
| 585 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
| 586 | 586 | ); |
| 587 | 587 | } |
| 588 | 588 | } |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | if ($inter_num > 1) { |
| 598 | 598 | $extend_link = Display::url( |
| 599 | 599 | Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), |
| 600 | - api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix |
|
| 600 | + api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix |
|
| 601 | 601 | ); |
| 602 | 602 | } |
| 603 | 603 | |
@@ -613,15 +613,15 @@ discard block |
||
| 613 | 613 | |
| 614 | 614 | // Selecting the exe_id from stats attempts tables in order to look the max score value. |
| 615 | 615 | |
| 616 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
| 616 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
| 617 | 617 | WHERE |
| 618 | - exe_exo_id="' . $row['path'] . '" AND |
|
| 619 | - exe_user_id="' . $user_id . '" AND |
|
| 620 | - orig_lp_id = "' . $lp_id . '" AND |
|
| 621 | - orig_lp_item_id = "' . $row['myid'] . '" AND |
|
| 622 | - c_id = ' . $course_id . ' AND |
|
| 618 | + exe_exo_id="' . $row['path'].'" AND |
|
| 619 | + exe_user_id="' . $user_id.'" AND |
|
| 620 | + orig_lp_id = "' . $lp_id.'" AND |
|
| 621 | + orig_lp_item_id = "' . $row['myid'].'" AND |
|
| 622 | + c_id = ' . $course_id.' AND |
|
| 623 | 623 | status <> "incomplete" AND |
| 624 | - session_id = ' . $session_id . ' |
|
| 624 | + session_id = ' . $session_id.' |
|
| 625 | 625 | ORDER BY exe_date DESC |
| 626 | 626 | LIMIT 1'; |
| 627 | 627 | |
@@ -652,8 +652,8 @@ discard block |
||
| 652 | 652 | FROM $TBL_LP_ITEM_VIEW |
| 653 | 653 | WHERE |
| 654 | 654 | c_id = $course_id AND |
| 655 | - lp_item_id = '" . (int) $my_id . "' AND |
|
| 656 | - lp_view_id = '" . (int) $my_lp_view_id . "' |
|
| 655 | + lp_item_id = '".(int) $my_id."' AND |
|
| 656 | + lp_view_id = '" . (int) $my_lp_view_id."' |
|
| 657 | 657 | ORDER BY view_count DESC limit 1"; |
| 658 | 658 | $res_score = Database::query($sql); |
| 659 | 659 | $row_score = Database::fetch_array($res_score); |
@@ -662,8 +662,8 @@ discard block |
||
| 662 | 662 | FROM $TBL_LP_ITEM_VIEW |
| 663 | 663 | WHERE |
| 664 | 664 | c_id = $course_id AND |
| 665 | - lp_item_id = '" . (int) $my_id . "' AND |
|
| 666 | - lp_view_id = '" . (int) $my_lp_view_id . "'"; |
|
| 665 | + lp_item_id = '".(int) $my_id."' AND |
|
| 666 | + lp_view_id = '" . (int) $my_lp_view_id."'"; |
|
| 667 | 667 | $res_time = Database::query($sql); |
| 668 | 668 | $row_time = Database::fetch_array($res_time); |
| 669 | 669 | |
@@ -722,16 +722,16 @@ discard block |
||
| 722 | 722 | } else { |
| 723 | 723 | $correct_test_link = '-'; |
| 724 | 724 | if ($row['item_type'] == 'quiz') { |
| 725 | - $my_url_suffix = '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . intval($row['mylpid']) . '&origin=' . $origin; |
|
| 726 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
| 725 | + $my_url_suffix = '&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.intval($row['mylpid']).'&origin='.$origin; |
|
| 726 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
| 727 | 727 | WHERE |
| 728 | - exe_exo_id="' . $row['path'] . '" AND |
|
| 729 | - exe_user_id="' . $user_id . '" AND |
|
| 730 | - orig_lp_id = "' . $lp_id . '" AND |
|
| 731 | - orig_lp_item_id = "' . $row['myid'] . '" AND |
|
| 732 | - c_id = ' . $course_id . ' AND |
|
| 728 | + exe_exo_id="' . $row['path'].'" AND |
|
| 729 | + exe_user_id="' . $user_id.'" AND |
|
| 730 | + orig_lp_id = "' . $lp_id.'" AND |
|
| 731 | + orig_lp_item_id = "' . $row['myid'].'" AND |
|
| 732 | + c_id = ' . $course_id.' AND |
|
| 733 | 733 | status <> "incomplete" AND |
| 734 | - session_id = ' . $session_id . ' |
|
| 734 | + session_id = ' . $session_id.' |
|
| 735 | 735 | ORDER BY exe_date DESC '; |
| 736 | 736 | |
| 737 | 737 | $resultLastAttempt = Database::query($sql); |
@@ -743,12 +743,12 @@ discard block |
||
| 743 | 743 | ) { |
| 744 | 744 | $correct_test_link = Display::url( |
| 745 | 745 | Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')), |
| 746 | - api_get_self() . '?action=stats' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id |
|
| 746 | + api_get_self().'?action=stats'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id |
|
| 747 | 747 | ); |
| 748 | 748 | } else { |
| 749 | 749 | $correct_test_link = Display::url( |
| 750 | 750 | Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttemptsByExercise')), |
| 751 | - api_get_self() . '?action=stats&extend_attempt=1' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id |
|
| 751 | + api_get_self().'?action=stats&extend_attempt=1'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id |
|
| 752 | 752 | ); |
| 753 | 753 | } |
| 754 | 754 | } |
@@ -758,14 +758,14 @@ discard block |
||
| 758 | 758 | |
| 759 | 759 | $action = null; |
| 760 | 760 | if ($type == 'classic') { |
| 761 | - $action = '<td>' . $correct_test_link . '</td>'; |
|
| 761 | + $action = '<td>'.$correct_test_link.'</td>'; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | if ($lp_id == $my_lp_id && false) { |
| 765 | 765 | |
| 766 | - $output .= '<tr class =' . $oddclass . '> |
|
| 767 | - <td>' . $extend_link . '</td> |
|
| 768 | - <td colspan="4">' . $title . '</td> |
|
| 766 | + $output .= '<tr class ='.$oddclass.'> |
|
| 767 | + <td>' . $extend_link.'</td> |
|
| 768 | + <td colspan="4">' . $title.'</td> |
|
| 769 | 769 | <td colspan="2"> </td> |
| 770 | 770 | <td colspan="2"> </td> |
| 771 | 771 | <td colspan="2"> </td> |
@@ -790,13 +790,13 @@ discard block |
||
| 790 | 790 | $scoreItem .= ExerciseLib::show_score($score, $maxscore, false); |
| 791 | 791 | } |
| 792 | 792 | } else { |
| 793 | - $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . $maxscore); |
|
| 793 | + $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.$maxscore); |
|
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | $output .= ' |
| 797 | 797 | <td>'.$extend_link.'</td> |
| 798 | - <td colspan="4">' . $title . '</td> |
|
| 799 | - <td colspan="2">' . learnpathitem::humanize_status($lesson_status) .'</td> |
|
| 798 | + <td colspan="4">' . $title.'</td> |
|
| 799 | + <td colspan="2">' . learnpathitem::humanize_status($lesson_status).'</td> |
|
| 800 | 800 | <td colspan="2">'.$scoreItem.'</td> |
| 801 | 801 | <td colspan="2">'.$time.'</td> |
| 802 | 802 | '.$action.' |
@@ -813,10 +813,10 @@ discard block |
||
| 813 | 813 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
| 814 | 814 | $temp[] = '/'; |
| 815 | 815 | } else { |
| 816 | - $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
| 816 | + $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
| 817 | 817 | } |
| 818 | 818 | } else { |
| 819 | - $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
|
| 819 | + $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1))); |
|
| 820 | 820 | } |
| 821 | 821 | $temp[] = $time; |
| 822 | 822 | $csv_content[] = $temp; |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | $action = null; |
| 829 | 829 | if ($type == 'classic') { |
| 830 | - $action = '<td></td>'; |
|
| 830 | + $action = '<td></td>'; |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | if ($extend_this_attempt || $extend_all) { |
@@ -864,11 +864,11 @@ discard block |
||
| 864 | 864 | <td></td> |
| 865 | 865 | <td></td> |
| 866 | 866 | <td></td> |
| 867 | - <td>' . $interaction['order_id'] . '</td> |
|
| 868 | - <td colspan="2">'.$interaction['objective_id'] . '</td> |
|
| 869 | - <td colspan="2">' . $interaction['status'] . '</td> |
|
| 867 | + <td>' . $interaction['order_id'].'</td> |
|
| 868 | + <td colspan="2">'.$interaction['objective_id'].'</td> |
|
| 869 | + <td colspan="2">' . $interaction['status'].'</td> |
|
| 870 | 870 | <td>' . $interaction['score_raw'].'</td> |
| 871 | - <td>' . $interaction['score_max'] .'</td> |
|
| 871 | + <td>' . $interaction['score_max'].'</td> |
|
| 872 | 872 | <td>' . $interaction['score_min'].'</td> |
| 873 | 873 | '.$action.' |
| 874 | 874 | </tr>'; |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | // Attempts listing by exercise. |
| 880 | - if ($lp_id == $my_lp_id && $lp_item_id== $my_id && $extendedAttempt) { |
|
| 880 | + if ($lp_id == $my_lp_id && $lp_item_id == $my_id && $extendedAttempt) { |
|
| 881 | 881 | // Get attempts of a exercise. |
| 882 | 882 | if (!empty($lp_id) && |
| 883 | 883 | !empty($lp_item_id) && |
@@ -892,15 +892,15 @@ discard block |
||
| 892 | 892 | $row_path = Database::fetch_array($res_path); |
| 893 | 893 | |
| 894 | 894 | if (Database::num_rows($res_path) > 0) { |
| 895 | - $sql = 'SELECT * FROM ' . $tbl_stats_exercices . ' |
|
| 895 | + $sql = 'SELECT * FROM '.$tbl_stats_exercices.' |
|
| 896 | 896 | WHERE |
| 897 | - exe_exo_id="' . (int) $row_path['path'] . '" AND |
|
| 897 | + exe_exo_id="' . (int) $row_path['path'].'" AND |
|
| 898 | 898 | status <> "incomplete" AND |
| 899 | - exe_user_id="' . $user_id . '" AND |
|
| 900 | - orig_lp_id = "' . (int) $lp_id . '" AND |
|
| 901 | - orig_lp_item_id = "' . (int) $lp_item_id . '" AND |
|
| 902 | - c_id = ' . $course_id . ' AND |
|
| 903 | - session_id = ' . $session_id . ' |
|
| 899 | + exe_user_id="' . $user_id.'" AND |
|
| 900 | + orig_lp_id = "' . (int) $lp_id.'" AND |
|
| 901 | + orig_lp_item_id = "' . (int) $lp_item_id.'" AND |
|
| 902 | + c_id = ' . $course_id.' AND |
|
| 903 | + session_id = ' . $session_id.' |
|
| 904 | 904 | ORDER BY exe_date'; |
| 905 | 905 | $res_attempts = Database::query($sql); |
| 906 | 906 | $num_attempts = Database::num_rows($res_attempts); |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | if ($mktime_start_date && $mktime_exe_date) { |
| 919 | 919 | $mytime = ((int) $mktime_exe_date - (int) $mktime_start_date); |
| 920 | 920 | $time_attemp = learnpathItem :: getScormTimeFromParameter('js', $mytime); |
| 921 | - $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp); |
|
| 921 | + $time_attemp = str_replace('NaN', '00'.$h.'00\'00"', $time_attemp); |
|
| 922 | 922 | } else { |
| 923 | 923 | $time_attemp = ' - '; |
| 924 | 924 | } |
@@ -944,33 +944,33 @@ discard block |
||
| 944 | 944 | $my_lesson_status = learnpathitem::humanize_status('incomplete'); |
| 945 | 945 | } |
| 946 | 946 | |
| 947 | - $output .= '<tr class="' . $oddclass . '" > |
|
| 947 | + $output .= '<tr class="'.$oddclass.'" > |
|
| 948 | 948 | <td></td> |
| 949 | - <td>' . $extend_attempt_link . '</td> |
|
| 950 | - <td colspan="3">' . get_lang('Attempt').' '. $n.'</td> |
|
| 951 | - <td colspan="2">' . $my_lesson_status . '</td> |
|
| 952 | - <td colspan="2">'.$view_score . '</td> |
|
| 953 | - <td colspan="2">'.$time_attemp . '</td>'; |
|
| 949 | + <td>' . $extend_attempt_link.'</td> |
|
| 950 | + <td colspan="3">' . get_lang('Attempt').' '.$n.'</td> |
|
| 951 | + <td colspan="2">' . $my_lesson_status.'</td> |
|
| 952 | + <td colspan="2">'.$view_score.'</td> |
|
| 953 | + <td colspan="2">'.$time_attemp.'</td>'; |
|
| 954 | 954 | if ($action == 'classic') { |
| 955 | 955 | if ($origin != 'tracking') { |
| 956 | 956 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
| 957 | 957 | $output .= '<td> |
| 958 | - <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"> |
|
| 958 | + <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"> |
|
| 959 | 959 | </td>'; |
| 960 | 960 | } else { |
| 961 | 961 | $output .= '<td> |
| 962 | - <a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent"> |
|
| 963 | - <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"> |
|
| 962 | + <a href="../exercice/exercise_show.php?origin=' . $origin.'&id='.$my_exe_id.'&cidReq='.$courseCode.'" target="_parent"> |
|
| 963 | + <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"> |
|
| 964 | 964 | </a></td>'; |
| 965 | 965 | } |
| 966 | 966 | } else { |
| 967 | 967 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
| 968 | 968 | $output .= '<td> |
| 969 | - <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>'; |
|
| 969 | + <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></td>'; |
|
| 970 | 970 | } else { |
| 971 | 971 | $output .= '<td> |
| 972 | - <a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent"> |
|
| 973 | - <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>'; |
|
| 972 | + <a href="../exercice/exercise_show.php?cidReq=' . $courseCode.'&origin=correct_exercise_in_lp&id='.$my_exe_id.'" target="_parent"> |
|
| 973 | + <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></a></td>'; |
|
| 974 | 974 | } |
| 975 | 975 | } |
| 976 | 976 | } |
@@ -1029,13 +1029,13 @@ discard block |
||
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | $total_time = learnpathItem::getScormTimeFromParameter('js', $total_time); |
| 1032 | - $total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time); |
|
| 1032 | + $total_time = str_replace('NaN', '00'.$h.'00\'00"', $total_time); |
|
| 1033 | 1033 | |
| 1034 | 1034 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
| 1035 | 1035 | $final_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); |
| 1036 | 1036 | } else { |
| 1037 | 1037 | if (is_numeric($total_score)) { |
| 1038 | - $final_score = $total_score . '%'; |
|
| 1038 | + $final_score = $total_score.'%'; |
|
| 1039 | 1039 | } else { |
| 1040 | 1040 | $final_score = $total_score; |
| 1041 | 1041 | } |
@@ -1051,19 +1051,19 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $action = null; |
| 1053 | 1053 | if ($type == 'classic') { |
| 1054 | - $action = '<td></td>'; |
|
| 1054 | + $action = '<td></td>'; |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | $output .= '<tr class="'.$oddclass.'"> |
| 1058 | 1058 | <td></td> |
| 1059 | 1059 | <td colspan="4"> |
| 1060 | - <i>' . get_lang('AccomplishedStepsTotal') .'</i> |
|
| 1060 | + <i>' . get_lang('AccomplishedStepsTotal').'</i> |
|
| 1061 | 1061 | </td> |
| 1062 | 1062 | <td colspan="2">'.$progress.'%</td> |
| 1063 | 1063 | <td colspan="2"> |
| 1064 | 1064 | ' . $final_score.' |
| 1065 | 1065 | </td> |
| 1066 | - <td colspan="2">' . $total_time . '</div> |
|
| 1066 | + <td colspan="2">' . $total_time.'</div> |
|
| 1067 | 1067 | '.$action.' |
| 1068 | 1068 | </tr>'; |
| 1069 | 1069 | |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | $tbl_track_course = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); |
| 1360 | 1360 | if (is_array($user_id)) { |
| 1361 | 1361 | $user_id = array_map('intval', $user_id); |
| 1362 | - $condition_user = " AND user_id IN (".implode(',',$user_id).") "; |
|
| 1362 | + $condition_user = " AND user_id IN (".implode(',', $user_id).") "; |
|
| 1363 | 1363 | } else { |
| 1364 | 1364 | $user_id = intval($user_id); |
| 1365 | 1365 | $condition_user = " AND user_id = $user_id "; |
@@ -1396,13 +1396,13 @@ discard block |
||
| 1396 | 1396 | { |
| 1397 | 1397 | $tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
| 1398 | 1398 | $sql = 'SELECT login_date |
| 1399 | - FROM ' . $tbl_track_login . ' |
|
| 1400 | - WHERE login_user_id = ' . intval($student_id) . ' |
|
| 1399 | + FROM ' . $tbl_track_login.' |
|
| 1400 | + WHERE login_user_id = ' . intval($student_id).' |
|
| 1401 | 1401 | ORDER BY login_date ASC |
| 1402 | 1402 | LIMIT 0,1'; |
| 1403 | 1403 | |
| 1404 | 1404 | $rs = Database::query($sql); |
| 1405 | - if (Database::num_rows($rs)>0) { |
|
| 1405 | + if (Database::num_rows($rs) > 0) { |
|
| 1406 | 1406 | if ($first_login_date = Database::result($rs, 0, 0)) { |
| 1407 | 1407 | return api_convert_and_format_date( |
| 1408 | 1408 | $first_login_date, |
@@ -1427,8 +1427,8 @@ discard block |
||
| 1427 | 1427 | { |
| 1428 | 1428 | $table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
| 1429 | 1429 | $sql = 'SELECT login_date |
| 1430 | - FROM ' . $table . ' |
|
| 1431 | - WHERE login_user_id = ' . intval($student_id) . ' |
|
| 1430 | + FROM ' . $table.' |
|
| 1431 | + WHERE login_user_id = ' . intval($student_id).' |
|
| 1432 | 1432 | ORDER BY login_date |
| 1433 | 1433 | DESC LIMIT 0,1'; |
| 1434 | 1434 | |
@@ -1437,18 +1437,18 @@ discard block |
||
| 1437 | 1437 | if ($last_login_date = Database::result($rs, 0, 0)) { |
| 1438 | 1438 | $last_login_date = api_get_local_time($last_login_date); |
| 1439 | 1439 | if ($return_timestamp) { |
| 1440 | - return api_strtotime($last_login_date,'UTC'); |
|
| 1440 | + return api_strtotime($last_login_date, 'UTC'); |
|
| 1441 | 1441 | } else { |
| 1442 | 1442 | if (!$warning_message) { |
| 1443 | 1443 | return api_format_date($last_login_date, DATE_FORMAT_SHORT); |
| 1444 | 1444 | } else { |
| 1445 | - $timestamp = api_strtotime($last_login_date,'UTC'); |
|
| 1445 | + $timestamp = api_strtotime($last_login_date, 'UTC'); |
|
| 1446 | 1446 | $currentTimestamp = time(); |
| 1447 | 1447 | |
| 1448 | 1448 | //If the last connection is > than 7 days, the text is red |
| 1449 | 1449 | //345600 = 7 days in seconds |
| 1450 | 1450 | if ($currentTimestamp - $timestamp > 604800) { |
| 1451 | - return '<span style="color: #F00;">' . api_format_date($last_login_date, DATE_FORMAT_SHORT) . '</span>'; |
|
| 1451 | + return '<span style="color: #F00;">'.api_format_date($last_login_date, DATE_FORMAT_SHORT).'</span>'; |
|
| 1452 | 1452 | } else { |
| 1453 | 1453 | return api_format_date($last_login_date, DATE_FORMAT_SHORT); |
| 1454 | 1454 | } |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | $sql = "$select |
| 1484 | 1484 | FROM $tbl_track_login |
| 1485 | 1485 | WHERE |
| 1486 | - login_user_id IN (' ". implode("','", $studentList) . "' ) AND |
|
| 1486 | + login_user_id IN (' ".implode("','", $studentList)."' ) AND |
|
| 1487 | 1487 | login_date < '$date' |
| 1488 | 1488 | "; |
| 1489 | 1489 | $rs = Database::query($sql); |
@@ -1582,7 +1582,7 @@ discard block |
||
| 1582 | 1582 | '.Display::return_icon('messagebox_warning.gif').' |
| 1583 | 1583 | </a>' |
| 1584 | 1584 | : null; |
| 1585 | - return $icon. Display::label($last_login_date, 'warning'); |
|
| 1585 | + return $icon.Display::label($last_login_date, 'warning'); |
|
| 1586 | 1586 | } else { |
| 1587 | 1587 | return $last_login_date; |
| 1588 | 1588 | } |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | session_id = $session_id |
| 1633 | 1633 | $month_filter"; |
| 1634 | 1634 | $rs = Database::query($sql); |
| 1635 | - if (Database::num_rows($rs)>0) { |
|
| 1635 | + if (Database::num_rows($rs) > 0) { |
|
| 1636 | 1636 | $row = Database::fetch_object($rs); |
| 1637 | 1637 | $count = $row->count_connections; |
| 1638 | 1638 | } |
@@ -1653,14 +1653,14 @@ discard block |
||
| 1653 | 1653 | $tbl_session_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
| 1654 | 1654 | |
| 1655 | 1655 | $sql = 'SELECT DISTINCT c_id |
| 1656 | - FROM ' . $tbl_course_rel_user . ' |
|
| 1656 | + FROM ' . $tbl_course_rel_user.' |
|
| 1657 | 1657 | WHERE user_id = ' . $user_id.' AND relation_type<>'.COURSE_RELATION_TYPE_RRHH; |
| 1658 | 1658 | $rs = Database::query($sql); |
| 1659 | 1659 | $nb_courses = Database::num_rows($rs); |
| 1660 | 1660 | |
| 1661 | 1661 | if ($include_sessions) { |
| 1662 | 1662 | $sql = 'SELECT DISTINCT c_id |
| 1663 | - FROM ' . $tbl_session_course_rel_user . ' |
|
| 1663 | + FROM ' . $tbl_session_course_rel_user.' |
|
| 1664 | 1664 | WHERE user_id = ' . $user_id; |
| 1665 | 1665 | $rs = Database::query($sql); |
| 1666 | 1666 | $nb_courses += Database::num_rows($rs); |
@@ -1707,7 +1707,7 @@ discard block |
||
| 1707 | 1707 | $condition_quiz = ""; |
| 1708 | 1708 | if (!empty($exercise_id)) { |
| 1709 | 1709 | $exercise_id = intval($exercise_id); |
| 1710 | - $condition_quiz =" AND id = $exercise_id "; |
|
| 1710 | + $condition_quiz = " AND id = $exercise_id "; |
|
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | // Compose a filter based on optional session id given |
@@ -1756,7 +1756,7 @@ discard block |
||
| 1756 | 1756 | } |
| 1757 | 1757 | } |
| 1758 | 1758 | if (!empty($exercise_list)) { |
| 1759 | - $exercise_id = implode("','",$exercise_list); |
|
| 1759 | + $exercise_id = implode("','", $exercise_list); |
|
| 1760 | 1760 | } |
| 1761 | 1761 | } |
| 1762 | 1762 | |
@@ -1781,10 +1781,10 @@ discard block |
||
| 1781 | 1781 | $quiz_avg_score = null; |
| 1782 | 1782 | |
| 1783 | 1783 | if (!empty($row['avg_score'])) { |
| 1784 | - $quiz_avg_score = round($row['avg_score'],2); |
|
| 1784 | + $quiz_avg_score = round($row['avg_score'], 2); |
|
| 1785 | 1785 | } |
| 1786 | 1786 | |
| 1787 | - if(!empty($row['num_attempts'])) { |
|
| 1787 | + if (!empty($row['num_attempts'])) { |
|
| 1788 | 1788 | $quiz_avg_score = round($quiz_avg_score / $row['num_attempts'], 2); |
| 1789 | 1789 | } |
| 1790 | 1790 | if (is_array($student_id)) { |
@@ -1914,7 +1914,7 @@ discard block |
||
| 1914 | 1914 | $row = Database::fetch_row($rs); |
| 1915 | 1915 | $count = $row[0]; |
| 1916 | 1916 | } |
| 1917 | - $count = ($count != 0 ) ? 100*round(intval($count)/count($exercise_list), 2) .'%' : '0%'; |
|
| 1917 | + $count = ($count != 0) ? 100 * round(intval($count) / count($exercise_list), 2).'%' : '0%'; |
|
| 1918 | 1918 | return $count; |
| 1919 | 1919 | } |
| 1920 | 1920 | |
@@ -1939,7 +1939,7 @@ discard block |
||
| 1939 | 1939 | ); |
| 1940 | 1940 | |
| 1941 | 1941 | if (!empty($best_attempt) && !empty($best_attempt['exe_weighting'])) { |
| 1942 | - $result += $best_attempt['exe_result']/$best_attempt['exe_weighting']; |
|
| 1942 | + $result += $best_attempt['exe_result'] / $best_attempt['exe_weighting']; |
|
| 1943 | 1943 | } |
| 1944 | 1944 | } |
| 1945 | 1945 | $result = $result / count($exercise_list); |
@@ -1976,7 +1976,7 @@ discard block |
||
| 1976 | 1976 | $query = sprintf($sql, intval($courseId), $sessionId); |
| 1977 | 1977 | $rs = Database::query($query); |
| 1978 | 1978 | $teachers = array(); |
| 1979 | - while ($teacher = Database::fetch_array($rs,'ASSOC')) { |
|
| 1979 | + while ($teacher = Database::fetch_array($rs, 'ASSOC')) { |
|
| 1980 | 1980 | $teachers[] = $teacher; |
| 1981 | 1981 | } |
| 1982 | 1982 | $data = array(); |
@@ -2100,7 +2100,7 @@ discard block |
||
| 2100 | 2100 | $data[] = array( |
| 2101 | 2101 | 'course' => $course['title'], |
| 2102 | 2102 | 'session' => $teacher['name'], |
| 2103 | - 'tutor' => $tutor['username'] . ' - ' . $tutor['lastname'] . ' ' . $tutor['firstname'], |
|
| 2103 | + 'tutor' => $tutor['username'].' - '.$tutor['lastname'].' '.$tutor['firstname'], |
|
| 2104 | 2104 | 'documents' => $totalDocuments, |
| 2105 | 2105 | 'links' => $totalLinks, |
| 2106 | 2106 | 'forums' => $totalForums, |
@@ -2163,7 +2163,7 @@ discard block |
||
| 2163 | 2163 | for ($i = 0; $i < count($lpIdList); $i++) { |
| 2164 | 2164 | $placeHolders[] = '?'; |
| 2165 | 2165 | } |
| 2166 | - $lpConditions['AND id IN(' . implode(', ', $placeHolders) . ') '] = $lpIdList; |
|
| 2166 | + $lpConditions['AND id IN('.implode(', ', $placeHolders).') '] = $lpIdList; |
|
| 2167 | 2167 | } |
| 2168 | 2168 | |
| 2169 | 2169 | if ($onlySeriousGame) { |
@@ -2183,12 +2183,12 @@ discard block |
||
| 2183 | 2183 | |
| 2184 | 2184 | $conditions = [ |
| 2185 | 2185 | " c_id = {$courseInfo['real_id']} ", |
| 2186 | - " lp_view.lp_id IN(" . implode(', ', $filteredLP) . ") " |
|
| 2186 | + " lp_view.lp_id IN(".implode(', ', $filteredLP).") " |
|
| 2187 | 2187 | ]; |
| 2188 | 2188 | |
| 2189 | 2189 | if (is_array($studentId)) { |
| 2190 | 2190 | $studentId = array_map('intval', $studentId); |
| 2191 | - $conditions[] = " lp_view.user_id IN (" . implode(',', $studentId) . ") "; |
|
| 2191 | + $conditions[] = " lp_view.user_id IN (".implode(',', $studentId).") "; |
|
| 2192 | 2192 | |
| 2193 | 2193 | $groupBy = 'GROUP BY lp_id'; |
| 2194 | 2194 | } else { |
@@ -2329,7 +2329,7 @@ discard block |
||
| 2329 | 2329 | // Compose a filter based on optional learning paths list given |
| 2330 | 2330 | $condition_lp = ""; |
| 2331 | 2331 | if (count($lp_ids) > 0) { |
| 2332 | - $condition_lp =" AND id IN(".implode(',',$lp_ids).") "; |
|
| 2332 | + $condition_lp = " AND id IN(".implode(',', $lp_ids).") "; |
|
| 2333 | 2333 | } |
| 2334 | 2334 | |
| 2335 | 2335 | // Compose a filter based on optional session id |
@@ -2369,9 +2369,9 @@ discard block |
||
| 2369 | 2369 | // prepare filter on users |
| 2370 | 2370 | if (is_array($student_id)) { |
| 2371 | 2371 | array_walk($student_id, 'intval'); |
| 2372 | - $condition_user1 =" AND user_id IN (".implode(',', $student_id).") "; |
|
| 2372 | + $condition_user1 = " AND user_id IN (".implode(',', $student_id).") "; |
|
| 2373 | 2373 | } else { |
| 2374 | - $condition_user1 =" AND user_id = $student_id "; |
|
| 2374 | + $condition_user1 = " AND user_id = $student_id "; |
|
| 2375 | 2375 | } |
| 2376 | 2376 | |
| 2377 | 2377 | if ($count_row_lp > 0 && !empty($student_id)) { |
@@ -2414,7 +2414,7 @@ discard block |
||
| 2414 | 2414 | ORDER BY lp_item_id"; |
| 2415 | 2415 | $res_lp_item = Database::query($sql); |
| 2416 | 2416 | |
| 2417 | - while ($row_lp_item = Database::fetch_array($res_lp_item,'ASSOC')) { |
|
| 2417 | + while ($row_lp_item = Database::fetch_array($res_lp_item, 'ASSOC')) { |
|
| 2418 | 2418 | $my_lp_item_id = $row_lp_item['lp_item_id']; |
| 2419 | 2419 | |
| 2420 | 2420 | // Getting the most recent attempt |
@@ -2437,8 +2437,8 @@ discard block |
||
| 2437 | 2437 | ORDER BY view_count DESC |
| 2438 | 2438 | LIMIT 1"; |
| 2439 | 2439 | $res_lp_item_result = Database::query($sql); |
| 2440 | - while ($row_max_score = Database::fetch_array($res_lp_item_result,'ASSOC')) { |
|
| 2441 | - $list[]= $row_max_score; |
|
| 2440 | + while ($row_max_score = Database::fetch_array($res_lp_item_result, 'ASSOC')) { |
|
| 2441 | + $list[] = $row_max_score; |
|
| 2442 | 2442 | } |
| 2443 | 2443 | } |
| 2444 | 2444 | } else { |
@@ -2462,8 +2462,8 @@ discard block |
||
| 2462 | 2462 | if ($debug) echo $sql.'<br />'; |
| 2463 | 2463 | $res_max_score = Database::query($sql); |
| 2464 | 2464 | |
| 2465 | - while ($row_max_score = Database::fetch_array($res_max_score,'ASSOC')) { |
|
| 2466 | - $list[]= $row_max_score; |
|
| 2465 | + while ($row_max_score = Database::fetch_array($res_max_score, 'ASSOC')) { |
|
| 2466 | + $list[] = $row_max_score; |
|
| 2467 | 2467 | } |
| 2468 | 2468 | } |
| 2469 | 2469 | |
@@ -2478,7 +2478,7 @@ discard block |
||
| 2478 | 2478 | $max_score_item_view = $row_max_score['max_score_item_view']; |
| 2479 | 2479 | $score = $row_max_score['score']; |
| 2480 | 2480 | |
| 2481 | - if ($debug) echo '<h3>Item Type: ' .$row_max_score['item_type'].'</h3>'; |
|
| 2481 | + if ($debug) echo '<h3>Item Type: '.$row_max_score['item_type'].'</h3>'; |
|
| 2482 | 2482 | |
| 2483 | 2483 | if ($row_max_score['item_type'] == 'sco') { |
| 2484 | 2484 | /* Check if it is sco (easier to get max_score) |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | } |
| 2497 | 2497 | // Avoid division by zero errors |
| 2498 | 2498 | if (!empty($max_score)) { |
| 2499 | - $lp_partial_total += $score/$max_score; |
|
| 2499 | + $lp_partial_total += $score / $max_score; |
|
| 2500 | 2500 | } |
| 2501 | 2501 | if ($debug) echo '<b>$lp_partial_total, $score, $max_score '.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />'; |
| 2502 | 2502 | } else { |
@@ -2520,10 +2520,10 @@ discard block |
||
| 2520 | 2520 | ORDER BY exe_date DESC |
| 2521 | 2521 | LIMIT 1"; |
| 2522 | 2522 | |
| 2523 | - if ($debug) echo $sql .'<br />'; |
|
| 2523 | + if ($debug) echo $sql.'<br />'; |
|
| 2524 | 2524 | $result_last_attempt = Database::query($sql); |
| 2525 | 2525 | $num = Database :: num_rows($result_last_attempt); |
| 2526 | - if ($num > 0 ) { |
|
| 2526 | + if ($num > 0) { |
|
| 2527 | 2527 | $id_last_attempt = Database :: result($result_last_attempt, 0, 0); |
| 2528 | 2528 | if ($debug) echo $id_last_attempt.'<br />'; |
| 2529 | 2529 | |
@@ -2552,13 +2552,13 @@ discard block |
||
| 2552 | 2552 | $max_score = $row_max_score_bis['maxscore']; |
| 2553 | 2553 | } |
| 2554 | 2554 | if (!empty($max_score) && floatval($max_score) > 0) { |
| 2555 | - $lp_partial_total += $score/$max_score; |
|
| 2555 | + $lp_partial_total += $score / $max_score; |
|
| 2556 | 2556 | } |
| 2557 | 2557 | if ($debug) echo '$lp_partial_total, $score, $max_score <b>'.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />'; |
| 2558 | 2558 | } |
| 2559 | 2559 | } |
| 2560 | 2560 | |
| 2561 | - if (in_array($row_max_score['item_type'], array('quiz','sco'))) { |
|
| 2561 | + if (in_array($row_max_score['item_type'], array('quiz', 'sco'))) { |
|
| 2562 | 2562 | // Normal way |
| 2563 | 2563 | if ($use_max_score[$lp_id]) { |
| 2564 | 2564 | $count_items++; |
@@ -2593,8 +2593,8 @@ discard block |
||
| 2593 | 2593 | if ($debug) echo $sql; |
| 2594 | 2594 | $result_have_quiz = Database::query($sql); |
| 2595 | 2595 | |
| 2596 | - if (Database::num_rows($result_have_quiz) > 0 ) { |
|
| 2597 | - $row = Database::fetch_array($result_have_quiz,'ASSOC'); |
|
| 2596 | + if (Database::num_rows($result_have_quiz) > 0) { |
|
| 2597 | + $row = Database::fetch_array($result_have_quiz, 'ASSOC'); |
|
| 2598 | 2598 | if (is_numeric($row['count']) && $row['count'] != 0) { |
| 2599 | 2599 | $lp_with_quiz++; |
| 2600 | 2600 | } |
@@ -2606,7 +2606,7 @@ discard block |
||
| 2606 | 2606 | |
| 2607 | 2607 | if ($lp_with_quiz != 0) { |
| 2608 | 2608 | if (!$return_array) { |
| 2609 | - $score_of_scorm_calculate = round(($global_result/$lp_with_quiz),2); |
|
| 2609 | + $score_of_scorm_calculate = round(($global_result / $lp_with_quiz), 2); |
|
| 2610 | 2610 | if ($debug) var_dump($score_of_scorm_calculate); |
| 2611 | 2611 | if (empty($lp_ids)) { |
| 2612 | 2612 | if ($debug) echo '<h2>All lps fix: '.$score_of_scorm_calculate.'</h2>'; |
@@ -2680,9 +2680,9 @@ discard block |
||
| 2680 | 2680 | |
| 2681 | 2681 | if (is_array($student_id)) { |
| 2682 | 2682 | array_walk($student_id, 'intval'); |
| 2683 | - $conditions[] =" lp_view.user_id IN (".implode(',', $student_id).") "; |
|
| 2683 | + $conditions[] = " lp_view.user_id IN (".implode(',', $student_id).") "; |
|
| 2684 | 2684 | } else { |
| 2685 | - $conditions[] =" lp_view.user_id = $student_id "; |
|
| 2685 | + $conditions[] = " lp_view.user_id = $student_id "; |
|
| 2686 | 2686 | } |
| 2687 | 2687 | |
| 2688 | 2688 | $conditionsToString = implode('AND ', $conditions); |
@@ -2706,7 +2706,7 @@ discard block |
||
| 2706 | 2706 | return 0; |
| 2707 | 2707 | } |
| 2708 | 2708 | |
| 2709 | - return ($row['sum_score'] / $row['sum_max_score'])*100; |
|
| 2709 | + return ($row['sum_score'] / $row['sum_max_score']) * 100; |
|
| 2710 | 2710 | |
| 2711 | 2711 | } |
| 2712 | 2712 | |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | // Compose a filter based on optional learning paths list given |
| 2737 | 2737 | $condition_lp = ""; |
| 2738 | 2738 | if (count($lp_ids) > 0) { |
| 2739 | - $condition_lp =" AND id IN(".implode(',',$lp_ids).") "; |
|
| 2739 | + $condition_lp = " AND id IN(".implode(',', $lp_ids).") "; |
|
| 2740 | 2740 | } |
| 2741 | 2741 | |
| 2742 | 2742 | // Compose a filter based on optional session id |
@@ -2795,7 +2795,7 @@ discard block |
||
| 2795 | 2795 | |
| 2796 | 2796 | if (!empty($course)) { |
| 2797 | 2797 | |
| 2798 | - $course_id = $course['real_id']; |
|
| 2798 | + $course_id = $course['real_id']; |
|
| 2799 | 2799 | |
| 2800 | 2800 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 2801 | 2801 | $t_lpv = Database :: get_course_table(TABLE_LP_VIEW); |
@@ -2809,8 +2809,8 @@ discard block |
||
| 2809 | 2809 | // calculates last connection time |
| 2810 | 2810 | if ($count_row_lp > 0) { |
| 2811 | 2811 | $sql = 'SELECT MAX(start_time) |
| 2812 | - FROM ' . $t_lpiv . ' AS item_view |
|
| 2813 | - INNER JOIN ' . $t_lpv . ' AS view |
|
| 2812 | + FROM ' . $t_lpiv.' AS item_view |
|
| 2813 | + INNER JOIN ' . $t_lpv.' AS view |
|
| 2814 | 2814 | ON item_view.lp_view_id = view.id |
| 2815 | 2815 | WHERE |
| 2816 | 2816 | item_view.c_id = '.$course_id.' AND |
@@ -2846,15 +2846,15 @@ discard block |
||
| 2846 | 2846 | |
| 2847 | 2847 | // At first, courses where $coach_id is coach of the course // |
| 2848 | 2848 | $sql = 'SELECT session_id, c_id |
| 2849 | - FROM ' . $tbl_session_course_user . ' |
|
| 2849 | + FROM ' . $tbl_session_course_user.' |
|
| 2850 | 2850 | WHERE user_id=' . $coach_id.' AND status=2'; |
| 2851 | 2851 | |
| 2852 | 2852 | if (api_is_multiple_url_enabled()) { |
| 2853 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 2853 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 2854 | 2854 | $access_url_id = api_get_current_access_url_id(); |
| 2855 | 2855 | if ($access_url_id != -1) { |
| 2856 | 2856 | $sql = 'SELECT scu.session_id, scu.c_id |
| 2857 | - FROM ' . $tbl_session_course_user . ' scu |
|
| 2857 | + FROM ' . $tbl_session_course_user.' scu |
|
| 2858 | 2858 | INNER JOIN '.$tbl_session_rel_access_url.' sru |
| 2859 | 2859 | ON (scu.session_id=sru.session_id) |
| 2860 | 2860 | WHERE |
@@ -2888,28 +2888,28 @@ discard block |
||
| 2888 | 2888 | |
| 2889 | 2889 | // Then, courses where $coach_id is coach of the session // |
| 2890 | 2890 | $sql = 'SELECT session_course_user.user_id |
| 2891 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
| 2891 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
| 2892 | 2892 | INNER JOIN '.$tbl_session_user.' sru |
| 2893 | 2893 | ON session_course_user.user_id = sru.user_id AND session_course_user.session_id = sru.session_id |
| 2894 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
| 2894 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
| 2895 | 2895 | ON session_course.c_id = session_course_user.c_id |
| 2896 | 2896 | AND session_course_user.session_id = session_course.session_id |
| 2897 | - INNER JOIN ' . $tbl_session . ' as session |
|
| 2897 | + INNER JOIN ' . $tbl_session.' as session |
|
| 2898 | 2898 | ON session.id = session_course.session_id |
| 2899 | 2899 | AND session.id_coach = ' . $coach_id; |
| 2900 | 2900 | if (api_is_multiple_url_enabled()) { |
| 2901 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 2901 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 2902 | 2902 | $access_url_id = api_get_current_access_url_id(); |
| 2903 | - if ($access_url_id != -1){ |
|
| 2903 | + if ($access_url_id != -1) { |
|
| 2904 | 2904 | $sql = 'SELECT session_course_user.user_id |
| 2905 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
| 2905 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
| 2906 | 2906 | INNER JOIN '.$tbl_session_user.' sru |
| 2907 | 2907 | ON session_course_user.user_id = sru.user_id AND |
| 2908 | 2908 | session_course_user.session_id = sru.session_id |
| 2909 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
| 2909 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
| 2910 | 2910 | ON session_course.c_id = session_course_user.c_id AND |
| 2911 | 2911 | session_course_user.session_id = session_course.session_id |
| 2912 | - INNER JOIN ' . $tbl_session . ' as session |
|
| 2912 | + INNER JOIN ' . $tbl_session.' as session |
|
| 2913 | 2913 | ON session.id = session_course.session_id AND |
| 2914 | 2914 | session.id_coach = ' . $coach_id.' |
| 2915 | 2915 | INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url |
@@ -2939,8 +2939,8 @@ discard block |
||
| 2939 | 2939 | |
| 2940 | 2940 | $students = []; |
| 2941 | 2941 | // At first, courses where $coach_id is coach of the course // |
| 2942 | - $sql = 'SELECT c_id FROM ' . $tbl_session_course_user . ' |
|
| 2943 | - WHERE session_id="' . $id_session . '" AND user_id=' . $coach_id.' AND status=2'; |
|
| 2942 | + $sql = 'SELECT c_id FROM '.$tbl_session_course_user.' |
|
| 2943 | + WHERE session_id="' . $id_session.'" AND user_id='.$coach_id.' AND status=2'; |
|
| 2944 | 2944 | $result = Database::query($sql); |
| 2945 | 2945 | |
| 2946 | 2946 | while ($a_courses = Database::fetch_array($result)) { |
@@ -2950,7 +2950,7 @@ discard block |
||
| 2950 | 2950 | FROM $tbl_session_course_user AS srcru |
| 2951 | 2951 | WHERE |
| 2952 | 2952 | c_id = '$courseId' AND |
| 2953 | - session_id = '" . $id_session . "'"; |
|
| 2953 | + session_id = '".$id_session."'"; |
|
| 2954 | 2954 | $rs = Database::query($sql); |
| 2955 | 2955 | while ($row = Database::fetch_array($rs)) { |
| 2956 | 2956 | $students[$row['user_id']] = $row['user_id']; |
@@ -2958,15 +2958,15 @@ discard block |
||
| 2958 | 2958 | } |
| 2959 | 2959 | |
| 2960 | 2960 | // Then, courses where $coach_id is coach of the session |
| 2961 | - $sql = 'SELECT id_coach FROM ' . $tbl_session . ' |
|
| 2962 | - WHERE id="' . $id_session.'" AND id_coach="' . $coach_id . '"'; |
|
| 2961 | + $sql = 'SELECT id_coach FROM '.$tbl_session.' |
|
| 2962 | + WHERE id="' . $id_session.'" AND id_coach="'.$coach_id.'"'; |
|
| 2963 | 2963 | $result = Database::query($sql); |
| 2964 | 2964 | |
| 2965 | 2965 | //He is the session_coach so we select all the users in the session |
| 2966 | 2966 | if (Database::num_rows($result) > 0) { |
| 2967 | 2967 | $sql = 'SELECT DISTINCT srcru.user_id |
| 2968 | - FROM ' . $tbl_session_course_user . ' AS srcru |
|
| 2969 | - WHERE session_id="' . $id_session . '"'; |
|
| 2968 | + FROM ' . $tbl_session_course_user.' AS srcru |
|
| 2969 | + WHERE session_id="' . $id_session.'"'; |
|
| 2970 | 2970 | $result = Database::query($sql); |
| 2971 | 2971 | while ($row = Database::fetch_array($result)) { |
| 2972 | 2972 | $students[$row['user_id']] = $row['user_id']; |
@@ -2993,8 +2993,8 @@ discard block |
||
| 2993 | 2993 | |
| 2994 | 2994 | // At first, courses where $coach_id is coach of the course // |
| 2995 | 2995 | |
| 2996 | - $sql = 'SELECT 1 FROM ' . $tbl_session_course_user . ' |
|
| 2997 | - WHERE user_id=' . $coach_id .' AND status=2'; |
|
| 2996 | + $sql = 'SELECT 1 FROM '.$tbl_session_course_user.' |
|
| 2997 | + WHERE user_id=' . $coach_id.' AND status=2'; |
|
| 2998 | 2998 | $result = Database::query($sql); |
| 2999 | 2999 | if (Database::num_rows($result) > 0) { |
| 3000 | 3000 | return true; |
@@ -3002,12 +3002,12 @@ discard block |
||
| 3002 | 3002 | |
| 3003 | 3003 | // Then, courses where $coach_id is coach of the session |
| 3004 | 3004 | $sql = 'SELECT session_course_user.user_id |
| 3005 | - FROM ' . $tbl_session_course_user . ' as session_course_user |
|
| 3006 | - INNER JOIN ' . $tbl_session_course . ' as session_course |
|
| 3005 | + FROM ' . $tbl_session_course_user.' as session_course_user |
|
| 3006 | + INNER JOIN ' . $tbl_session_course.' as session_course |
|
| 3007 | 3007 | ON session_course.c_id = session_course_user.c_id |
| 3008 | - INNER JOIN ' . $tbl_session . ' as session |
|
| 3008 | + INNER JOIN ' . $tbl_session.' as session |
|
| 3009 | 3009 | ON session.id = session_course.session_id |
| 3010 | - AND session.id_coach = ' . $coach_id . ' |
|
| 3010 | + AND session.id_coach = ' . $coach_id.' |
|
| 3011 | 3011 | WHERE user_id = ' . $student_id; |
| 3012 | 3012 | $result = Database::query($sql); |
| 3013 | 3013 | if (Database::num_rows($result) > 0) { |
@@ -3039,16 +3039,16 @@ discard block |
||
| 3039 | 3039 | // At first, courses where $coach_id is coach of the course. |
| 3040 | 3040 | |
| 3041 | 3041 | $sql = 'SELECT DISTINCT c.code |
| 3042 | - FROM ' . $tbl_session_course_user . ' sc |
|
| 3042 | + FROM ' . $tbl_session_course_user.' sc |
|
| 3043 | 3043 | INNER JOIN '.$tbl_course.' c |
| 3044 | 3044 | ON (c.id = sc.c_id) |
| 3045 | 3045 | WHERE user_id = ' . $coach_id.' AND status = 2'; |
| 3046 | 3046 | |
| 3047 | 3047 | if (api_is_multiple_url_enabled()) { |
| 3048 | 3048 | $access_url_id = api_get_current_access_url_id(); |
| 3049 | - if ($access_url_id != -1){ |
|
| 3049 | + if ($access_url_id != -1) { |
|
| 3050 | 3050 | $sql = 'SELECT DISTINCT c.code |
| 3051 | - FROM ' . $tbl_session_course_user . ' scu |
|
| 3051 | + FROM ' . $tbl_session_course_user.' scu |
|
| 3052 | 3052 | INNER JOIN '.$tbl_course.' c |
| 3053 | 3053 | ON (c.code = scu.c_id) |
| 3054 | 3054 | INNER JOIN '.$tbl_course_rel_access_url.' cru |
@@ -3061,7 +3061,7 @@ discard block |
||
| 3061 | 3061 | } |
| 3062 | 3062 | |
| 3063 | 3063 | if (!empty($id_session)) { |
| 3064 | - $sql .= ' AND session_id=' . $id_session; |
|
| 3064 | + $sql .= ' AND session_id='.$id_session; |
|
| 3065 | 3065 | } |
| 3066 | 3066 | |
| 3067 | 3067 | $courseList = array(); |
@@ -3073,25 +3073,25 @@ discard block |
||
| 3073 | 3073 | // Then, courses where $coach_id is coach of the session |
| 3074 | 3074 | |
| 3075 | 3075 | $sql = 'SELECT DISTINCT course.code |
| 3076 | - FROM ' . $tbl_session_course . ' as session_course |
|
| 3077 | - INNER JOIN ' . $tbl_session . ' as session |
|
| 3076 | + FROM ' . $tbl_session_course.' as session_course |
|
| 3077 | + INNER JOIN ' . $tbl_session.' as session |
|
| 3078 | 3078 | ON session.id = session_course.session_id |
| 3079 | - AND session.id_coach = ' . $coach_id . ' |
|
| 3080 | - INNER JOIN ' . $tbl_course . ' as course |
|
| 3079 | + AND session.id_coach = ' . $coach_id.' |
|
| 3080 | + INNER JOIN ' . $tbl_course.' as course |
|
| 3081 | 3081 | ON course.id = session_course.c_id'; |
| 3082 | 3082 | |
| 3083 | 3083 | if (api_is_multiple_url_enabled()) { |
| 3084 | 3084 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
| 3085 | 3085 | $access_url_id = api_get_current_access_url_id(); |
| 3086 | - if ($access_url_id != -1){ |
|
| 3086 | + if ($access_url_id != -1) { |
|
| 3087 | 3087 | $sql = 'SELECT DISTINCT c.code |
| 3088 | - FROM ' . $tbl_session_course . ' as session_course |
|
| 3088 | + FROM ' . $tbl_session_course.' as session_course |
|
| 3089 | 3089 | INNER JOIN '.$tbl_course.' c |
| 3090 | 3090 | ON (c.id = session_course.c_id) |
| 3091 | - INNER JOIN ' . $tbl_session . ' as session |
|
| 3091 | + INNER JOIN ' . $tbl_session.' as session |
|
| 3092 | 3092 | ON session.id = session_course.session_id |
| 3093 | - AND session.id_coach = ' . $coach_id . ' |
|
| 3094 | - INNER JOIN ' . $tbl_course . ' as course |
|
| 3093 | + AND session.id_coach = ' . $coach_id.' |
|
| 3094 | + INNER JOIN ' . $tbl_course.' as course |
|
| 3095 | 3095 | ON course.id = session_course.c_id |
| 3096 | 3096 | INNER JOIN '.$tbl_course_rel_access_url.' course_rel_url |
| 3097 | 3097 | ON (course_rel_url.c_id = c.id)'; |
@@ -3099,12 +3099,12 @@ discard block |
||
| 3099 | 3099 | } |
| 3100 | 3100 | |
| 3101 | 3101 | if (!empty ($id_session)) { |
| 3102 | - $sql .= ' WHERE session_course.session_id=' . $id_session; |
|
| 3102 | + $sql .= ' WHERE session_course.session_id='.$id_session; |
|
| 3103 | 3103 | if (api_is_multiple_url_enabled()) |
| 3104 | - $sql .= ' AND access_url_id = '.$access_url_id; |
|
| 3105 | - } else { |
|
| 3104 | + $sql .= ' AND access_url_id = '.$access_url_id; |
|
| 3105 | + } else { |
|
| 3106 | 3106 | if (api_is_multiple_url_enabled()) |
| 3107 | - $sql .= ' WHERE access_url_id = '.$access_url_id; |
|
| 3107 | + $sql .= ' WHERE access_url_id = '.$access_url_id; |
|
| 3108 | 3108 | } |
| 3109 | 3109 | |
| 3110 | 3110 | $result = Database::query($sql); |
@@ -3160,7 +3160,7 @@ discard block |
||
| 3160 | 3160 | } |
| 3161 | 3161 | } |
| 3162 | 3162 | |
| 3163 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 3163 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
| 3164 | 3164 | $access_url_id = api_get_current_access_url_id(); |
| 3165 | 3165 | |
| 3166 | 3166 | $sql = " |
@@ -3280,7 +3280,7 @@ discard block |
||
| 3280 | 3280 | // table definition |
| 3281 | 3281 | $tbl_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
| 3282 | 3282 | $tbl_document = Database :: get_course_table(TABLE_DOCUMENT); |
| 3283 | - $course_id = $a_course['real_id']; |
|
| 3283 | + $course_id = $a_course['real_id']; |
|
| 3284 | 3284 | if (is_array($student_id)) { |
| 3285 | 3285 | $studentList = array_map('intval', $student_id); |
| 3286 | 3286 | $condition_user = " AND ip.insert_user_id IN ('".implode(',', $studentList)."') "; |
@@ -3331,7 +3331,7 @@ discard block |
||
| 3331 | 3331 | $a_course = CourseManager::get_course_information($course_code); |
| 3332 | 3332 | if (!empty($a_course)) { |
| 3333 | 3333 | $course_id = $a_course['real_id']; |
| 3334 | - $conditions[]= " ip.c_id = $course_id AND pub.c_id = $course_id "; |
|
| 3334 | + $conditions[] = " ip.c_id = $course_id AND pub.c_id = $course_id "; |
|
| 3335 | 3335 | } |
| 3336 | 3336 | |
| 3337 | 3337 | // table definition |
@@ -3340,14 +3340,14 @@ discard block |
||
| 3340 | 3340 | |
| 3341 | 3341 | if (is_array($student_id)) { |
| 3342 | 3342 | $studentList = array_map('intval', $student_id); |
| 3343 | - $conditions[]= " ip.insert_user_id IN ('".implode("','", $studentList)."') "; |
|
| 3343 | + $conditions[] = " ip.insert_user_id IN ('".implode("','", $studentList)."') "; |
|
| 3344 | 3344 | } else { |
| 3345 | 3345 | $student_id = intval($student_id); |
| 3346 | - $conditions[]= " ip.insert_user_id = '$student_id' "; |
|
| 3346 | + $conditions[] = " ip.insert_user_id = '$student_id' "; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | if (isset($session_id)) { |
| 3349 | 3349 | $session_id = intval($session_id); |
| 3350 | - $conditions[]= " pub.session_id = $session_id "; |
|
| 3350 | + $conditions[] = " pub.session_id = $session_id "; |
|
| 3351 | 3351 | } |
| 3352 | 3352 | $conditionToString = implode('AND', $conditions); |
| 3353 | 3353 | |
@@ -3380,8 +3380,8 @@ discard block |
||
| 3380 | 3380 | $courseCondition = null; |
| 3381 | 3381 | $conditions = array(); |
| 3382 | 3382 | if (!empty($courseInfo)) { |
| 3383 | - $course_id = $courseInfo['real_id']; |
|
| 3384 | - $conditions[]= " post.c_id = $course_id AND forum.c_id = $course_id "; |
|
| 3383 | + $course_id = $courseInfo['real_id']; |
|
| 3384 | + $conditions[] = " post.c_id = $course_id AND forum.c_id = $course_id "; |
|
| 3385 | 3385 | } |
| 3386 | 3386 | |
| 3387 | 3387 | // Table definition. |
@@ -3390,15 +3390,15 @@ discard block |
||
| 3390 | 3390 | |
| 3391 | 3391 | if (is_array($student_id)) { |
| 3392 | 3392 | $studentList = array_map('intval', $student_id); |
| 3393 | - $conditions[]= " post.poster_id IN ('".implode("','", $studentList)."') "; |
|
| 3393 | + $conditions[] = " post.poster_id IN ('".implode("','", $studentList)."') "; |
|
| 3394 | 3394 | } else { |
| 3395 | 3395 | $student_id = intval($student_id); |
| 3396 | - $conditions[]= " post.poster_id = '$student_id' "; |
|
| 3396 | + $conditions[] = " post.poster_id = '$student_id' "; |
|
| 3397 | 3397 | } |
| 3398 | 3398 | |
| 3399 | 3399 | if (isset($session_id)) { |
| 3400 | 3400 | $session_id = intval($session_id); |
| 3401 | - $conditions[]= " forum.session_id = $session_id"; |
|
| 3401 | + $conditions[] = " forum.session_id = $session_id"; |
|
| 3402 | 3402 | } |
| 3403 | 3403 | |
| 3404 | 3404 | $conditionsToString = implode('AND ', $conditions); |
@@ -3433,7 +3433,7 @@ discard block |
||
| 3433 | 3433 | $condition_session = ''; |
| 3434 | 3434 | if (isset($session_id)) { |
| 3435 | 3435 | $session_id = intval($session_id); |
| 3436 | - $condition_session = api_get_session_condition($session_id, true, false, 'f.session_id'); |
|
| 3436 | + $condition_session = api_get_session_condition($session_id, true, false, 'f.session_id'); |
|
| 3437 | 3437 | } |
| 3438 | 3438 | |
| 3439 | 3439 | $course_id = $courseInfo['real_id']; |
@@ -3489,7 +3489,7 @@ discard block |
||
| 3489 | 3489 | $condition_session = ''; |
| 3490 | 3490 | if (isset($session_id)) { |
| 3491 | 3491 | $session_id = intval($session_id); |
| 3492 | - $condition_session = ' AND f.session_id = '. $session_id; |
|
| 3492 | + $condition_session = ' AND f.session_id = '.$session_id; |
|
| 3493 | 3493 | } |
| 3494 | 3494 | |
| 3495 | 3495 | $groupId = intval($groupId); |
@@ -3550,7 +3550,7 @@ discard block |
||
| 3550 | 3550 | $condition_session = ''; |
| 3551 | 3551 | if (isset($session_id)) { |
| 3552 | 3552 | $session_id = intval($session_id); |
| 3553 | - $condition_session = ' AND f.session_id = '. $session_id; |
|
| 3553 | + $condition_session = ' AND f.session_id = '.$session_id; |
|
| 3554 | 3554 | } |
| 3555 | 3555 | |
| 3556 | 3556 | $groupId = intval($groupId); |
@@ -3629,7 +3629,7 @@ discard block |
||
| 3629 | 3629 | { |
| 3630 | 3630 | $student_id = intval($student_id); |
| 3631 | 3631 | $courseId = intval($courseId); |
| 3632 | - $session_id = intval($session_id); |
|
| 3632 | + $session_id = intval($session_id); |
|
| 3633 | 3633 | $date_time = ''; |
| 3634 | 3634 | |
| 3635 | 3635 | // table definition |
@@ -3698,7 +3698,7 @@ discard block |
||
| 3698 | 3698 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
| 3699 | 3699 | |
| 3700 | 3700 | $sql = 'SELECT 1 |
| 3701 | - FROM ' . $table . ' |
|
| 3701 | + FROM ' . $table.' |
|
| 3702 | 3702 | WHERE down_user_id = '.$student_id.' |
| 3703 | 3703 | AND c_id = "'.$courseId.'" |
| 3704 | 3704 | AND down_session_id = '.$session_id.' '; |
@@ -3776,30 +3776,30 @@ discard block |
||
| 3776 | 3776 | '.$inner.' |
| 3777 | 3777 | WHERE c.id = '.$courseId.' |
| 3778 | 3778 | GROUP BY stats_login.user_id |
| 3779 | - HAVING DATE_SUB( "' . $now . '", INTERVAL '.$since.' DAY) > max_date '; |
|
| 3779 | + HAVING DATE_SUB( "' . $now.'", INTERVAL '.$since.' DAY) > max_date '; |
|
| 3780 | 3780 | |
| 3781 | 3781 | if ($since == 'never') { |
| 3782 | 3782 | if (empty($session_id)) { |
| 3783 | 3783 | $sql = 'SELECT course_user.user_id |
| 3784 | - FROM ' . $table_course_rel_user . ' course_user |
|
| 3785 | - LEFT JOIN ' . $tbl_track_login . ' stats_login |
|
| 3784 | + FROM ' . $table_course_rel_user.' course_user |
|
| 3785 | + LEFT JOIN ' . $tbl_track_login.' stats_login |
|
| 3786 | 3786 | ON course_user.user_id = stats_login.user_id AND |
| 3787 | - relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' |
|
| 3788 | - INNER JOIN ' . $tableCourse . ' c |
|
| 3787 | + relation_type<>' . COURSE_RELATION_TYPE_RRHH.' |
|
| 3788 | + INNER JOIN ' . $tableCourse.' c |
|
| 3789 | 3789 | ON (c.id = course_user.c_id) |
| 3790 | 3790 | WHERE |
| 3791 | - course_user.c_id = ' . $courseId . ' AND |
|
| 3791 | + course_user.c_id = ' . $courseId.' AND |
|
| 3792 | 3792 | stats_login.login_course_date IS NULL |
| 3793 | 3793 | GROUP BY course_user.user_id'; |
| 3794 | 3794 | } else { |
| 3795 | 3795 | $sql = 'SELECT session_course_user.user_id |
| 3796 | 3796 | FROM '.$tbl_session_course_user.' session_course_user |
| 3797 | - LEFT JOIN ' . $tbl_track_login . ' stats_login |
|
| 3797 | + LEFT JOIN ' . $tbl_track_login.' stats_login |
|
| 3798 | 3798 | ON session_course_user.user_id = stats_login.user_id |
| 3799 | - INNER JOIN ' . $tableCourse . ' c |
|
| 3799 | + INNER JOIN ' . $tableCourse.' c |
|
| 3800 | 3800 | ON (c.id = session_course_user.c_id) |
| 3801 | 3801 | WHERE |
| 3802 | - session_course_user.c_id = ' . $courseId . ' AND |
|
| 3802 | + session_course_user.c_id = ' . $courseId.' AND |
|
| 3803 | 3803 | stats_login.login_course_date IS NULL |
| 3804 | 3804 | GROUP BY session_course_user.user_id'; |
| 3805 | 3805 | |
@@ -3808,7 +3808,7 @@ discard block |
||
| 3808 | 3808 | |
| 3809 | 3809 | $rs = Database::query($sql); |
| 3810 | 3810 | $inactive_users = array(); |
| 3811 | - while($user = Database::fetch_array($rs)) { |
|
| 3811 | + while ($user = Database::fetch_array($rs)) { |
|
| 3812 | 3812 | $inactive_users[] = $user['user_id']; |
| 3813 | 3813 | } |
| 3814 | 3814 | |
@@ -3830,10 +3830,10 @@ discard block |
||
| 3830 | 3830 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
| 3831 | 3831 | |
| 3832 | 3832 | $sql = 'SELECT '.$student_id.' |
| 3833 | - FROM ' . $table . ' |
|
| 3833 | + FROM ' . $table.' |
|
| 3834 | 3834 | WHERE |
| 3835 | - access_user_id=' . $student_id . ' AND |
|
| 3836 | - c_id="' . $courseId . '" AND |
|
| 3835 | + access_user_id=' . $student_id.' AND |
|
| 3836 | + c_id="' . $courseId.'" AND |
|
| 3837 | 3837 | access_session_id = "'.$session_id.'" '; |
| 3838 | 3838 | |
| 3839 | 3839 | $rs = Database::query($sql); |
@@ -3851,13 +3851,13 @@ discard block |
||
| 3851 | 3851 | { |
| 3852 | 3852 | $hr_dept_id = intval($hr_dept_id); |
| 3853 | 3853 | $a_students = array(); |
| 3854 | - $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
| 3854 | + $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
| 3855 | 3855 | |
| 3856 | 3856 | $sql = 'SELECT DISTINCT user_id FROM '.$tbl_user.' as user |
| 3857 | 3857 | WHERE hr_dept_id='.$hr_dept_id; |
| 3858 | 3858 | $rs = Database::query($sql); |
| 3859 | 3859 | |
| 3860 | - while($user = Database :: fetch_array($rs)) { |
|
| 3860 | + while ($user = Database :: fetch_array($rs)) { |
|
| 3861 | 3861 | $a_students[$user['user_id']] = $user['user_id']; |
| 3862 | 3862 | } |
| 3863 | 3863 | |
@@ -3882,7 +3882,7 @@ discard block |
||
| 3882 | 3882 | $condition_session = ''; |
| 3883 | 3883 | if (isset($session_id)) { |
| 3884 | 3884 | $session_id = intval($session_id); |
| 3885 | - $condition_session = ' AND access_session_id = '. $session_id; |
|
| 3885 | + $condition_session = ' AND access_session_id = '.$session_id; |
|
| 3886 | 3886 | } |
| 3887 | 3887 | $sql = "SELECT |
| 3888 | 3888 | access_tool, |
@@ -3994,7 +3994,7 @@ discard block |
||
| 3994 | 3994 | if (!empty($date_from) && !empty($date_to)) { |
| 3995 | 3995 | $fieldStartDate = $fields['start_date']; |
| 3996 | 3996 | if (!isset($fields['end_date'])) { |
| 3997 | - $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to) ; |
|
| 3997 | + $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to); |
|
| 3998 | 3998 | } else { |
| 3999 | 3999 | $fieldEndDate = $fields['end_date']; |
| 4000 | 4000 | $where .= sprintf(" AND fieldStartDate >= '%s' |
@@ -4010,12 +4010,12 @@ discard block |
||
| 4010 | 4010 | $where |
| 4011 | 4011 | GROUP BY %s"; |
| 4012 | 4012 | $sql = sprintf($sql, |
| 4013 | - $fields['user'], //user field |
|
| 4014 | - $tableName, //FROM |
|
| 4015 | - $fields['course'], //course condition |
|
| 4016 | - $course['real_id'], //course condition |
|
| 4017 | - $fields['user'], //user condition |
|
| 4018 | - $userId, //user condition |
|
| 4013 | + $fields['user'], //user field |
|
| 4014 | + $tableName, //FROM |
|
| 4015 | + $fields['course'], //course condition |
|
| 4016 | + $course['real_id'], //course condition |
|
| 4017 | + $fields['user'], //user condition |
|
| 4018 | + $userId, //user condition |
|
| 4019 | 4019 | $fields['user'] //GROUP BY |
| 4020 | 4020 | ); |
| 4021 | 4021 | $rs = Database::query($sql); |
@@ -4023,7 +4023,7 @@ discard block |
||
| 4023 | 4023 | //iterate query |
| 4024 | 4024 | if (Database::num_rows($rs) > 0) { |
| 4025 | 4025 | while ($row = Database::fetch_array($rs)) { |
| 4026 | - $data[$row['user']] = (isset($data[$row['user']])) ? $data[$row['user']] + $row[total]: $row['total']; |
|
| 4026 | + $data[$row['user']] = (isset($data[$row['user']])) ? $data[$row['user']] + $row[total] : $row['total']; |
|
| 4027 | 4027 | } |
| 4028 | 4028 | } |
| 4029 | 4029 | } |
@@ -4046,11 +4046,11 @@ discard block |
||
| 4046 | 4046 | $courseId = api_get_course_int_id($course_code); |
| 4047 | 4047 | $data = array(); |
| 4048 | 4048 | |
| 4049 | - $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
|
| 4049 | + $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
|
| 4050 | 4050 | $condition_session = ''; |
| 4051 | 4051 | if (isset($session_id)) { |
| 4052 | 4052 | $session_id = intval($session_id); |
| 4053 | - $condition_session = ' AND down_session_id = '. $session_id; |
|
| 4053 | + $condition_session = ' AND down_session_id = '.$session_id; |
|
| 4054 | 4054 | } |
| 4055 | 4055 | $sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path) as count_down |
| 4056 | 4056 | FROM $TABLETRACK_DOWNLOADS |
@@ -4235,7 +4235,7 @@ discard block |
||
| 4235 | 4235 | |
| 4236 | 4236 | $final_course_data = array(); |
| 4237 | 4237 | |
| 4238 | - foreach($my_course_data as $course_id => $value) { |
|
| 4238 | + foreach ($my_course_data as $course_id => $value) { |
|
| 4239 | 4239 | $final_course_data[$course_id] = $course_list[$course_id]; |
| 4240 | 4240 | } |
| 4241 | 4241 | $course_in_session[$my_session_id]['course_list'] = $final_course_data; |
@@ -4256,7 +4256,7 @@ discard block |
||
| 4256 | 4256 | '.Display::tag('th', get_lang('Course'), array('width'=>'300px')).' |
| 4257 | 4257 | '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
| 4258 | 4258 | '.Display::tag('th', get_lang('Progress'), array('class'=>'head')).' |
| 4259 | - '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')),array('class'=>'head')).' |
|
| 4259 | + '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
| 4260 | 4260 | '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
| 4261 | 4261 | '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
| 4262 | 4262 | </tr>'; |
@@ -4343,7 +4343,7 @@ discard block |
||
| 4343 | 4343 | $all_exercise_start_time = array(); |
| 4344 | 4344 | |
| 4345 | 4345 | foreach ($course_in_session as $my_session_id => $session_data) { |
| 4346 | - $course_list = $session_data['course_list']; |
|
| 4346 | + $course_list = $session_data['course_list']; |
|
| 4347 | 4347 | $user_count = count(SessionManager::get_users_by_session($my_session_id)); |
| 4348 | 4348 | $exercise_graph_name_list = array(); |
| 4349 | 4349 | //$user_results = array(); |
@@ -4388,20 +4388,20 @@ discard block |
||
| 4388 | 4388 | |
| 4389 | 4389 | $score = 0; |
| 4390 | 4390 | if (!empty($user_result_data['exe_weighting']) && intval($user_result_data['exe_weighting']) != 0) { |
| 4391 | - $score = intval($user_result_data['exe_result']/$user_result_data['exe_weighting'] * 100); |
|
| 4391 | + $score = intval($user_result_data['exe_result'] / $user_result_data['exe_weighting'] * 100); |
|
| 4392 | 4392 | } |
| 4393 | 4393 | $time = api_strtotime($exercise_data['start_time']) ? api_strtotime($exercise_data['start_time'], 'UTC') : 0; |
| 4394 | 4394 | $all_exercise_start_time[] = $time; |
| 4395 | 4395 | $my_results[] = $score; |
| 4396 | - if (count($exercise_list)<=10) { |
|
| 4396 | + if (count($exercise_list) <= 10) { |
|
| 4397 | 4397 | $title = cut($course_data['title'], 30)." \n ".cut($exercise_data['title'], 30); |
| 4398 | - $exercise_graph_name_list[]= $title; |
|
| 4398 | + $exercise_graph_name_list[] = $title; |
|
| 4399 | 4399 | $all_exercise_graph_name_list[] = $title; |
| 4400 | 4400 | } else { |
| 4401 | 4401 | // if there are more than 10 results, space becomes difficult to find, so only show the title of the exercise, not the tool |
| 4402 | 4402 | $title = cut($exercise_data['title'], 30); |
| 4403 | - $exercise_graph_name_list[]= $title; |
|
| 4404 | - $all_exercise_graph_name_list[]= $title; |
|
| 4403 | + $exercise_graph_name_list[] = $title; |
|
| 4404 | + $all_exercise_graph_name_list[] = $title; |
|
| 4405 | 4405 | } |
| 4406 | 4406 | } |
| 4407 | 4407 | } |
@@ -4434,7 +4434,7 @@ discard block |
||
| 4434 | 4434 | } |
| 4435 | 4435 | |
| 4436 | 4436 | $html .= Display::page_subheader( |
| 4437 | - Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('Sessions') |
|
| 4437 | + Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL).' '.get_lang('Sessions') |
|
| 4438 | 4438 | ); |
| 4439 | 4439 | |
| 4440 | 4440 | $html .= '<table class="data_table" width="100%">'; |
@@ -4484,7 +4484,7 @@ discard block |
||
| 4484 | 4484 | $courseInfo['real_id'], |
| 4485 | 4485 | $my_session_id |
| 4486 | 4486 | ); |
| 4487 | - if ($attempts > 1) { |
|
| 4487 | + if ($attempts > 1) { |
|
| 4488 | 4488 | $answered_exercises++; |
| 4489 | 4489 | } |
| 4490 | 4490 | } |
@@ -4497,7 +4497,7 @@ discard block |
||
| 4497 | 4497 | $all_average += $average; |
| 4498 | 4498 | } |
| 4499 | 4499 | |
| 4500 | - $all_average = $all_average / count($course_list); |
|
| 4500 | + $all_average = $all_average / count($course_list); |
|
| 4501 | 4501 | |
| 4502 | 4502 | if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) { |
| 4503 | 4503 | $html .= '<tr style="background-color:#FBF09D">'; |
@@ -4522,31 +4522,31 @@ discard block |
||
| 4522 | 4522 | $html .= '</tr>'; |
| 4523 | 4523 | } |
| 4524 | 4524 | $html .= '</table><br />'; |
| 4525 | - $html .= Display::div($main_session_graph, array('id'=>'session_graph','class'=>'chart-session', 'style'=>'position:relative; text-align: center;') ); |
|
| 4525 | + $html .= Display::div($main_session_graph, array('id'=>'session_graph', 'class'=>'chart-session', 'style'=>'position:relative; text-align: center;')); |
|
| 4526 | 4526 | |
| 4527 | 4527 | // Checking selected session. |
| 4528 | 4528 | |
| 4529 | 4529 | if (isset($_GET['session_id'])) { |
| 4530 | 4530 | $session_id_from_get = intval($_GET['session_id']); |
| 4531 | - $session_data = $course_in_session[$session_id_from_get]; |
|
| 4532 | - $course_list = $session_data['course_list']; |
|
| 4531 | + $session_data = $course_in_session[$session_id_from_get]; |
|
| 4532 | + $course_list = $session_data['course_list']; |
|
| 4533 | 4533 | |
| 4534 | - $html .= Display::tag('h3',$session_data['name'].' - '.get_lang('CourseList')); |
|
| 4534 | + $html .= Display::tag('h3', $session_data['name'].' - '.get_lang('CourseList')); |
|
| 4535 | 4535 | |
| 4536 | 4536 | $html .= '<table class="data_table" width="100%">'; |
| 4537 | 4537 | //'.Display::tag('th', get_lang('DoneExercises'), array('class'=>'head')).' |
| 4538 | 4538 | $html .= ' |
| 4539 | 4539 | <tr> |
| 4540 | 4540 | <th width="300px">'.get_lang('Course').'</th> |
| 4541 | - '.Display::tag('th', get_lang('PublishedExercises'), array('class'=>'head')).' |
|
| 4542 | - '.Display::tag('th', get_lang('NewExercises'), array('class'=>'head')).' |
|
| 4543 | - '.Display::tag('th', get_lang('MyAverage'), array('class'=>'head')).' |
|
| 4544 | - '.Display::tag('th', get_lang('AverageExerciseResult'), array('class'=>'head')).' |
|
| 4545 | - '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
|
| 4546 | - '.Display::tag('th', get_lang('LPProgress') , array('class'=>'head')).' |
|
| 4547 | - '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
| 4548 | - '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
|
| 4549 | - '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
|
| 4541 | + '.Display::tag('th', get_lang('PublishedExercises'), array('class'=>'head')).' |
|
| 4542 | + '.Display::tag('th', get_lang('NewExercises'), array('class'=>'head')).' |
|
| 4543 | + '.Display::tag('th', get_lang('MyAverage'), array('class'=>'head')).' |
|
| 4544 | + '.Display::tag('th', get_lang('AverageExerciseResult'), array('class'=>'head')).' |
|
| 4545 | + '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).' |
|
| 4546 | + '.Display::tag('th', get_lang('LPProgress'), array('class'=>'head')).' |
|
| 4547 | + '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).' |
|
| 4548 | + '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).' |
|
| 4549 | + '.Display::tag('th', get_lang('Details'), array('class'=>'head')).' |
|
| 4550 | 4550 | </tr>'; |
| 4551 | 4551 | |
| 4552 | 4552 | foreach ($course_list as $course_data) { |
@@ -4562,14 +4562,14 @@ discard block |
||
| 4562 | 4562 | $count_exercises = count($exercises); |
| 4563 | 4563 | } |
| 4564 | 4564 | $answered_exercises = 0; |
| 4565 | - foreach($exercises as $exercise_item) { |
|
| 4565 | + foreach ($exercises as $exercise_item) { |
|
| 4566 | 4566 | $attempts = Event::count_exercise_attempts_by_user( |
| 4567 | 4567 | api_get_user_id(), |
| 4568 | 4568 | $exercise_item['id'], |
| 4569 | 4569 | $courseId, |
| 4570 | 4570 | $session_id_from_get |
| 4571 | 4571 | ); |
| 4572 | - if ($attempts > 1) { |
|
| 4572 | + if ($attempts > 1) { |
|
| 4573 | 4573 | $answered_exercises++; |
| 4574 | 4574 | } |
| 4575 | 4575 | } |
@@ -4578,7 +4578,7 @@ discard block |
||
| 4578 | 4578 | |
| 4579 | 4579 | // Average |
| 4580 | 4580 | $average = ExerciseLib::get_average_score_by_course($courseId, $session_id_from_get); |
| 4581 | - $my_average = ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get); |
|
| 4581 | + $my_average = ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get); |
|
| 4582 | 4582 | |
| 4583 | 4583 | $stats_array[$course_code] = array( |
| 4584 | 4584 | 'exercises' => $count_exercises, |
@@ -4648,11 +4648,11 @@ discard block |
||
| 4648 | 4648 | } |
| 4649 | 4649 | //Score |
| 4650 | 4650 | $html .= Display::tag('td', $percentage_score, array('align'=>'center')); |
| 4651 | - $html .= Display::tag('td', $last_connection, array('align'=>'center')); |
|
| 4651 | + $html .= Display::tag('td', $last_connection, array('align'=>'center')); |
|
| 4652 | 4652 | |
| 4653 | 4653 | if ($course_code == $courseCodeFromGet && $_GET['session_id'] == $session_id_from_get) { |
| 4654 | 4654 | $details = '<a href="#">'; |
| 4655 | - $details .=Display::return_icon('2rightarrow_na.png', get_lang('Details')); |
|
| 4655 | + $details .= Display::return_icon('2rightarrow_na.png', get_lang('Details')); |
|
| 4656 | 4656 | } else { |
| 4657 | 4657 | $details = '<a href="'.api_get_self().'?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'">'; |
| 4658 | 4658 | $details .= Display::return_icon('2rightarrow.png', get_lang('Details')); |
@@ -4775,7 +4775,7 @@ discard block |
||
| 4775 | 4775 | ); |
| 4776 | 4776 | |
| 4777 | 4777 | $latest_attempt_url = ''; |
| 4778 | - $best_score = $position = $percentage_score_result = '-'; |
|
| 4778 | + $best_score = $position = $percentage_score_result = '-'; |
|
| 4779 | 4779 | $graph = $normal_graph = null; |
| 4780 | 4780 | |
| 4781 | 4781 | // Getting best results |
@@ -4811,7 +4811,7 @@ discard block |
||
| 4811 | 4811 | $percentage_score_result = Display::url(ExerciseLib::show_score($score, $weighting), $latest_attempt_url); |
| 4812 | 4812 | $my_score = 0; |
| 4813 | 4813 | if (!empty($weighting) && intval($weighting) != 0) { |
| 4814 | - $my_score = $score/$weighting; |
|
| 4814 | + $my_score = $score / $weighting; |
|
| 4815 | 4815 | } |
| 4816 | 4816 | //@todo this function slows the page |
| 4817 | 4817 | $position = ExerciseLib::get_exercise_result_ranking($my_score, $exe_id, $exercices['id'], $course_info['code'], $session_id, $user_list); |
@@ -4822,14 +4822,14 @@ discard block |
||
| 4822 | 4822 | } |
| 4823 | 4823 | $html .= Display::div( |
| 4824 | 4824 | $normal_graph, |
| 4825 | - array('id'=>'main_graph_'.$exercices['id'],'class'=>'dialog', 'style'=>'display:none') |
|
| 4825 | + array('id'=>'main_graph_'.$exercices['id'], 'class'=>'dialog', 'style'=>'display:none') |
|
| 4826 | 4826 | ); |
| 4827 | 4827 | |
| 4828 | 4828 | if (empty($graph)) { |
| 4829 | 4829 | $graph = '-'; |
| 4830 | 4830 | } else { |
| 4831 | 4831 | $graph = Display::url( |
| 4832 | - '<img src="' . $graph . '" >', |
|
| 4832 | + '<img src="'.$graph.'" >', |
|
| 4833 | 4833 | $normal_graph, |
| 4834 | 4834 | array( |
| 4835 | 4835 | 'id' => $exercices['id'], |
@@ -4862,7 +4862,7 @@ discard block |
||
| 4862 | 4862 | |
| 4863 | 4863 | |
| 4864 | 4864 | // LP table results |
| 4865 | - $html .='<table class="data_table">'; |
|
| 4865 | + $html .= '<table class="data_table">'; |
|
| 4866 | 4866 | $html .= Display::tag('th', get_lang('Learnpaths'), array('class'=>'head', 'style'=>'color:#000')); |
| 4867 | 4867 | $html .= Display::tag('th', get_lang('LatencyTimeSpent'), array('class'=>'head', 'style'=>'color:#000')); |
| 4868 | 4868 | $html .= Display::tag('th', get_lang('Progress'), array('class'=>'head', 'style'=>'color:#000')); |
@@ -4916,7 +4916,7 @@ discard block |
||
| 4916 | 4916 | if (!empty($last_connection_in_lp)) { |
| 4917 | 4917 | $last_connection = api_convert_and_format_date($last_connection_in_lp, DATE_TIME_FORMAT_LONG); |
| 4918 | 4918 | } |
| 4919 | - $html .= Display::tag('td', $last_connection, array('align'=>'center','width'=>'180px')); |
|
| 4919 | + $html .= Display::tag('td', $last_connection, array('align'=>'center', 'width'=>'180px')); |
|
| 4920 | 4920 | $html .= "</tr>"; |
| 4921 | 4921 | } |
| 4922 | 4922 | } else { |
@@ -4926,7 +4926,7 @@ discard block |
||
| 4926 | 4926 | </td> |
| 4927 | 4927 | </tr>'; |
| 4928 | 4928 | } |
| 4929 | - $html .='</table>'; |
|
| 4929 | + $html .= '</table>'; |
|
| 4930 | 4930 | } |
| 4931 | 4931 | |
| 4932 | 4932 | return $html; |
@@ -4953,7 +4953,7 @@ discard block |
||
| 4953 | 4953 | $myData->setSerieDescription('Serie1', get_lang('MyResults')); |
| 4954 | 4954 | $myData->setSerieDescription('Serie2', get_lang('AverageScore')); |
| 4955 | 4955 | $myData->setAxisUnit(0, '%'); |
| 4956 | - $myData->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
| 4956 | + $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
| 4957 | 4957 | // Cache definition |
| 4958 | 4958 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
| 4959 | 4959 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
@@ -4961,9 +4961,9 @@ discard block |
||
| 4961 | 4961 | |
| 4962 | 4962 | if ($myCache->isInCache($chartHash)) { |
| 4963 | 4963 | //if we already created the img |
| 4964 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 4964 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 4965 | 4965 | $myCache->saveFromCache($chartHash, $imgPath); |
| 4966 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 4966 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 4967 | 4967 | } else { |
| 4968 | 4968 | /* Define width, height and angle */ |
| 4969 | 4969 | $mainWidth = 860; |
@@ -4992,7 +4992,7 @@ discard block |
||
| 4992 | 4992 | /* Set the default font */ |
| 4993 | 4993 | $myPicture->setFontProperties( |
| 4994 | 4994 | array( |
| 4995 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
| 4995 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
| 4996 | 4996 | 'FontSize' => 10) |
| 4997 | 4997 | ); |
| 4998 | 4998 | /* Write the chart title */ |
@@ -5009,7 +5009,7 @@ discard block |
||
| 5009 | 5009 | /* Set the default font */ |
| 5010 | 5010 | $myPicture->setFontProperties( |
| 5011 | 5011 | array( |
| 5012 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
| 5012 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
| 5013 | 5013 | 'FontSize' => 6 |
| 5014 | 5014 | ) |
| 5015 | 5015 | ); |
@@ -5051,7 +5051,7 @@ discard block |
||
| 5051 | 5051 | /* Draw the line chart */ |
| 5052 | 5052 | $myPicture->setFontProperties( |
| 5053 | 5053 | array( |
| 5054 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
| 5054 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
| 5055 | 5055 | 'FontSize' => 10 |
| 5056 | 5056 | ) |
| 5057 | 5057 | ); |
@@ -5084,12 +5084,12 @@ discard block |
||
| 5084 | 5084 | ); |
| 5085 | 5085 | |
| 5086 | 5086 | $myCache->writeToCache($chartHash, $myPicture); |
| 5087 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 5087 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 5088 | 5088 | $myCache->saveFromCache($chartHash, $imgPath); |
| 5089 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 5089 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 5090 | 5090 | } |
| 5091 | 5091 | |
| 5092 | - $html = '<img src="' . $imgPath . '">'; |
|
| 5092 | + $html = '<img src="'.$imgPath.'">'; |
|
| 5093 | 5093 | |
| 5094 | 5094 | return $html; |
| 5095 | 5095 | } |
@@ -5110,12 +5110,12 @@ discard block |
||
| 5110 | 5110 | |
| 5111 | 5111 | foreach ($attempts as $attempt) { |
| 5112 | 5112 | if (api_get_user_id() == $attempt['exe_user_id']) { |
| 5113 | - if ($attempt['exe_weighting'] != 0 ) { |
|
| 5114 | - $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5113 | + if ($attempt['exe_weighting'] != 0) { |
|
| 5114 | + $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
| 5115 | 5115 | } |
| 5116 | 5116 | } else { |
| 5117 | - if ($attempt['exe_weighting'] != 0 ) { |
|
| 5118 | - $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5117 | + if ($attempt['exe_weighting'] != 0) { |
|
| 5118 | + $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
| 5119 | 5119 | } |
| 5120 | 5120 | } |
| 5121 | 5121 | } |
@@ -5124,27 +5124,27 @@ discard block |
||
| 5124 | 5124 | rsort($my_exercise_result_array); |
| 5125 | 5125 | $my_exercise_result = 0; |
| 5126 | 5126 | if (isset($my_exercise_result_array[0])) { |
| 5127 | - $my_exercise_result = $my_exercise_result_array[0] *100; |
|
| 5127 | + $my_exercise_result = $my_exercise_result_array[0] * 100; |
|
| 5128 | 5128 | } |
| 5129 | 5129 | |
| 5130 | 5130 | $max = 100; |
| 5131 | - $pieces = 5 ; |
|
| 5131 | + $pieces = 5; |
|
| 5132 | 5132 | $part = round($max / $pieces); |
| 5133 | 5133 | $x_axis = array(); |
| 5134 | 5134 | $final_array = array(); |
| 5135 | 5135 | $my_final_array = array(); |
| 5136 | 5136 | |
| 5137 | - for ($i=1; $i <=$pieces; $i++) { |
|
| 5137 | + for ($i = 1; $i <= $pieces; $i++) { |
|
| 5138 | 5138 | $sum = 1; |
| 5139 | 5139 | if ($i == 1) { |
| 5140 | 5140 | $sum = 0; |
| 5141 | 5141 | } |
| 5142 | - $min = ($i-1)*$part + $sum; |
|
| 5143 | - $max = ($i)*$part; |
|
| 5144 | - $x_axis[]= $min." - ".$max; |
|
| 5142 | + $min = ($i - 1) * $part + $sum; |
|
| 5143 | + $max = ($i) * $part; |
|
| 5144 | + $x_axis[] = $min." - ".$max; |
|
| 5145 | 5145 | $count = 0; |
| 5146 | - foreach($exercise_result as $result) { |
|
| 5147 | - $percentage = $result*100; |
|
| 5146 | + foreach ($exercise_result as $result) { |
|
| 5147 | + $percentage = $result * 100; |
|
| 5148 | 5148 | //echo $percentage.' - '.$min.' - '.$max."<br />"; |
| 5149 | 5149 | if ($percentage >= $min && $percentage <= $max) { |
| 5150 | 5150 | //echo ' is > '; |
@@ -5152,7 +5152,7 @@ discard block |
||
| 5152 | 5152 | } |
| 5153 | 5153 | } |
| 5154 | 5154 | //echo '<br />'; |
| 5155 | - $final_array[]= $count; |
|
| 5155 | + $final_array[] = $count; |
|
| 5156 | 5156 | |
| 5157 | 5157 | if ($my_exercise_result >= $min && $my_exercise_result <= $max) { |
| 5158 | 5158 | $my_final_array[] = 1; |
@@ -5162,9 +5162,9 @@ discard block |
||
| 5162 | 5162 | } |
| 5163 | 5163 | |
| 5164 | 5164 | //Fix to remove the data of the user with my data |
| 5165 | - for($i = 0; $i<=count($my_final_array); $i++) { |
|
| 5165 | + for ($i = 0; $i <= count($my_final_array); $i++) { |
|
| 5166 | 5166 | if (!empty($my_final_array[$i])) { |
| 5167 | - $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
| 5167 | + $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
| 5168 | 5168 | $final_array[$i] = 0; |
| 5169 | 5169 | } |
| 5170 | 5170 | } |
@@ -5174,16 +5174,16 @@ discard block |
||
| 5174 | 5174 | $dataSet->addPoints($final_array, 'Serie1'); |
| 5175 | 5175 | $dataSet->addPoints($my_final_array, 'Serie2'); |
| 5176 | 5176 | $dataSet->normalize(100, "%"); |
| 5177 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
| 5177 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
| 5178 | 5178 | |
| 5179 | 5179 | // Cache definition |
| 5180 | 5180 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
| 5181 | 5181 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
| 5182 | 5182 | $chartHash = $myCache->getHash($dataSet); |
| 5183 | 5183 | if ($myCache->isInCache($chartHash)) { |
| 5184 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 5184 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 5185 | 5185 | $myCache->saveFromCache($chartHash, $imgPath); |
| 5186 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 5186 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 5187 | 5187 | } else { |
| 5188 | 5188 | /* Create the pChart object */ |
| 5189 | 5189 | $widthSize = 80; |
@@ -5199,7 +5199,7 @@ discard block |
||
| 5199 | 5199 | $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); |
| 5200 | 5200 | |
| 5201 | 5201 | /* Set the default font */ |
| 5202 | - $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize)); |
|
| 5202 | + $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize)); |
|
| 5203 | 5203 | |
| 5204 | 5204 | /* Do not write the chart title */ |
| 5205 | 5205 | |
@@ -5263,9 +5263,9 @@ discard block |
||
| 5263 | 5263 | |
| 5264 | 5264 | /* Save and write in cache */ |
| 5265 | 5265 | $myCache->writeToCache($chartHash, $myPicture); |
| 5266 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 5266 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 5267 | 5267 | $myCache->saveFromCache($chartHash, $imgPath); |
| 5268 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 5268 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 5269 | 5269 | } |
| 5270 | 5270 | |
| 5271 | 5271 | return $imgPath; |
@@ -5285,12 +5285,12 @@ discard block |
||
| 5285 | 5285 | } |
| 5286 | 5286 | foreach ($attempts as $attempt) { |
| 5287 | 5287 | if (api_get_user_id() == $attempt['exe_user_id']) { |
| 5288 | - if ($attempt['exe_weighting'] != 0 ) { |
|
| 5289 | - $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5288 | + if ($attempt['exe_weighting'] != 0) { |
|
| 5289 | + $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
| 5290 | 5290 | } |
| 5291 | 5291 | } else { |
| 5292 | - if ($attempt['exe_weighting'] != 0 ) { |
|
| 5293 | - $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5292 | + if ($attempt['exe_weighting'] != 0) { |
|
| 5293 | + $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting']; |
|
| 5294 | 5294 | } |
| 5295 | 5295 | } |
| 5296 | 5296 | } |
@@ -5299,32 +5299,32 @@ discard block |
||
| 5299 | 5299 | rsort($my_exercise_result_array); |
| 5300 | 5300 | $my_exercise_result = 0; |
| 5301 | 5301 | if (isset($my_exercise_result_array[0])) { |
| 5302 | - $my_exercise_result = $my_exercise_result_array[0] *100; |
|
| 5302 | + $my_exercise_result = $my_exercise_result_array[0] * 100; |
|
| 5303 | 5303 | } |
| 5304 | 5304 | |
| 5305 | 5305 | $max = 100; |
| 5306 | - $pieces = 5 ; |
|
| 5306 | + $pieces = 5; |
|
| 5307 | 5307 | $part = round($max / $pieces); |
| 5308 | 5308 | $x_axis = array(); |
| 5309 | 5309 | $final_array = array(); |
| 5310 | 5310 | $my_final_array = array(); |
| 5311 | 5311 | |
| 5312 | - for ($i=1; $i <=$pieces; $i++) { |
|
| 5312 | + for ($i = 1; $i <= $pieces; $i++) { |
|
| 5313 | 5313 | $sum = 1; |
| 5314 | 5314 | if ($i == 1) { |
| 5315 | 5315 | $sum = 0; |
| 5316 | 5316 | } |
| 5317 | - $min = ($i-1)*$part + $sum; |
|
| 5318 | - $max = ($i)*$part; |
|
| 5319 | - $x_axis[]= $min." - ".$max; |
|
| 5317 | + $min = ($i - 1) * $part + $sum; |
|
| 5318 | + $max = ($i) * $part; |
|
| 5319 | + $x_axis[] = $min." - ".$max; |
|
| 5320 | 5320 | $count = 0; |
| 5321 | - foreach($exercise_result as $result) { |
|
| 5322 | - $percentage = $result*100; |
|
| 5321 | + foreach ($exercise_result as $result) { |
|
| 5322 | + $percentage = $result * 100; |
|
| 5323 | 5323 | if ($percentage >= $min && $percentage <= $max) { |
| 5324 | 5324 | $count++; |
| 5325 | 5325 | } |
| 5326 | 5326 | } |
| 5327 | - $final_array[]= $count; |
|
| 5327 | + $final_array[] = $count; |
|
| 5328 | 5328 | |
| 5329 | 5329 | if ($my_exercise_result >= $min && $my_exercise_result <= $max) { |
| 5330 | 5330 | $my_final_array[] = 1; |
@@ -5335,9 +5335,9 @@ discard block |
||
| 5335 | 5335 | |
| 5336 | 5336 | //Fix to remove the data of the user with my data |
| 5337 | 5337 | |
| 5338 | - for($i = 0; $i<=count($my_final_array); $i++) { |
|
| 5338 | + for ($i = 0; $i <= count($my_final_array); $i++) { |
|
| 5339 | 5339 | if (!empty($my_final_array[$i])) { |
| 5340 | - $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
| 5340 | + $my_final_array[$i] = $final_array[$i] + 1; //Add my result |
|
| 5341 | 5341 | $final_array[$i] = 0; |
| 5342 | 5342 | } |
| 5343 | 5343 | } |
@@ -5355,7 +5355,7 @@ discard block |
||
| 5355 | 5355 | $dataSet->setXAxisName(get_lang('Score')); |
| 5356 | 5356 | $dataSet->normalize(100, "%"); |
| 5357 | 5357 | |
| 5358 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
| 5358 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
| 5359 | 5359 | |
| 5360 | 5360 | // Cache definition |
| 5361 | 5361 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
@@ -5363,9 +5363,9 @@ discard block |
||
| 5363 | 5363 | $chartHash = $myCache->getHash($dataSet); |
| 5364 | 5364 | |
| 5365 | 5365 | if ($myCache->isInCache($chartHash)) { |
| 5366 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 5366 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 5367 | 5367 | $myCache->saveFromCache($chartHash, $imgPath); |
| 5368 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 5368 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 5369 | 5369 | } else { |
| 5370 | 5370 | /* Create the pChart object */ |
| 5371 | 5371 | $widthSize = 480; |
@@ -5381,7 +5381,7 @@ discard block |
||
| 5381 | 5381 | $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); |
| 5382 | 5382 | |
| 5383 | 5383 | /* Set the default font */ |
| 5384 | - $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
| 5384 | + $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
| 5385 | 5385 | |
| 5386 | 5386 | /* Write the chart title */ |
| 5387 | 5387 | $myPicture->drawText( |
@@ -5440,9 +5440,9 @@ discard block |
||
| 5440 | 5440 | |
| 5441 | 5441 | /* Write and save into cache */ |
| 5442 | 5442 | $myCache->writeToCache($chartHash, $myPicture); |
| 5443 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
| 5443 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
| 5444 | 5444 | $myCache->saveFromCache($chartHash, $imgPath); |
| 5445 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
| 5445 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
| 5446 | 5446 | } |
| 5447 | 5447 | |
| 5448 | 5448 | return $imgPath; |
@@ -5568,7 +5568,7 @@ discard block |
||
| 5568 | 5568 | $whereSessionParams .= $sessionIdx.','; |
| 5569 | 5569 | } |
| 5570 | 5570 | } |
| 5571 | - $whereSessionParams = substr($whereSessionParams,0,-1); |
|
| 5571 | + $whereSessionParams = substr($whereSessionParams, 0, -1); |
|
| 5572 | 5572 | } |
| 5573 | 5573 | |
| 5574 | 5574 | if (!empty($exerciseId)) { |
@@ -5629,7 +5629,7 @@ discard block |
||
| 5629 | 5629 | qq.position = rq.question_order AND |
| 5630 | 5630 | ta.question_id = rq.question_id |
| 5631 | 5631 | WHERE |
| 5632 | - te.c_id = $courseIdx ".(empty($whereSessionParams)?'':"AND te.session_id IN ($whereSessionParams)")." |
|
| 5632 | + te.c_id = $courseIdx ".(empty($whereSessionParams) ? '' : "AND te.session_id IN ($whereSessionParams)")." |
|
| 5633 | 5633 | AND q.c_id = $courseIdx |
| 5634 | 5634 | $where $order $limit"; |
| 5635 | 5635 | $sql_query = vsprintf($sql, $whereParams); |
@@ -5677,7 +5677,7 @@ discard block |
||
| 5677 | 5677 | // Now fill users data |
| 5678 | 5678 | $sqlUsers = "SELECT user_id, username, lastname, firstname |
| 5679 | 5679 | FROM $tuser |
| 5680 | - WHERE user_id IN (".implode(',',$userIds).")"; |
|
| 5680 | + WHERE user_id IN (".implode(',', $userIds).")"; |
|
| 5681 | 5681 | $resUsers = Database::query($sqlUsers); |
| 5682 | 5682 | while ($rowUser = Database::fetch_assoc($resUsers)) { |
| 5683 | 5683 | $users[$rowUser['user_id']] = $rowUser; |
@@ -5738,7 +5738,7 @@ discard block |
||
| 5738 | 5738 | WHERE |
| 5739 | 5739 | track_resource.c_id = $course_id AND |
| 5740 | 5740 | track_resource.insert_user_id = user.user_id AND |
| 5741 | - session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
| 5741 | + session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
| 5742 | 5742 | |
| 5743 | 5743 | if (isset($_GET['keyword'])) { |
| 5744 | 5744 | $keyword = Database::escape_string(trim($_GET['keyword'])); |
@@ -5796,7 +5796,7 @@ discard block |
||
| 5796 | 5796 | WHERE |
| 5797 | 5797 | track_resource.c_id = $course_id AND |
| 5798 | 5798 | track_resource.insert_user_id = user.user_id AND |
| 5799 | - session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
| 5799 | + session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id "); |
|
| 5800 | 5800 | |
| 5801 | 5801 | if (isset($_GET['keyword'])) { |
| 5802 | 5802 | $keyword = Database::escape_string(trim($_GET['keyword'])); |
@@ -6090,7 +6090,7 @@ discard block |
||
| 6090 | 6090 | public static function display_additional_profile_fields() |
| 6091 | 6091 | { |
| 6092 | 6092 | // getting all the extra profile fields that are defined by the platform administrator |
| 6093 | - $extra_fields = UserManager :: get_extra_fields(0,50,5,'ASC'); |
|
| 6093 | + $extra_fields = UserManager :: get_extra_fields(0, 50, 5, 'ASC'); |
|
| 6094 | 6094 | |
| 6095 | 6095 | // creating the form |
| 6096 | 6096 | $return = '<form action="courseLog.php" method="get" name="additional_profile_field_form" id="additional_profile_field_form">'; |
@@ -6102,8 +6102,8 @@ discard block |
||
| 6102 | 6102 | $extra_fields_to_show = 0; |
| 6103 | 6103 | foreach ($extra_fields as $key=>$field) { |
| 6104 | 6104 | // show only extra fields that are visible + and can be filtered, added by J.Montoya |
| 6105 | - if ($field[6]==1 && $field[8] == 1) { |
|
| 6106 | - if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field'] ) { |
|
| 6105 | + if ($field[6] == 1 && $field[8] == 1) { |
|
| 6106 | + if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field']) { |
|
| 6107 | 6107 | $selected = 'selected="selected"'; |
| 6108 | 6108 | } else { |
| 6109 | 6109 | $selected = ''; |
@@ -6115,8 +6115,8 @@ discard block |
||
| 6115 | 6115 | $return .= '</select>'; |
| 6116 | 6116 | |
| 6117 | 6117 | // the form elements for the $_GET parameters (because the form is passed through GET |
| 6118 | - foreach ($_GET as $key=>$value){ |
|
| 6119 | - if ($key <> 'additional_profile_field') { |
|
| 6118 | + foreach ($_GET as $key=>$value) { |
|
| 6119 | + if ($key <> 'additional_profile_field') { |
|
| 6120 | 6120 | $return .= '<input type="hidden" name="'.Security::remove_XSS($key).'" value="'.Security::remove_XSS($value).'" />'; |
| 6121 | 6121 | } |
| 6122 | 6122 | } |
@@ -6153,21 +6153,21 @@ discard block |
||
| 6153 | 6153 | $result_extra_field = UserManager::get_extra_field_information($field_id); |
| 6154 | 6154 | |
| 6155 | 6155 | if (!empty($users)) { |
| 6156 | - if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG ) { |
|
| 6157 | - foreach($users as $user_id) { |
|
| 6156 | + if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG) { |
|
| 6157 | + foreach ($users as $user_id) { |
|
| 6158 | 6158 | $user_result = UserManager::get_user_tags($user_id, $field_id); |
| 6159 | 6159 | $tag_list = array(); |
| 6160 | - foreach($user_result as $item) { |
|
| 6160 | + foreach ($user_result as $item) { |
|
| 6161 | 6161 | $tag_list[] = $item['tag']; |
| 6162 | 6162 | } |
| 6163 | - $return[$user_id][] = implode(', ',$tag_list); |
|
| 6163 | + $return[$user_id][] = implode(', ', $tag_list); |
|
| 6164 | 6164 | } |
| 6165 | 6165 | } else { |
| 6166 | 6166 | $new_user_array = array(); |
| 6167 | 6167 | foreach ($users as $user_id) { |
| 6168 | - $new_user_array[]= "'".$user_id."'"; |
|
| 6168 | + $new_user_array[] = "'".$user_id."'"; |
|
| 6169 | 6169 | } |
| 6170 | - $users = implode(',',$new_user_array); |
|
| 6170 | + $users = implode(',', $new_user_array); |
|
| 6171 | 6171 | $extraFieldType = EntityExtraField::USER_FIELD_TYPE; |
| 6172 | 6172 | // Selecting only the necessary information NOT ALL the user list |
| 6173 | 6173 | $sql = "SELECT user.user_id, v.value |
@@ -6182,7 +6182,7 @@ discard block |
||
| 6182 | 6182 | user.user_id IN ($users)"; |
| 6183 | 6183 | |
| 6184 | 6184 | $result = Database::query($sql); |
| 6185 | - while($row = Database::fetch_array($result)) { |
|
| 6185 | + while ($row = Database::fetch_array($result)) { |
|
| 6186 | 6186 | // get option value for field type double select by id |
| 6187 | 6187 | if (!empty($row['value'])) { |
| 6188 | 6188 | if ($result_extra_field['field_type'] == |
@@ -6221,7 +6221,7 @@ discard block |
||
| 6221 | 6221 | |
| 6222 | 6222 | public function sort_users_desc($a, $b) |
| 6223 | 6223 | { |
| 6224 | - return strcmp( trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']]))); |
|
| 6224 | + return strcmp(trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']]))); |
|
| 6225 | 6225 | } |
| 6226 | 6226 | |
| 6227 | 6227 | /** |
@@ -6256,7 +6256,7 @@ discard block |
||
| 6256 | 6256 | // get all users data from a course for sortable with limit |
| 6257 | 6257 | if (is_array($user_ids)) { |
| 6258 | 6258 | $user_ids = array_map('intval', $user_ids); |
| 6259 | - $condition_user = " WHERE user.user_id IN (".implode(',',$user_ids).") "; |
|
| 6259 | + $condition_user = " WHERE user.user_id IN (".implode(',', $user_ids).") "; |
|
| 6260 | 6260 | } else { |
| 6261 | 6261 | $user_ids = intval($user_ids); |
| 6262 | 6262 | $condition_user = " WHERE user.user_id = $user_ids "; |
@@ -6264,7 +6264,7 @@ discard block |
||
| 6264 | 6264 | |
| 6265 | 6265 | if (!empty($_GET['user_keyword'])) { |
| 6266 | 6266 | $keyword = trim(Database::escape_string($_GET['user_keyword'])); |
| 6267 | - $condition_user .= " AND ( |
|
| 6267 | + $condition_user .= " AND ( |
|
| 6268 | 6268 | user.firstname LIKE '%".$keyword."%' OR |
| 6269 | 6269 | user.lastname LIKE '%".$keyword."%' OR |
| 6270 | 6270 | user.username LIKE '%".$keyword."%' OR |
@@ -6282,7 +6282,7 @@ discard block |
||
| 6282 | 6282 | $invitedUsersCondition = ''; |
| 6283 | 6283 | |
| 6284 | 6284 | if (!$includeInvitedUsers) { |
| 6285 | - $invitedUsersCondition = " AND user.status != " . INVITEE; |
|
| 6285 | + $invitedUsersCondition = " AND user.status != ".INVITEE; |
|
| 6286 | 6286 | } |
| 6287 | 6287 | |
| 6288 | 6288 | $sql = "SELECT user.user_id as user_id, |
@@ -6293,7 +6293,7 @@ discard block |
||
| 6293 | 6293 | FROM $tbl_user as user $url_table |
| 6294 | 6294 | $condition_user $url_condition $invitedUsersCondition"; |
| 6295 | 6295 | |
| 6296 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
| 6296 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
| 6297 | 6297 | $direction = 'ASC'; |
| 6298 | 6298 | } |
| 6299 | 6299 | |
@@ -6430,7 +6430,7 @@ discard block |
||
| 6430 | 6430 | } |
| 6431 | 6431 | |
| 6432 | 6432 | if (empty($session_id)) { |
| 6433 | - $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0) .' / '.$total_surveys; |
|
| 6433 | + $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0).' / '.$total_surveys; |
|
| 6434 | 6434 | } |
| 6435 | 6435 | |
| 6436 | 6436 | $user['link'] = '<center> |
@@ -6442,34 +6442,34 @@ discard block |
||
| 6442 | 6442 | // store columns in array $users |
| 6443 | 6443 | $is_western_name_order = api_is_western_name_order(); |
| 6444 | 6444 | $user_row = array(); |
| 6445 | - $user_row[]= $user['official_code']; //0 |
|
| 6445 | + $user_row[] = $user['official_code']; //0 |
|
| 6446 | 6446 | if ($is_western_name_order) { |
| 6447 | - $user_row[]= $user['firstname']; |
|
| 6448 | - $user_row[]= $user['lastname']; |
|
| 6447 | + $user_row[] = $user['firstname']; |
|
| 6448 | + $user_row[] = $user['lastname']; |
|
| 6449 | 6449 | } else { |
| 6450 | - $user_row[]= $user['lastname']; |
|
| 6451 | - $user_row[]= $user['firstname']; |
|
| 6450 | + $user_row[] = $user['lastname']; |
|
| 6451 | + $user_row[] = $user['firstname']; |
|
| 6452 | 6452 | } |
| 6453 | - $user_row[]= $user['username']; |
|
| 6454 | - $user_row[]= $user['time']; |
|
| 6455 | - $user_row[]= $user['average_progress']; |
|
| 6456 | - $user_row[]= $user['exercise_progress']; |
|
| 6457 | - $user_row[]= $user['exercise_average_best_attempt']; |
|
| 6458 | - $user_row[]= $user['student_score']; |
|
| 6459 | - $user_row[]= $user['count_assignments']; |
|
| 6460 | - $user_row[]= $user['count_messages']; |
|
| 6453 | + $user_row[] = $user['username']; |
|
| 6454 | + $user_row[] = $user['time']; |
|
| 6455 | + $user_row[] = $user['average_progress']; |
|
| 6456 | + $user_row[] = $user['exercise_progress']; |
|
| 6457 | + $user_row[] = $user['exercise_average_best_attempt']; |
|
| 6458 | + $user_row[] = $user['student_score']; |
|
| 6459 | + $user_row[] = $user['count_assignments']; |
|
| 6460 | + $user_row[] = $user['count_messages']; |
|
| 6461 | 6461 | |
| 6462 | 6462 | if (empty($session_id)) { |
| 6463 | - $user_row[]= $user['survey']; |
|
| 6463 | + $user_row[] = $user['survey']; |
|
| 6464 | 6464 | } |
| 6465 | 6465 | |
| 6466 | - $user_row[]= $user['first_connection']; |
|
| 6467 | - $user_row[]= $user['last_connection']; |
|
| 6466 | + $user_row[] = $user['first_connection']; |
|
| 6467 | + $user_row[] = $user['last_connection']; |
|
| 6468 | 6468 | if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) { |
| 6469 | - $user_row[]= $user['additional']; |
|
| 6469 | + $user_row[] = $user['additional']; |
|
| 6470 | 6470 | } |
| 6471 | 6471 | |
| 6472 | - $user_row[]= $user['link']; |
|
| 6472 | + $user_row[] = $user['link']; |
|
| 6473 | 6473 | |
| 6474 | 6474 | $users[] = $user_row; |
| 6475 | 6475 | |
@@ -6514,8 +6514,8 @@ discard block |
||
| 6514 | 6514 | |
| 6515 | 6515 | $track_access_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
| 6516 | 6516 | $tempView = $view; |
| 6517 | - if(substr($view,0,1) == '1') { |
|
| 6518 | - $new_view = substr_replace($view,'0',0,1); |
|
| 6517 | + if (substr($view, 0, 1) == '1') { |
|
| 6518 | + $new_view = substr_replace($view, '0', 0, 1); |
|
| 6519 | 6519 | echo " |
| 6520 | 6520 | <tr> |
| 6521 | 6521 | <td valign='top'> |
@@ -6548,9 +6548,9 @@ discard block |
||
| 6548 | 6548 | </tr>"; |
| 6549 | 6549 | $total = 0; |
| 6550 | 6550 | if (is_array($results)) { |
| 6551 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 6551 | + for ($j = 0; $j < count($results); $j++) { |
|
| 6552 | 6552 | echo "<tr>"; |
| 6553 | - 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>"; |
|
| 6553 | + 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>"; |
|
| 6554 | 6554 | echo "<td valign='top' align='right' class='content'>".$results[$j][1]."</td>"; |
| 6555 | 6555 | echo"</tr>"; |
| 6556 | 6556 | $total = $total + $results[$j][1]; |
@@ -6567,7 +6567,7 @@ discard block |
||
| 6567 | 6567 | echo "</table>"; |
| 6568 | 6568 | echo "</td></tr>"; |
| 6569 | 6569 | } else { |
| 6570 | - $new_view = substr_replace($view,'1',0,1); |
|
| 6570 | + $new_view = substr_replace($view, '1', 0, 1); |
|
| 6571 | 6571 | echo " |
| 6572 | 6572 | <tr> |
| 6573 | 6573 | <td valign='top'> |
@@ -6590,8 +6590,8 @@ discard block |
||
| 6590 | 6590 | { |
| 6591 | 6591 | global $TBL_TRACK_HOTPOTATOES, $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $dateTimeFormatLong; |
| 6592 | 6592 | $courseId = api_get_course_int_id($courseCode); |
| 6593 | - if(substr($view,1,1) == '1') { |
|
| 6594 | - $new_view = substr_replace($view,'0',1,1); |
|
| 6593 | + if (substr($view, 1, 1) == '1') { |
|
| 6594 | + $new_view = substr_replace($view, '0', 1, 1); |
|
| 6595 | 6595 | echo "<tr> |
| 6596 | 6596 | <td valign='top'> |
| 6597 | 6597 | <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>] |
@@ -6633,7 +6633,7 @@ discard block |
||
| 6633 | 6633 | </tr>"; |
| 6634 | 6634 | |
| 6635 | 6635 | if (is_array($results)) { |
| 6636 | - for($i = 0; $i < sizeof($results); $i++) { |
|
| 6636 | + for ($i = 0; $i < sizeof($results); $i++) { |
|
| 6637 | 6637 | $display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get()); |
| 6638 | 6638 | echo "<tr>\n"; |
| 6639 | 6639 | echo "<td class='content'>".$results[$i][0]."</td>\n"; |
@@ -6648,8 +6648,8 @@ discard block |
||
| 6648 | 6648 | |
| 6649 | 6649 | // The Result of Tests |
| 6650 | 6650 | if (is_array($hpresults)) { |
| 6651 | - for($i = 0; $i < sizeof($hpresults); $i++) { |
|
| 6652 | - $title = GetQuizName($hpresults[$i][0],''); |
|
| 6651 | + for ($i = 0; $i < sizeof($hpresults); $i++) { |
|
| 6652 | + $title = GetQuizName($hpresults[$i][0], ''); |
|
| 6653 | 6653 | if ($title == '') |
| 6654 | 6654 | $title = basename($hpresults[$i][0]); |
| 6655 | 6655 | $display_date = api_convert_and_format_date($hpresults[$i][3], null, date_default_timezone_get()); |
@@ -6675,7 +6675,7 @@ discard block |
||
| 6675 | 6675 | echo "</table>"; |
| 6676 | 6676 | echo "</td>\n</tr>\n"; |
| 6677 | 6677 | } else { |
| 6678 | - $new_view = substr_replace($view,'1',1,1); |
|
| 6678 | + $new_view = substr_replace($view, '1', 1, 1); |
|
| 6679 | 6679 | echo " |
| 6680 | 6680 | <tr> |
| 6681 | 6681 | <td valign='top'> |
@@ -6694,8 +6694,8 @@ discard block |
||
| 6694 | 6694 | global $TABLETRACK_UPLOADS, $TABLECOURSE_WORK; |
| 6695 | 6695 | $_course = api_get_course_info_by_id($course_id); |
| 6696 | 6696 | |
| 6697 | - if (substr($view,2,1) == '1') { |
|
| 6698 | - $new_view = substr_replace($view,'0',2,1); |
|
| 6697 | + if (substr($view, 2, 1) == '1') { |
|
| 6698 | + $new_view = substr_replace($view, '0', 2, 1); |
|
| 6699 | 6699 | echo "<tr> |
| 6700 | 6700 | <td valign='top'> |
| 6701 | 6701 | <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>] |
@@ -6709,7 +6709,7 @@ discard block |
||
| 6709 | 6709 | AND u.c_id = '".intval($course_id)."' |
| 6710 | 6710 | ORDER BY u.upload_date DESC"; |
| 6711 | 6711 | echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>"; |
| 6712 | - $results = StatsUtils::getManyResultsXCol($sql,4); |
|
| 6712 | + $results = StatsUtils::getManyResultsXCol($sql, 4); |
|
| 6713 | 6713 | echo "<table cellpadding='2' cellspacing='1' border='0' align=center>"; |
| 6714 | 6714 | echo "<tr> |
| 6715 | 6715 | <td class='secLine' width='40%'> |
@@ -6723,7 +6723,7 @@ discard block |
||
| 6723 | 6723 | </td> |
| 6724 | 6724 | </tr>"; |
| 6725 | 6725 | if (is_array($results)) { |
| 6726 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 6726 | + for ($j = 0; $j < count($results); $j++) { |
|
| 6727 | 6727 | $pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3]; |
| 6728 | 6728 | $beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get()); |
| 6729 | 6729 | echo "<tr>"; |
@@ -6742,7 +6742,7 @@ discard block |
||
| 6742 | 6742 | echo "</table>"; |
| 6743 | 6743 | echo "</td></tr>"; |
| 6744 | 6744 | } else { |
| 6745 | - $new_view = substr_replace($view,'1',2,1); |
|
| 6745 | + $new_view = substr_replace($view, '1', 2, 1); |
|
| 6746 | 6746 | echo " |
| 6747 | 6747 | <tr> |
| 6748 | 6748 | <td valign='top'> |
@@ -6761,8 +6761,8 @@ discard block |
||
| 6761 | 6761 | { |
| 6762 | 6762 | global $TABLETRACK_LINKS, $TABLECOURSE_LINKS; |
| 6763 | 6763 | $courseId = api_get_course_int_id($courseCode); |
| 6764 | - if (substr($view,3,1) == '1') { |
|
| 6765 | - $new_view = substr_replace($view,'0',3,1); |
|
| 6764 | + if (substr($view, 3, 1) == '1') { |
|
| 6765 | + $new_view = substr_replace($view, '0', 3, 1); |
|
| 6766 | 6766 | echo " |
| 6767 | 6767 | <tr> |
| 6768 | 6768 | <td valign='top'> |
@@ -6786,7 +6786,7 @@ discard block |
||
| 6786 | 6786 | </td> |
| 6787 | 6787 | </tr>"; |
| 6788 | 6788 | if (is_array($results)) { |
| 6789 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 6789 | + for ($j = 0; $j < count($results); $j++) { |
|
| 6790 | 6790 | echo "<tr>"; |
| 6791 | 6791 | echo "<td class='content'><a href='".$results[$j][1]."'>".$results[$j][0]."</a></td>"; |
| 6792 | 6792 | echo"</tr>"; |
@@ -6799,7 +6799,7 @@ discard block |
||
| 6799 | 6799 | echo "</table>"; |
| 6800 | 6800 | echo "</td></tr>"; |
| 6801 | 6801 | } else { |
| 6802 | - $new_view = substr_replace($view,'1',3,1); |
|
| 6802 | + $new_view = substr_replace($view, '1', 3, 1); |
|
| 6803 | 6803 | echo " |
| 6804 | 6804 | <tr> |
| 6805 | 6805 | <td valign='top'> |
@@ -6826,8 +6826,8 @@ discard block |
||
| 6826 | 6826 | $session_id = intval($session_id); |
| 6827 | 6827 | |
| 6828 | 6828 | $downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
| 6829 | - if(substr($view,4,1) == '1') { |
|
| 6830 | - $new_view = substr_replace($view,'0',4,1); |
|
| 6829 | + if (substr($view, 4, 1) == '1') { |
|
| 6830 | + $new_view = substr_replace($view, '0', 4, 1); |
|
| 6831 | 6831 | echo " |
| 6832 | 6832 | <tr> |
| 6833 | 6833 | <td valign='top'> |
@@ -6853,7 +6853,7 @@ discard block |
||
| 6853 | 6853 | </td> |
| 6854 | 6854 | </tr>"; |
| 6855 | 6855 | if (is_array($results)) { |
| 6856 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 6856 | + for ($j = 0; $j < count($results); $j++) { |
|
| 6857 | 6857 | echo "<tr>"; |
| 6858 | 6858 | echo "<td class='content'>".$results[$j]."</td>"; |
| 6859 | 6859 | echo"</tr>"; |
@@ -6866,7 +6866,7 @@ discard block |
||
| 6866 | 6866 | echo "</table>"; |
| 6867 | 6867 | echo "</td></tr>"; |
| 6868 | 6868 | } else { |
| 6869 | - $new_view = substr_replace($view,'1',4,1); |
|
| 6869 | + $new_view = substr_replace($view, '1', 4, 1); |
|
| 6870 | 6870 | echo " |
| 6871 | 6871 | <tr> |
| 6872 | 6872 | <td valign='top'> |
@@ -6900,11 +6900,11 @@ discard block |
||
| 6900 | 6900 | ORDER BY login_date DESC LIMIT 1"; |
| 6901 | 6901 | $ip = ''; |
| 6902 | 6902 | $res_ip = Database::query($sql_ip); |
| 6903 | - if ($res_ip !== false && Database::num_rows($res_ip)>0) { |
|
| 6903 | + if ($res_ip !== false && Database::num_rows($res_ip) > 0) { |
|
| 6904 | 6904 | $row_ip = Database::fetch_row($res_ip); |
| 6905 | 6905 | if ($return_as_link) { |
| 6906 | 6906 | $ip = Display::url( |
| 6907 | - (empty($body_replace)?$row_ip[1]:$body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], |
|
| 6907 | + (empty($body_replace) ? $row_ip[1] : $body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], |
|
| 6908 | 6908 | array('title'=>get_lang('TraceIP'), 'target'=>'_blank') |
| 6909 | 6909 | ); |
| 6910 | 6910 | } else { |
@@ -6940,9 +6940,9 @@ discard block |
||
| 6940 | 6940 | $course_id = intval($course_id); |
| 6941 | 6941 | |
| 6942 | 6942 | $tempView = $view; |
| 6943 | - if (substr($view,0,1) == '1') { |
|
| 6944 | - $new_view = substr_replace($view,'0',0,1); |
|
| 6945 | - $title[1]= get_lang('LoginsAndAccessTools').get_lang('LoginsDetails'); |
|
| 6943 | + if (substr($view, 0, 1) == '1') { |
|
| 6944 | + $new_view = substr_replace($view, '0', 0, 1); |
|
| 6945 | + $title[1] = get_lang('LoginsAndAccessTools').get_lang('LoginsDetails'); |
|
| 6946 | 6946 | $sql = "SELECT UNIX_TIMESTAMP(access_date), count(access_date) |
| 6947 | 6947 | FROM $track_access_table |
| 6948 | 6948 | WHERE access_user_id = $user_id |
@@ -6952,20 +6952,20 @@ discard block |
||
| 6952 | 6952 | ORDER BY YEAR(access_date),MONTH(access_date) ASC"; |
| 6953 | 6953 | //$results = getManyResults2Col($sql); |
| 6954 | 6954 | $results = getManyResults3Col($sql); |
| 6955 | - $title_line= get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n"; |
|
| 6956 | - $line=''; |
|
| 6955 | + $title_line = get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n"; |
|
| 6956 | + $line = ''; |
|
| 6957 | 6957 | $total = 0; |
| 6958 | 6958 | if (is_array($results)) { |
| 6959 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 6959 | + for ($j = 0; $j < count($results); $j++) { |
|
| 6960 | 6960 | $line .= $results[$j][0].';'.$results[$j][1]."\n"; |
| 6961 | 6961 | $total = $total + $results[$j][1]; |
| 6962 | 6962 | } |
| 6963 | 6963 | $line .= get_lang('Total').";".$total."\n"; |
| 6964 | 6964 | } else { |
| 6965 | - $line= get_lang('NoResult')."</center></td>"; |
|
| 6965 | + $line = get_lang('NoResult')."</center></td>"; |
|
| 6966 | 6966 | } |
| 6967 | 6967 | } else { |
| 6968 | - $new_view = substr_replace($view,'1',0,1); |
|
| 6968 | + $new_view = substr_replace($view, '1', 0, 1); |
|
| 6969 | 6969 | } |
| 6970 | 6970 | return array($title_line, $line); |
| 6971 | 6971 | } |
@@ -6983,8 +6983,8 @@ discard block |
||
| 6983 | 6983 | global $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $TABLETRACK_HOTPOTATOES, $dateTimeFormatLong; |
| 6984 | 6984 | $courseId = api_get_course_int_id($courseCode); |
| 6985 | 6985 | $userId = intval($userId); |
| 6986 | - if (substr($view,1,1) == '1') { |
|
| 6987 | - $new_view = substr_replace($view,'0',1,1); |
|
| 6986 | + if (substr($view, 1, 1) == '1') { |
|
| 6987 | + $new_view = substr_replace($view, '0', 1, 1); |
|
| 6988 | 6988 | $title[1] = get_lang('ExercicesDetails'); |
| 6989 | 6989 | $line = ''; |
| 6990 | 6990 | $sql = "SELECT ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date) |
@@ -7008,7 +7008,7 @@ discard block |
||
| 7008 | 7008 | $title_line = get_lang('ExercicesTitleExerciceColumn').";".get_lang('Date').';'.get_lang('ExercicesTitleScoreColumn')."\n"; |
| 7009 | 7009 | |
| 7010 | 7010 | if (is_array($results)) { |
| 7011 | - for($i = 0; $i < sizeof($results); $i++) |
|
| 7011 | + for ($i = 0; $i < sizeof($results); $i++) |
|
| 7012 | 7012 | { |
| 7013 | 7013 | $display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get()); |
| 7014 | 7014 | $line .= $results[$i][0].";".$display_date.";".$results[$i][1]." / ".$results[$i][2]."\n"; |
@@ -7020,8 +7020,8 @@ discard block |
||
| 7020 | 7020 | |
| 7021 | 7021 | // The Result of Tests |
| 7022 | 7022 | if (is_array($hpresults)) { |
| 7023 | - for($i = 0; $i < sizeof($hpresults); $i++) { |
|
| 7024 | - $title = GetQuizName($hpresults[$i][0],''); |
|
| 7023 | + for ($i = 0; $i < sizeof($hpresults); $i++) { |
|
| 7024 | + $title = GetQuizName($hpresults[$i][0], ''); |
|
| 7025 | 7025 | |
| 7026 | 7026 | if ($title == '') |
| 7027 | 7027 | $title = basename($hpresults[$i][0]); |
@@ -7035,10 +7035,10 @@ discard block |
||
| 7035 | 7035 | } |
| 7036 | 7036 | |
| 7037 | 7037 | if ($NoTestRes == 1 && $NoHPTestRes == 1) { |
| 7038 | - $line=get_lang('NoResult'); |
|
| 7038 | + $line = get_lang('NoResult'); |
|
| 7039 | 7039 | } |
| 7040 | 7040 | } else { |
| 7041 | - $new_view = substr_replace($view,'1',1,1); |
|
| 7041 | + $new_view = substr_replace($view, '1', 1, 1); |
|
| 7042 | 7042 | } |
| 7043 | 7043 | return array($title_line, $line); |
| 7044 | 7044 | } |
@@ -7054,7 +7054,7 @@ discard block |
||
| 7054 | 7054 | $user_id = intval($user_id); |
| 7055 | 7055 | $course_id = intval($course_id); |
| 7056 | 7056 | |
| 7057 | - if (substr($view,2,1) == '1') { |
|
| 7057 | + if (substr($view, 2, 1) == '1') { |
|
| 7058 | 7058 | $sql = "SELECT u.upload_date, w.title, w.author, w.url |
| 7059 | 7059 | FROM $TABLETRACK_UPLOADS u , $TABLECOURSE_WORK w |
| 7060 | 7060 | WHERE |
@@ -7062,21 +7062,21 @@ discard block |
||
| 7062 | 7062 | u.upload_user_id = '$user_id' AND |
| 7063 | 7063 | u.c_id = '$course_id' |
| 7064 | 7064 | ORDER BY u.upload_date DESC"; |
| 7065 | - $results = StatsUtils::getManyResultsXCol($sql,4); |
|
| 7065 | + $results = StatsUtils::getManyResultsXCol($sql, 4); |
|
| 7066 | 7066 | |
| 7067 | - $title[1]=get_lang('WorksDetails'); |
|
| 7068 | - $line=''; |
|
| 7069 | - $title_line=get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n"; |
|
| 7067 | + $title[1] = get_lang('WorksDetails'); |
|
| 7068 | + $line = ''; |
|
| 7069 | + $title_line = get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n"; |
|
| 7070 | 7070 | |
| 7071 | 7071 | if (is_array($results)) { |
| 7072 | - for($j = 0 ; $j < count($results) ; $j++) { |
|
| 7072 | + for ($j = 0; $j < count($results); $j++) { |
|
| 7073 | 7073 | $pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3]; |
| 7074 | 7074 | $beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get()); |
| 7075 | 7075 | $line .= $results[$j][1].";".$results[$j][2].";".$beautifulDate."\n"; |
| 7076 | 7076 | } |
| 7077 | 7077 | |
| 7078 | 7078 | } else { |
| 7079 | - $line= get_lang('NoResult'); |
|
| 7079 | + $line = get_lang('NoResult'); |
|
| 7080 | 7080 | } |
| 7081 | 7081 | } |
| 7082 | 7082 | return array($title_line, $line); |
@@ -7092,9 +7092,9 @@ discard block |
||
| 7092 | 7092 | $courseId = api_get_course_int_id($courseCode); |
| 7093 | 7093 | $userId = intval($userId); |
| 7094 | 7094 | $line = null; |
| 7095 | - if (substr($view,3,1) == '1') { |
|
| 7096 | - $new_view = substr_replace($view,'0',3,1); |
|
| 7097 | - $title[1]=get_lang('LinksDetails'); |
|
| 7095 | + if (substr($view, 3, 1) == '1') { |
|
| 7096 | + $new_view = substr_replace($view, '0', 3, 1); |
|
| 7097 | + $title[1] = get_lang('LinksDetails'); |
|
| 7098 | 7098 | $sql = "SELECT cl.title, cl.url |
| 7099 | 7099 | FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl |
| 7100 | 7100 | WHERE sl.links_link_id = cl.id |
@@ -7102,16 +7102,16 @@ discard block |
||
| 7102 | 7102 | AND sl.links_user_id = $userId |
| 7103 | 7103 | GROUP BY cl.title, cl.url"; |
| 7104 | 7104 | $results = StatsUtils::getManyResults2Col($sql); |
| 7105 | - $title_line= get_lang('LinksTitleLinkColumn')."\n"; |
|
| 7105 | + $title_line = get_lang('LinksTitleLinkColumn')."\n"; |
|
| 7106 | 7106 | if (is_array($results)) { |
| 7107 | - for ($j = 0 ; $j < count($results) ; $j++) { |
|
| 7107 | + for ($j = 0; $j < count($results); $j++) { |
|
| 7108 | 7108 | $line .= $results[$j][0]."\n"; |
| 7109 | 7109 | } |
| 7110 | 7110 | } else { |
| 7111 | - $line=get_lang('NoResult'); |
|
| 7111 | + $line = get_lang('NoResult'); |
|
| 7112 | 7112 | } |
| 7113 | 7113 | } else { |
| 7114 | - $new_view = substr_replace($view,'1',3,1); |
|
| 7114 | + $new_view = substr_replace($view, '1', 3, 1); |
|
| 7115 | 7115 | } |
| 7116 | 7116 | return array($title_line, $line); |
| 7117 | 7117 | } |
@@ -7133,9 +7133,9 @@ discard block |
||
| 7133 | 7133 | |
| 7134 | 7134 | $downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
| 7135 | 7135 | |
| 7136 | - if (substr($view,4,1) == '1') { |
|
| 7137 | - $new_view = substr_replace($view,'0',4,1); |
|
| 7138 | - $title[1]= get_lang('DocumentsDetails'); |
|
| 7136 | + if (substr($view, 4, 1) == '1') { |
|
| 7137 | + $new_view = substr_replace($view, '0', 4, 1); |
|
| 7138 | + $title[1] = get_lang('DocumentsDetails'); |
|
| 7139 | 7139 | |
| 7140 | 7140 | $sql = "SELECT down_doc_path |
| 7141 | 7141 | FROM $downloads_table |
@@ -7148,14 +7148,14 @@ discard block |
||
| 7148 | 7148 | $title_line = get_lang('DocumentsTitleDocumentColumn')."\n"; |
| 7149 | 7149 | $line = null; |
| 7150 | 7150 | if (is_array($results)) { |
| 7151 | - for ($j = 0 ; $j < count($results) ; $j++) { |
|
| 7151 | + for ($j = 0; $j < count($results); $j++) { |
|
| 7152 | 7152 | $line .= $results[$j]."\n"; |
| 7153 | 7153 | } |
| 7154 | 7154 | } else { |
| 7155 | 7155 | $line = get_lang('NoResult'); |
| 7156 | 7156 | } |
| 7157 | 7157 | } else { |
| 7158 | - $new_view = substr_replace($view,'1',4,1); |
|
| 7158 | + $new_view = substr_replace($view, '1', 4, 1); |
|
| 7159 | 7159 | } |
| 7160 | 7160 | return array($title_line, $line); |
| 7161 | 7161 | } |