@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if (isset($_SESSION['gradebook'])){ |
175 | - $gradebook= $_SESSION['gradebook']; |
|
175 | + $gradebook= $_SESSION['gradebook']; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | if (!empty($gradebook) && $gradebook=='view') { |
179 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
179 | + $interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | // if admin of course |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | echo '</div>'; |
228 | 228 | |
229 | 229 | if ($displayMessage != "") { |
230 | - Display::display_confirmation_message($displayMessage); |
|
231 | - $displayMessage = ""; |
|
230 | + Display::display_confirmation_message($displayMessage); |
|
231 | + $displayMessage = ""; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | // Form |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | // Title |
237 | 237 | echo '<legend>'.$nameTools.' - '.$titleAdd.'</legend>'; |
238 | 238 | if (isset($type)) { |
239 | - echo '<input type="hidden" name="type" value="1">'; |
|
239 | + echo '<input type="hidden" name="type" value="1">'; |
|
240 | 240 | } |
241 | 241 | echo '<input type="hidden" name="fromExercise" value="'.$fromExercise.'">'; |
242 | 242 | |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | foreach ($course_list as $item) { |
284 | 284 | $courseItemId = $item['real_id']; |
285 | 285 | $courseInfo = api_get_course_info_by_id($courseItemId); |
286 | - $course_select_list[$courseItemId] = ""; |
|
287 | - if ($courseItemId == api_get_course_int_id()) { |
|
288 | - $course_select_list[$courseItemId] = "> "; |
|
289 | - } |
|
290 | - $course_select_list[$courseItemId] .= $courseInfo['title']; |
|
286 | + $course_select_list[$courseItemId] = ""; |
|
287 | + if ($courseItemId == api_get_course_int_id()) { |
|
288 | + $course_select_list[$courseItemId] = "> "; |
|
289 | + } |
|
290 | + $course_select_list[$courseItemId] .= $courseInfo['title']; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | $select_course_html = Display::select( |
@@ -304,11 +304,11 @@ discard block |
||
304 | 304 | // no course selected, reset menu test / difficult� / type de reponse |
305 | 305 | reset_menu_exo_lvl_type(); |
306 | 306 | } else { |
307 | - $course_info = api_get_course_info_by_id($selected_course); |
|
307 | + $course_info = api_get_course_info_by_id($selected_course); |
|
308 | 308 | } |
309 | 309 | // If course has changed, reset the menu default |
310 | 310 | if ($course_id_changed) { |
311 | - reset_menu_exo_lvl_type(); |
|
311 | + reset_menu_exo_lvl_type(); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | $course_id = $course_info['real_id']; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | if ($exercise_id_changed == 1) { |
359 | - reset_menu_lvl_type(); |
|
359 | + reset_menu_lvl_type(); |
|
360 | 360 | } |
361 | 361 | $select_exercise_html = Display::select( |
362 | 362 | 'exerciseId', |
@@ -434,19 +434,19 @@ discard block |
||
434 | 434 | // if we have selected an exercise in the list-box 'Filter' |
435 | 435 | |
436 | 436 | if ($exerciseId > 0) { |
437 | - $where = ''; |
|
438 | - $from = ''; |
|
439 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
440 | - $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
441 | - $where .= " AND crc.c_id=$selected_course AND crc.question_id=qu.id AND crc.category_id=$courseCategoryId"; |
|
442 | - } |
|
443 | - if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
444 | - $where .= ' AND level='.$exerciseLevel; |
|
445 | - } |
|
446 | - if (isset($answerType) && $answerType > 0) { |
|
447 | - $where .= ' AND type='.$answerType; |
|
448 | - } |
|
449 | - $sql = "SELECT DISTINCT |
|
437 | + $where = ''; |
|
438 | + $from = ''; |
|
439 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
440 | + $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
441 | + $where .= " AND crc.c_id=$selected_course AND crc.question_id=qu.id AND crc.category_id=$courseCategoryId"; |
|
442 | + } |
|
443 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
444 | + $where .= ' AND level='.$exerciseLevel; |
|
445 | + } |
|
446 | + if (isset($answerType) && $answerType > 0) { |
|
447 | + $where .= ' AND type='.$answerType; |
|
448 | + } |
|
449 | + $sql = "SELECT DISTINCT |
|
450 | 450 | id, |
451 | 451 | question, |
452 | 452 | type, |
@@ -468,22 +468,22 @@ discard block |
||
468 | 468 | $mainQuestionList[] = $row; |
469 | 469 | } |
470 | 470 | } elseif ($exerciseId == -1) { |
471 | - // If we have selected the option 'Orphan questions' in the list-box 'Filter' |
|
472 | - $level_where = ''; |
|
473 | - $from = ''; |
|
474 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
475 | - $from = " INNER JOIN $TBL_COURSE_REL_CATEGORY crc ON crc.question_id=q.id AND crc.c_id= q.c_id "; |
|
476 | - $level_where .= " AND |
|
471 | + // If we have selected the option 'Orphan questions' in the list-box 'Filter' |
|
472 | + $level_where = ''; |
|
473 | + $from = ''; |
|
474 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
475 | + $from = " INNER JOIN $TBL_COURSE_REL_CATEGORY crc ON crc.question_id=q.id AND crc.c_id= q.c_id "; |
|
476 | + $level_where .= " AND |
|
477 | 477 | crc.c_id = $selected_course AND |
478 | 478 | crc.category_id = $courseCategoryId"; |
479 | - } |
|
480 | - if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
481 | - $level_where = ' AND level='.$exerciseLevel; |
|
482 | - } |
|
483 | - $answer_where = ''; |
|
484 | - if (isset($answerType) && $answerType >0 -1 ) { |
|
485 | - $answer_where = ' AND type='.$answerType; |
|
486 | - } |
|
479 | + } |
|
480 | + if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
481 | + $level_where = ' AND level='.$exerciseLevel; |
|
482 | + } |
|
483 | + $answer_where = ''; |
|
484 | + if (isset($answerType) && $answerType >0 -1 ) { |
|
485 | + $answer_where = ' AND type='.$answerType; |
|
486 | + } |
|
487 | 487 | |
488 | 488 | // @todo fix this query with the new id field |
489 | 489 | $sql = " ( |
@@ -525,24 +525,24 @@ discard block |
||
525 | 525 | $mainQuestionList[] = $row; |
526 | 526 | } |
527 | 527 | } else { |
528 | - // All tests for selected course |
|
528 | + // All tests for selected course |
|
529 | 529 | // If we have not selected any option in the list-box 'Filter' |
530 | - $filter = ''; |
|
531 | - $from = ''; |
|
530 | + $filter = ''; |
|
531 | + $from = ''; |
|
532 | 532 | |
533 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
534 | - $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
535 | - $filter .= " AND |
|
533 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
534 | + $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
535 | + $filter .= " AND |
|
536 | 536 | crc.c_id = $selected_course AND |
537 | 537 | crc.question_id = qu.id AND |
538 | 538 | crc.category_id = $courseCategoryId"; |
539 | - } |
|
540 | - if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
541 | - $filter .= ' AND level='.$exerciseLevel.' '; |
|
542 | - } |
|
543 | - if (isset($answerType) && $answerType > 0) { |
|
544 | - $filter .= ' AND qu.type='.$answerType.' '; |
|
545 | - } |
|
539 | + } |
|
540 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
541 | + $filter .= ' AND level='.$exerciseLevel.' '; |
|
542 | + } |
|
543 | + if (isset($answerType) && $answerType > 0) { |
|
544 | + $filter .= ' AND qu.type='.$answerType.' '; |
|
545 | + } |
|
546 | 546 | |
547 | 547 | if (!empty($session_id) && $session_id != '-1') { |
548 | 548 | $mainQuestionList = array(); |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $mainQuestionList[] = $row; |
645 | 645 | } |
646 | 646 | } |
647 | - // forces the value to 0 |
|
647 | + // forces the value to 0 |
|
648 | 648 | $exerciseId = 0; |
649 | 649 | } |
650 | 650 | |
@@ -670,33 +670,33 @@ discard block |
||
670 | 670 | // |
671 | 671 | if ($fromExercise <= 0) { |
672 | 672 | // NOT IN A TEST - IN THE COURSE |
673 | - if ($selected_course == api_get_course_int_id()) { |
|
674 | - $actionLabel = get_lang('Modify'); |
|
675 | - $actionIcon1 = "edit"; |
|
676 | - $actionIcon2 = "delete"; |
|
673 | + if ($selected_course == api_get_course_int_id()) { |
|
674 | + $actionLabel = get_lang('Modify'); |
|
675 | + $actionIcon1 = "edit"; |
|
676 | + $actionIcon2 = "delete"; |
|
677 | 677 | // We are in the course, question title can be a link to the question edit page |
678 | - $questionTagA = 1; |
|
678 | + $questionTagA = 1; |
|
679 | 679 | } else { // NOT IN A TEST - NOT IN THE COURSE |
680 | - $actionLabel = get_lang('Reuse'); |
|
681 | - $actionIcon1 = get_lang('MustBeInATest'); |
|
682 | - $actionIcon2 = ""; |
|
680 | + $actionLabel = get_lang('Reuse'); |
|
681 | + $actionIcon1 = get_lang('MustBeInATest'); |
|
682 | + $actionIcon2 = ""; |
|
683 | 683 | // We are not in this course, to messy if we link to the question in another course |
684 | - $questionTagA = 0; |
|
685 | - } |
|
684 | + $questionTagA = 0; |
|
685 | + } |
|
686 | 686 | } else { |
687 | 687 | // IN A TEST - IN THE COURSE |
688 | - if ($selected_course == api_get_course_int_id()) { |
|
689 | - $actionLabel = get_lang('Reuse'); |
|
690 | - $actionIcon1 = "add"; |
|
691 | - $actionIcon2 = ""; |
|
692 | - $questionTagA = 1; |
|
688 | + if ($selected_course == api_get_course_int_id()) { |
|
689 | + $actionLabel = get_lang('Reuse'); |
|
690 | + $actionIcon1 = "add"; |
|
691 | + $actionIcon2 = ""; |
|
692 | + $questionTagA = 1; |
|
693 | 693 | } else { |
694 | 694 | // IN A TEST - NOT IN THE COURSE |
695 | - $actionLabel = get_lang('Reuse'); |
|
696 | - $actionIcon1 = "clone"; |
|
697 | - $actionIcon2 = ""; |
|
698 | - $questionTagA = 0; |
|
699 | - } |
|
695 | + $actionLabel = get_lang('Reuse'); |
|
696 | + $actionIcon1 = "clone"; |
|
697 | + $actionIcon2 = ""; |
|
698 | + $questionTagA = 0; |
|
699 | + } |
|
700 | 700 | } |
701 | 701 | // Display table |
702 | 702 | $header = array( |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | ); |
790 | 790 | |
791 | 791 | if (!$nbrQuestions) { |
792 | - echo get_lang('NoQuestion'); |
|
792 | + echo get_lang('NoQuestion'); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | Display::display_footer(); |
@@ -801,9 +801,9 @@ discard block |
||
801 | 801 | */ |
802 | 802 | function reset_menu_lvl_type() |
803 | 803 | { |
804 | - global $exerciseLevel, $answerType; |
|
805 | - $answerType = -1; |
|
806 | - $exerciseLevel = -1; |
|
804 | + global $exerciseLevel, $answerType; |
|
805 | + $answerType = -1; |
|
806 | + $exerciseLevel = -1; |
|
807 | 807 | } |
808 | 808 | |
809 | 809 | /** |
@@ -813,10 +813,10 @@ discard block |
||
813 | 813 | */ |
814 | 814 | function reset_menu_exo_lvl_type() |
815 | 815 | { |
816 | - global $exerciseId, $courseCategoryId; |
|
817 | - reset_menu_lvl_type(); |
|
818 | - $exerciseId = 0; |
|
819 | - $courseCategoryId = 0; |
|
816 | + global $exerciseId, $courseCategoryId; |
|
817 | + reset_menu_lvl_type(); |
|
818 | + $exerciseId = 0; |
|
819 | + $courseCategoryId = 0; |
|
820 | 820 | } |
821 | 821 | |
822 | 822 | /** |
@@ -838,17 +838,17 @@ discard block |
||
838 | 838 | $in_questionname, |
839 | 839 | $sessionId |
840 | 840 | ) { |
841 | - $res = $in_questionname; |
|
841 | + $res = $in_questionname; |
|
842 | 842 | $sessionIcon = null; |
843 | - if ($in_addA) { |
|
843 | + if ($in_addA) { |
|
844 | 844 | if (!empty($sessionId) && $sessionId != -1) { |
845 | 845 | $sessionIcon = ' '.Display::return_icon('star.png', get_lang('Session')); |
846 | 846 | } |
847 | - $res = "<a href='admin.php?".api_get_cidreq()."&editQuestion=$in_questionid&type=$in_questiontype&fromExercise=$in_fromex'>". |
|
847 | + $res = "<a href='admin.php?".api_get_cidreq()."&editQuestion=$in_questionid&type=$in_questiontype&fromExercise=$in_fromex'>". |
|
848 | 848 | $res.$sessionIcon. |
849 | 849 | "</a>"; |
850 | - } |
|
851 | - return $res; |
|
850 | + } |
|
851 | + return $res; |
|
852 | 852 | } |
853 | 853 | |
854 | 854 | /** |
@@ -878,16 +878,16 @@ discard block |
||
878 | 878 | $in_session_id, |
879 | 879 | $in_exercise_id |
880 | 880 | ) { |
881 | - $res = ""; |
|
882 | - $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id"; |
|
883 | - switch ($in_action) { |
|
884 | - case "delete" : |
|
885 | - $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>"; |
|
886 | - $res .= Display::return_icon("delete.png", get_lang('Delete')); |
|
887 | - $res .= "</a>"; |
|
888 | - break; |
|
889 | - case "edit" : |
|
890 | - $res = get_a_tag_for_question( |
|
881 | + $res = ""; |
|
882 | + $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id"; |
|
883 | + switch ($in_action) { |
|
884 | + case "delete" : |
|
885 | + $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>"; |
|
886 | + $res .= Display::return_icon("delete.png", get_lang('Delete')); |
|
887 | + $res .= "</a>"; |
|
888 | + break; |
|
889 | + case "edit" : |
|
890 | + $res = get_a_tag_for_question( |
|
891 | 891 | 1, |
892 | 892 | $from_exercise, |
893 | 893 | $in_questionid, |
@@ -895,33 +895,33 @@ discard block |
||
895 | 895 | Display::return_icon("edit.png", get_lang('Modify')), |
896 | 896 | $in_session_id |
897 | 897 | ); |
898 | - break; |
|
899 | - case "add": |
|
900 | - // add if question is not already in test |
|
901 | - $myObjEx = new Exercise(); |
|
902 | - $myObjEx->read($from_exercise); |
|
903 | - if (!$myObjEx->isInList($in_questionid)) { |
|
904 | - $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>"; |
|
905 | - $res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise')); |
|
906 | - $res .= "</a>"; |
|
898 | + break; |
|
899 | + case "add": |
|
900 | + // add if question is not already in test |
|
901 | + $myObjEx = new Exercise(); |
|
902 | + $myObjEx->read($from_exercise); |
|
903 | + if (!$myObjEx->isInList($in_questionid)) { |
|
904 | + $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>"; |
|
905 | + $res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise')); |
|
906 | + $res .= "</a>"; |
|
907 | 907 | } else { |
908 | - $res = "-"; |
|
909 | - } |
|
910 | - unset($myObjEx); |
|
911 | - break; |
|
912 | - case "clone": |
|
908 | + $res = "-"; |
|
909 | + } |
|
910 | + unset($myObjEx); |
|
911 | + break; |
|
912 | + case "clone": |
|
913 | 913 | $url = api_get_self()."?".api_get_cidreq().$getParams."&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise"; |
914 | 914 | $res = Display::url( |
915 | 915 | Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest')), |
916 | 916 | $url |
917 | 917 | ); |
918 | - break; |
|
919 | - default : |
|
920 | - $res = $in_action; |
|
921 | - break; |
|
922 | - } |
|
918 | + break; |
|
919 | + default : |
|
920 | + $res = $in_action; |
|
921 | + break; |
|
922 | + } |
|
923 | 923 | |
924 | - return $res; |
|
924 | + return $res; |
|
925 | 925 | } |
926 | 926 | |
927 | 927 | /** |
@@ -930,14 +930,14 @@ discard block |
||
930 | 930 | */ |
931 | 931 | function get_question_type_for_question($in_selectedcourse, $in_questionid) |
932 | 932 | { |
933 | - $myObjQuestion = Question::read($in_questionid, $in_selectedcourse); |
|
933 | + $myObjQuestion = Question::read($in_questionid, $in_selectedcourse); |
|
934 | 934 | $questionType = null; |
935 | 935 | if (!empty($myObjQuestion)) { |
936 | 936 | list($typeImg, $typeExpl) = $myObjQuestion->get_type_icon_html(); |
937 | 937 | $questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), 32), array()); |
938 | 938 | unset($myObjQuestion); |
939 | 939 | } |
940 | - return $questionType; |
|
940 | + return $questionType; |
|
941 | 941 | } |
942 | 942 | |
943 | 943 | /** |
@@ -946,6 +946,6 @@ discard block |
||
946 | 946 | */ |
947 | 947 | function get_question_categorie_for_question($in_courseid, $in_questionid) |
948 | 948 | { |
949 | - $cat = TestCategory::getCategoryNameForQuestion($in_questionid, $in_courseid); |
|
950 | - return $cat; |
|
949 | + $cat = TestCategory::getCategoryNameForQuestion($in_questionid, $in_courseid); |
|
950 | + return $cat; |
|
951 | 951 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | $nameTools = get_lang('QuestionPool'); |
51 | -$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
51 | +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
52 | 52 | |
53 | 53 | if (!empty($objExercise)) { |
54 | 54 | $interbreadcrumb[] = array( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($old_question_obj) { |
75 | 75 | $old_question_obj->updateTitle( |
76 | - $old_question_obj->selectTitle() . ' - ' . get_lang('Copy') |
|
76 | + $old_question_obj->selectTitle().' - '.get_lang('Copy') |
|
77 | 77 | ); |
78 | 78 | //Duplicating the source question, in the current course |
79 | 79 | $new_id = $old_question_obj->duplicate($current_course); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | // destruction of the Question object |
109 | 109 | unset($objQuestionTmp); |
110 | - } elseif($recup && $fromExercise) { |
|
110 | + } elseif ($recup && $fromExercise) { |
|
111 | 111 | // gets an existing question and copies it into a new exercise |
112 | 112 | $objQuestionTmp = Question :: read($recup); |
113 | 113 | // if the question exists |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $old_question_obj = Question::read($old_question_id, $origin_course_id); |
140 | 140 | if ($old_question_obj) { |
141 | 141 | $old_question_obj->updateTitle( |
142 | - $old_question_obj->selectTitle() . ' - ' . get_lang('Copy') |
|
142 | + $old_question_obj->selectTitle().' - '.get_lang('Copy') |
|
143 | 143 | ); |
144 | 144 | |
145 | 145 | //Duplicating the source question, in the current course |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
170 | - Session::write('objExercise',$objExercise); |
|
170 | + Session::write('objExercise', $objExercise); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | -if (isset($_SESSION['gradebook'])){ |
|
175 | - $gradebook= $_SESSION['gradebook']; |
|
174 | +if (isset($_SESSION['gradebook'])) { |
|
175 | + $gradebook = $_SESSION['gradebook']; |
|
176 | 176 | } |
177 | 177 | |
178 | -if (!empty($gradebook) && $gradebook=='view') { |
|
179 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
178 | +if (!empty($gradebook) && $gradebook == 'view') { |
|
179 | + $interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook')); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | // if admin of course |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | } |
217 | 217 | if (isset($fromExercise) && $fromExercise > 0) { |
218 | 218 | echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$fromExercise.'">'. |
219 | - Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
219 | + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
220 | 220 | $titleAdd = get_lang('AddQuestionToTest'); |
221 | 221 | } else { |
222 | 222 | echo '<a href="exercise.php?'.api_get_cidReq().'">'. |
223 | - Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
223 | + Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
224 | 224 | echo "<a href='admin.php?exerciseId=0'>".Display::return_icon('add_question.gif', get_lang('NewQu'), '', ICON_SIZE_MEDIUM)."</a>"; |
225 | 225 | $titleAdd = get_lang('ManageAllQuestions'); |
226 | 226 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | foreach ($sessionList as $item) { |
250 | 250 | $session_select_list[$item['session_id']] = $item['session_name']; |
251 | 251 | } |
252 | -$select_session_html = Display::select('session_id', $session_select_list, $session_id, $tabAttrParam); |
|
252 | +$select_session_html = Display::select('session_id', $session_select_list, $session_id, $tabAttrParam); |
|
253 | 253 | echo Display::form_row($labelFormRow, $select_session_html); |
254 | 254 | |
255 | 255 | // Course list, get course list of session, or for course where user is admin |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $course_select_list[$courseItemId] .= $courseInfo['title']; |
291 | 291 | } |
292 | 292 | |
293 | -$select_course_html = Display::select( |
|
293 | +$select_course_html = Display::select( |
|
294 | 294 | 'selected_course', |
295 | 295 | $course_select_list, |
296 | 296 | $selected_course, |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | $my_exercise_list['0'] = get_lang('AllExercises'); |
347 | 347 | $my_exercise_list['-1'] = get_lang('OrphanQuestions'); |
348 | 348 | if (is_array($exercise_list)) { |
349 | - foreach($exercise_list as $row) { |
|
349 | + foreach ($exercise_list as $row) { |
|
350 | 350 | $my_exercise_list[$row['id']] = ""; |
351 | - if ($row['id'] == $fromExercise && $selected_course == api_get_course_int_id()) { |
|
351 | + if ($row['id'] == $fromExercise && $selected_course == api_get_course_int_id()) { |
|
352 | 352 | $my_exercise_list[$row['id']] = "> "; |
353 | 353 | } |
354 | 354 | $my_exercise_list[$row['id']] .= $row['title']; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if ($exercise_id_changed == 1) { |
359 | 359 | reset_menu_lvl_type(); |
360 | 360 | } |
361 | -$select_exercise_html = Display::select( |
|
361 | +$select_exercise_html = Display::select( |
|
362 | 362 | 'exerciseId', |
363 | 363 | $my_exercise_list, |
364 | 364 | $exerciseId, |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $question_list = Question::get_question_type_list(); |
392 | 392 | |
393 | 393 | $new_question_list = array(); |
394 | -$new_question_list['-1'] = get_lang('All'); |
|
394 | +$new_question_list['-1'] = get_lang('All'); |
|
395 | 395 | if (!empty($_course)) { |
396 | 396 | $objExercise = new Exercise(); |
397 | 397 | $objExercise->read($fromExercise); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | ORDER BY question_order"; |
465 | 465 | |
466 | 466 | $result = Database::query($sql); |
467 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
467 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
468 | 468 | $mainQuestionList[] = $row; |
469 | 469 | } |
470 | 470 | } elseif ($exerciseId == -1) { |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | crc.c_id = $selected_course AND |
478 | 478 | crc.category_id = $courseCategoryId"; |
479 | 479 | } |
480 | - if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
480 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
481 | 481 | $level_where = ' AND level='.$exerciseLevel; |
482 | 482 | } |
483 | 483 | $answer_where = ''; |
484 | - if (isset($answerType) && $answerType >0 -1 ) { |
|
484 | + if (isset($answerType) && $answerType > 0 - 1) { |
|
485 | 485 | $answer_where = ' AND type='.$answerType; |
486 | 486 | } |
487 | 487 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $level_where $answer_where |
522 | 522 | )"; |
523 | 523 | $result = Database::query($sql); |
524 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
524 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
525 | 525 | $mainQuestionList[] = $row; |
526 | 526 | } |
527 | 527 | } else { |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | GradebookUtils::block_students(); |
11 | 11 | |
12 | -$interbreadcrumb[] = array ( |
|
12 | +$interbreadcrumb[] = array( |
|
13 | 13 | 'url' => $_SESSION['gradebook_dest'].'?', |
14 | 14 | 'name' => get_lang('Gradebook' |
15 | 15 | )); |
16 | -$interbreadcrumb[] = array ( |
|
16 | +$interbreadcrumb[] = array( |
|
17 | 17 | 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']), |
18 | 18 | 'name' => get_lang('Details' |
19 | 19 | )); |
20 | -$interbreadcrumb[] = array ( |
|
20 | +$interbreadcrumb[] = array( |
|
21 | 21 | 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&selectcat='.Security::remove_XSS($_GET['selectcat']), |
22 | 22 | 'name' => get_lang('GradebookQualifyLog') |
23 | 23 | ); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); |
30 | 30 | $t_user = Database :: get_main_table(TABLE_MAIN_USER); |
31 | -$visible_log=Security::remove_XSS($_GET['visiblelog']); |
|
31 | +$visible_log = Security::remove_XSS($_GET['visiblelog']); |
|
32 | 32 | |
33 | 33 | $evaledit = Evaluation :: load($visible_log); |
34 | 34 | $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $list_info[] = $row; |
43 | 43 | } |
44 | 44 | |
45 | -foreach($list_info as $key => $info_log) { |
|
46 | - $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
47 | - $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
45 | +foreach ($list_info as $key => $info_log) { |
|
46 | + $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
47 | + $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $parameters = array( |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $cat->setGenerateCertificates(false); |
63 | 63 | } |
64 | 64 | |
65 | - if ($values['hid_parent_id'] == 0 ) { |
|
65 | + if ($values['hid_parent_id'] == 0) { |
|
66 | 66 | $cat->set_certificate_min_score($values['certif_min_score']); |
67 | 67 | } |
68 | 68 | |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $cat->save(); |
84 | - header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat=' . $cat->get_parent_id().'&'.api_get_cidreq()); |
|
84 | + header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq()); |
|
85 | 85 | exit; |
86 | 86 | } |
87 | 87 | $selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
88 | 88 | $interbreadcrumb[] = array( |
89 | - 'url' => Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $selectcat . '&' . api_get_cidreq(), |
|
89 | + 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq(), |
|
90 | 90 | 'name' => get_lang('Gradebook') |
91 | 91 | ); |
92 | 92 | $this_section = SECTION_COURSES; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | null, |
21 | 21 | 'edit_eval_form', |
22 | 22 | null, |
23 | - api_get_self() . '?editeval=' . Security::remove_XSS($_GET['editeval']) |
|
23 | + api_get_self().'?editeval='.Security::remove_XSS($_GET['editeval']) |
|
24 | 24 | ); |
25 | 25 | if ($form->validate()) { |
26 | 26 | $values = $form->exportValues(); |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | } |
46 | 46 | $eval->set_visible($visible); |
47 | 47 | $eval->save(); |
48 | - header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat=' . $eval->get_category_id()); |
|
48 | + header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat='.$eval->get_category_id()); |
|
49 | 49 | exit; |
50 | 50 | } |
51 | -$selectcat_inter=isset($_GET['selectcat'])?Security::remove_XSS($_GET['selectcat']):''; |
|
52 | -$interbreadcrumb[] = array ( |
|
51 | +$selectcat_inter = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
52 | +$interbreadcrumb[] = array( |
|
53 | 53 | 'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat_inter, |
54 | 54 | 'name' => get_lang('Gradebook' |
55 | 55 | )); |
@@ -162,17 +162,17 @@ |
||
162 | 162 | |
163 | 163 | if ($form->validate()) { |
164 | 164 | $officialCode = $form->getSubmitValue('filter'); |
165 | - if ($officialCode == 'all') { |
|
165 | + if ($officialCode == 'all') { |
|
166 | 166 | $certificate_list = GradebookUtils::get_list_users_certificates($cat_id); |
167 | 167 | } else { |
168 | - $userList = UserManager::getUsersByOfficialCode($officialCode); |
|
169 | - if (!empty($userList)) { |
|
170 | - $certificate_list = GradebookUtils::get_list_users_certificates( |
|
171 | - $cat_id, |
|
172 | - $userList |
|
173 | - ); |
|
174 | - } |
|
175 | - } |
|
168 | + $userList = UserManager::getUsersByOfficialCode($officialCode); |
|
169 | + if (!empty($userList)) { |
|
170 | + $certificate_list = GradebookUtils::get_list_users_certificates( |
|
171 | + $cat_id, |
|
172 | + $userList |
|
173 | + ); |
|
174 | + } |
|
175 | + } |
|
176 | 176 | } else { |
177 | 177 | $certificate_list = GradebookUtils::get_list_users_certificates($cat_id); |
178 | 178 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package chamilo.gradebook |
7 | 7 | */ |
8 | 8 | require_once '../inc/global.inc.php'; |
9 | -$current_course_tool = TOOL_GRADEBOOK; |
|
9 | +$current_course_tool = TOOL_GRADEBOOK; |
|
10 | 10 | |
11 | 11 | if (!api_is_student_boss()) { |
12 | 12 | api_protect_course_script(true); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | ini_set('max_execution_time', 0); |
17 | 17 | |
18 | 18 | //extra javascript functions for in html head: |
19 | -$htmlHeadXtra[] ="<script> |
|
19 | +$htmlHeadXtra[] = "<script> |
|
20 | 20 | function confirmation() { |
21 | - if (confirm(\" " . trim(get_lang('AreYouSureToDelete')) . " ?\")) { |
|
21 | + if (confirm(\" " . trim(get_lang('AreYouSureToDelete'))." ?\")) { |
|
22 | 22 | return true; |
23 | 23 | } else { |
24 | 24 | return false; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | api_not_allowed(true); |
32 | 32 | } |
33 | 33 | |
34 | -$cat_id = isset($_GET['cat_id']) ? (int)$_GET['cat_id'] : null; |
|
34 | +$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : null; |
|
35 | 35 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
36 | 36 | $filterOfficialCode = isset($_POST['filter']) ? Security::remove_XSS($_POST['filter']) : null; |
37 | 37 | $filterOfficialCodeGet = isset($_GET['filter']) ? Security::remove_XSS($_GET['filter']) : null; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $course_code = api_get_course_id(); |
74 | 74 | |
75 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsCertificates')); |
|
75 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates')); |
|
77 | 77 | |
78 | 78 | $this_section = SECTION_COURSES; |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $certificate = new Certificate($_GET['certificate_id']); |
86 | 86 | $result = $certificate->delete(true); |
87 | 87 | Security::clear_token(); |
88 | - if ($result ==true) { |
|
88 | + if ($result == true) { |
|
89 | 89 | Display::display_confirmation_message(get_lang('CertificateRemoved')); |
90 | 90 | } else { |
91 | 91 | Display::display_error_message(get_lang('CertificateNotRemoved')); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | |
105 | 105 | //with this fix the teacher only can view 1 gradebook |
106 | 106 | if (api_is_platform_admin()) { |
107 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
107 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
108 | 108 | } else { |
109 | - $stud_id= api_get_user_id(); |
|
109 | + $stud_id = api_get_user_id(); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $total_weight = $cats[0]->get_weight(); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $alleval = $cats[0]->get_evaluations($stud_id); |
116 | 116 | $alllink = $cats[0]->get_links($stud_id); |
117 | 117 | |
118 | - $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
118 | + $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); |
|
119 | 119 | |
120 | 120 | $total_resource_weight = 0; |
121 | 121 | if (!empty($datagen)) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $newarray[] = array_slice($data, 1); |
133 | 133 | } |
134 | 134 | |
135 | - foreach($newarray as $item) { |
|
135 | + foreach ($newarray as $item) { |
|
136 | 136 | $total_resource_weight = $total_resource_weight + $item['2']; |
137 | 137 | } |
138 | 138 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if ($filter === 'true') { |
151 | 151 | echo '<br />'; |
152 | 152 | $options = UserManager::getOfficialCodeGrouped(); |
153 | - $options =array_merge(array('all' => get_lang('All')), $options); |
|
153 | + $options = array_merge(array('all' => get_lang('All')), $options); |
|
154 | 154 | $form = new FormValidator( |
155 | 155 | 'official_code_filter', |
156 | 156 | 'POST', |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | echo $filterForm; |
198 | 198 | |
199 | -if (count($certificate_list) == 0 ) { |
|
199 | +if (count($certificate_list) == 0) { |
|
200 | 200 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
201 | 201 | } else { |
202 | 202 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $certificates = Display::url(get_lang('Certificate'), $url, array('target'=>'_blank', 'class' => 'btn btn-default')); |
220 | 220 | echo $certificates; |
221 | 221 | echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token='.$token.'&cidReq='.$course_code.'&action=delete&cat_id='.$cat_id.'&certificate_id='.$value_certificate['id'].'"> |
222 | - '.Display::return_icon('delete.png',get_lang('Delete')).' |
|
222 | + '.Display::return_icon('delete.png', get_lang('Delete')).' |
|
223 | 223 | </a>'; |
224 | 224 | echo '</td></tr>'; |
225 | 225 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use ChamiloSession as Session; |
10 | 10 | |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | -$current_course_tool = TOOL_GRADEBOOK; |
|
12 | +$current_course_tool = TOOL_GRADEBOOK; |
|
13 | 13 | |
14 | 14 | api_protect_course_script(); |
15 | 15 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | api_not_allowed(true); |
22 | 22 | } |
23 | 23 | |
24 | -$cat_id = isset($_GET['selectcat']) ? (int)$_GET['selectcat'] : null; |
|
24 | +$cat_id = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : null; |
|
25 | 25 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
26 | 26 | |
27 | 27 | $userList = CourseManager::get_user_list_from_course_code( |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $course_code = api_get_course_id(); |
115 | 115 | |
116 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsReports')); |
|
116 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsReports')); |
|
118 | 118 | |
119 | 119 | $this_section = SECTION_COURSES; |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | echo '</div>'; |
133 | 133 | |
134 | -if (count($userList) == 0 ) { |
|
134 | +if (count($userList) == 0) { |
|
135 | 135 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
136 | 136 | } else { |
137 | 137 | echo '<br /><br /><table class="data_table">'; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | api_not_allowed(); |
14 | 14 | } |
15 | 15 | |
16 | -$htmlHeadXtra[]= '<script> |
|
16 | +$htmlHeadXtra[] = '<script> |
|
17 | 17 | function plusItem(item) { |
18 | 18 | document.getElementById(item).style.display = "inline"; |
19 | 19 | document.getElementById("plus-"+item).style.display = "none"; |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | ); |
46 | 46 | |
47 | 47 | $select_cat = intval($_GET['selectcat']); |
48 | -$displayscore= ScoreDisplay :: instance(); |
|
48 | +$displayscore = ScoreDisplay :: instance(); |
|
49 | 49 | $customdisplays = $displayscore->get_custom_score_display_settings(); |
50 | 50 | |
51 | -$nr_items = (count($customdisplays) != '0' )? count($customdisplays) : '1'; |
|
51 | +$nr_items = (count($customdisplays) != '0') ? count($customdisplays) : '1'; |
|
52 | 52 | $scoreform = new ScoreDisplayForm( |
53 | 53 | 'scoring_system_form', |
54 | 54 | api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq() |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | if ($scoreform->validate()) { |
58 | 58 | $value_export = ''; |
59 | 59 | $value_export = $scoreform->exportValues(); |
60 | - $value_export = isset($value_export) ? $scoreform->exportValues(): ''; |
|
60 | + $value_export = isset($value_export) ? $scoreform->exportValues() : ''; |
|
61 | 61 | $values = $value_export; |
62 | 62 | |
63 | 63 | // create new array of custom display settings |
64 | 64 | // this loop also checks if all score ranges are unique |
65 | 65 | |
66 | - $scoringdisplay= array (); |
|
66 | + $scoringdisplay = array(); |
|
67 | 67 | $ranges_ok = true; |
68 | - $endscore= isset($values['endscore']) ? $values['endscore'] : null; |
|
69 | - $displaytext=isset($values['displaytext']) ? $values['displaytext'] : null; |
|
70 | - for ($counter= 1; $ranges_ok && $counter <= 20; $counter++) { |
|
71 | - $setting= array (); |
|
68 | + $endscore = isset($values['endscore']) ? $values['endscore'] : null; |
|
69 | + $displaytext = isset($values['displaytext']) ? $values['displaytext'] : null; |
|
70 | + for ($counter = 1; $ranges_ok && $counter <= 20; $counter++) { |
|
71 | + $setting = array(); |
|
72 | 72 | $setting['score'] = $endscore[$counter]; |
73 | 73 | $setting['display'] = $displaytext[$counter]; |
74 | 74 | if (!empty($setting['score'])) { |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $ranges_ok = false; |
78 | 78 | } |
79 | 79 | } |
80 | - $scoringdisplay[]= $setting; |
|
80 | + $scoringdisplay[] = $setting; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | if (!$ranges_ok) { |
85 | - header('Location: ' . api_get_self() . '?nouniqueranges=&selectcat=' . $select_cat.'&'.api_get_cidreq()); |
|
85 | + header('Location: '.api_get_self().'?nouniqueranges=&selectcat='.$select_cat.'&'.api_get_cidreq()); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $this_section = SECTION_COURSES; |
103 | 103 | Display :: display_header(get_lang('ScoreEdit')); |
104 | 104 | |
105 | -if (((isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') || |
|
106 | - (isset($_GET['selectcat']) && ($_SESSION['studentview']=='teacherview'))) |
|
105 | +if (((isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') || |
|
106 | + (isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview'))) |
|
107 | 107 | ) { |
108 | 108 | if (isset ($_GET['scoringupdated'])) { |
109 | 109 | Display::display_confirmation_message(get_lang('ScoringUpdated'), false); |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | |
10 | 10 | api_block_anonymous_users(); |
11 | 11 | |
12 | -$eval= Evaluation :: load($_GET['selecteval']); |
|
12 | +$eval = Evaluation :: load($_GET['selecteval']); |
|
13 | 13 | if ($eval[0]->get_category_id() < 0) { |
14 | 14 | // if category id is negative, then the evaluation's origin is a link |
15 | - $link= LinkFactory :: get_evaluation_link($eval[0]->get_id()); |
|
15 | + $link = LinkFactory :: get_evaluation_link($eval[0]->get_id()); |
|
16 | 16 | $currentcat = Category :: load($link->get_category_id()); |
17 | 17 | } else { |
18 | 18 | $currentcat = Category :: load($eval[0]->get_category_id()); |
19 | 19 | } |
20 | 20 | |
21 | -$interbreadcrumb[]= array ( |
|
22 | - 'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook')); |
|
21 | +$interbreadcrumb[] = array( |
|
22 | + 'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook')); |
|
23 | 23 | |
24 | 24 | if (api_is_allowed_to_edit()) { |
25 | - $interbreadcrumb[]= array ( |
|
26 | - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
25 | + $interbreadcrumb[] = array( |
|
26 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
27 | 27 | 'name' => get_lang('ViewResult') |
28 | 28 | ); |
29 | 29 | } |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | |
38 | 38 | if (!$displayscore->is_custom() || empty($displays)) { |
39 | 39 | if (api_is_platform_admin() || api_is_course_admin()) { |
40 | - Display :: display_error_message(get_lang('PleaseEnableScoringSystem'),false); |
|
40 | + Display :: display_error_message(get_lang('PleaseEnableScoringSystem'), false); |
|
41 | 41 | } |
42 | 42 | } else { |
43 | - $allresults = Result::load(null,null,$eval[0]->get_id()); |
|
43 | + $allresults = Result::load(null, null, $eval[0]->get_id()); |
|
44 | 44 | $nr_items = array(); |
45 | 45 | foreach ($displays as $itemsdisplay) { |
46 | 46 | $nr_items[$itemsdisplay['display']] = 0; |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | // Generate table |
71 | - $stattable= '<table class="data_table" cellspacing="0" cellpadding="3">'; |
|
72 | - $stattable .= '<tr><th>' . get_lang('ScoringSystem') . '</th>'; |
|
73 | - $stattable .= '<th>' . get_lang('Percentage') . '</th>'; |
|
74 | - $stattable .= '<th>' . get_lang('CountUsers') . '</th>'; |
|
71 | + $stattable = '<table class="data_table" cellspacing="0" cellpadding="3">'; |
|
72 | + $stattable .= '<tr><th>'.get_lang('ScoringSystem').'</th>'; |
|
73 | + $stattable .= '<th>'.get_lang('Percentage').'</th>'; |
|
74 | + $stattable .= '<th>'.get_lang('CountUsers').'</th>'; |
|
75 | 75 | //$stattable .= '<th>' . get_lang('Statistics') . '</th></tr>'; |
76 | - $counter=0; |
|
76 | + $counter = 0; |
|
77 | 77 | foreach ($keys as $key) { |
78 | - $bar = ($highest_ratio > 0?($nr_items[$key] / $highest_ratio) * 100:0); |
|
79 | - $stattable .= '<tr class="row_' . ($counter % 2 == 0 ? 'odd' : 'even') . '">'; |
|
80 | - $stattable .= '<td width="150">' . $key . '</td>'; |
|
78 | + $bar = ($highest_ratio > 0 ? ($nr_items[$key] / $highest_ratio) * 100 : 0); |
|
79 | + $stattable .= '<tr class="row_'.($counter % 2 == 0 ? 'odd' : 'even').'">'; |
|
80 | + $stattable .= '<td width="150">'.$key.'</td>'; |
|
81 | 81 | |
82 | 82 | $stattable .= '<td width="550">'.Display::bar_progress($bar).'</td>'; |
83 | - $stattable .= '<td align="right">' . $nr_items[$key] . '</td>'; |
|
83 | + $stattable .= '<td align="right">'.$nr_items[$key].'</td>'; |
|
84 | 84 | $counter++; |
85 | 85 | } |
86 | 86 | $stattable .= '</tr></table>'; |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | 9 | GradebookUtils::block_students(); |
10 | -$select_eval=Security::remove_XSS($_GET['selecteval']); |
|
10 | +$select_eval = Security::remove_XSS($_GET['selecteval']); |
|
11 | 11 | if (empty($select_eval)) { |
12 | 12 | api_not_allowed(); |
13 | 13 | } |
14 | -$resultedit = Result :: load (null,null,$select_eval); |
|
15 | -$evaluation = Evaluation :: load ($select_eval); |
|
14 | +$resultedit = Result :: load(null, null, $select_eval); |
|
15 | +$evaluation = Evaluation :: load($select_eval); |
|
16 | 16 | |
17 | 17 | $evaluation[0]->check_lock_permissions(); |
18 | 18 | |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | $values = $edit_result_form->exportValues(); |
30 | 30 | $scores = ($values['score']); |
31 | 31 | foreach ($scores as $row) { |
32 | - $resultedit = Result :: load (key($scores)); |
|
32 | + $resultedit = Result :: load(key($scores)); |
|
33 | 33 | $row_value = $row; |
34 | - if ($row_value != '' ) { |
|
34 | + if ($row_value != '') { |
|
35 | 35 | $resultedit[0]->set_score(floatval(number_format($row_value, api_get_setting('gradebook_number_decimals')))); |
36 | 36 | $resultedit[0]->save(); |
37 | 37 | } |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | exit; |
42 | 42 | } |
43 | 43 | |
44 | -$interbreadcrumb[] = array ( |
|
44 | +$interbreadcrumb[] = array( |
|
45 | 45 | 'url' => $_SESSION['gradebook_dest'], |
46 | 46 | 'name' => get_lang('Gradebook') |
47 | 47 | ); |
48 | -$interbreadcrumb[]= array ( |
|
48 | +$interbreadcrumb[] = array( |
|
49 | 49 | 'url' => 'gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq(), |
50 | 50 | 'name' => get_lang('ViewResult') |
51 | 51 | ); |
52 | 52 | Display :: display_header(get_lang('EditResult')); |
53 | -DisplayGradebook::display_header_result($evaluation[0],null,0,0); |
|
53 | +DisplayGradebook::display_header_result($evaluation[0], null, 0, 0); |
|
54 | 54 | echo $table; |
55 | 55 | Display :: display_footer(); |