@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->set_additional_parameters($addparams); |
72 | 72 | } |
73 | 73 | |
74 | - $column= 0; |
|
74 | + $column = 0; |
|
75 | 75 | if ($this->teacherView) { |
76 | 76 | if ($this->exportToPdf == false) { |
77 | 77 | $this->set_header($column++, '', '', 'width="25px"'); |
@@ -281,13 +281,13 @@ discard block |
||
281 | 281 | $main_categories[$item->get_id()]['name'] = $item->get_name(); |
282 | 282 | } else { |
283 | 283 | $name = $this->build_name_link($item, $type); |
284 | - $row[] = $invisibility_span_open.$name. $invisibility_span_close; |
|
284 | + $row[] = $invisibility_span_open.$name.$invisibility_span_close; |
|
285 | 285 | $main_categories[$item->get_id()]['name'] = $name; |
286 | 286 | } |
287 | 287 | |
288 | 288 | $this->dataForGraph['categories'][] = $item->get_name(); |
289 | 289 | |
290 | - $main_categories[$item->get_id()]['weight']= $item->get_weight(); |
|
290 | + $main_categories[$item->get_id()]['weight'] = $item->get_weight(); |
|
291 | 291 | $total_categories_weight += $item->get_weight(); |
292 | 292 | |
293 | 293 | // Description. |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | ); |
308 | 308 | |
309 | 309 | if ($this->teacherView) { |
310 | - $row[] = $invisibility_span_open .Display::tag('p', $weight, array('class' => 'score')).$invisibility_span_close; |
|
310 | + $row[] = $invisibility_span_open.Display::tag('p', $weight, array('class' => 'score')).$invisibility_span_close; |
|
311 | 311 | } else { |
312 | - $row[] = $invisibility_span_open .$weight.$invisibility_span_close; |
|
312 | + $row[] = $invisibility_span_open.$weight.$invisibility_span_close; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | $category_weight = $item->get_weight(); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | |
336 | 336 | if (!empty($score[1])) { |
337 | 337 | $completeScore = $scoredisplay->display_score($score, SCORE_DIV_PERCENT); |
338 | - $score = $score[0]/$score[1]*$item->get_weight(); |
|
338 | + $score = $score[0] / $score[1] * $item->get_weight(); |
|
339 | 339 | $score = $scoredisplay->display_score(array($score, null), SCORE_SIMPLE); |
340 | 340 | $scoreToDisplay = Display::tip($score, $completeScore); |
341 | 341 | } else { |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | $row[] = $this->build_type_column($item, array('style' => 'padding-left:5px')); |
454 | 454 | |
455 | 455 | // Name. |
456 | - $row[] = $invisibility_span_open." ".$this->build_name_link($item, $type) . $invisibility_span_close; |
|
456 | + $row[] = $invisibility_span_open." ".$this->build_name_link($item, $type).$invisibility_span_close; |
|
457 | 457 | |
458 | 458 | // Description. |
459 | 459 | if ($this->exportToPdf == false) { |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | // Students get the results and certificates columns |
492 | 492 | $eval_n_links = array_merge($alleval, $alllink); |
493 | 493 | |
494 | - if (count($eval_n_links)> 0) { |
|
494 | + if (count($eval_n_links) > 0) { |
|
495 | 495 | $value_data = isset($data[4]) ? $data[4] : null; |
496 | 496 | if (!is_null($value_data)) { |
497 | 497 | //$score = $item->calc_score(api_get_user_id()); |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | $row = array( |
588 | 588 | null, |
589 | 589 | null, |
590 | - '<strong>' . get_lang('Total') . '</strong>', |
|
590 | + '<strong>'.get_lang('Total').'</strong>', |
|
591 | 591 | null, |
592 | 592 | $total |
593 | 593 | ); |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | if ($this->exportToPdf) { |
658 | 658 | $row = array( |
659 | 659 | null, |
660 | - '<h3>' . get_lang('Total') . '</h3>', |
|
660 | + '<h3>'.get_lang('Total').'</h3>', |
|
661 | 661 | $main_weight, |
662 | 662 | $totalResult, |
663 | 663 | $totalRanking, |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | } else { |
668 | 668 | $row = array( |
669 | 669 | null, |
670 | - '<h3>' . get_lang('Total') . '</h3>', |
|
670 | + '<h3>'.get_lang('Total').'</h3>', |
|
671 | 671 | null, |
672 | 672 | $main_weight, |
673 | 673 | $totalResult, |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | } |
683 | 683 | |
684 | 684 | // Warning messages |
685 | - $view = isset($_GET['view']) ? $_GET['view']: null; |
|
685 | + $view = isset($_GET['view']) ? $_GET['view'] : null; |
|
686 | 686 | |
687 | 687 | if ($this->teacherView) { |
688 | 688 | if (isset($_GET['selectcat']) && |
@@ -693,14 +693,14 @@ discard block |
||
693 | 693 | $category = Category::load($id_cat); |
694 | 694 | $weight_category = intval($this->build_weight($category[0])); |
695 | 695 | $course_code = $this->build_course_code($category[0]); |
696 | - $weight_total_links = round($weight_total_links); |
|
696 | + $weight_total_links = round($weight_total_links); |
|
697 | 697 | |
698 | 698 | if ($weight_total_links > $weight_category || |
699 | 699 | $weight_total_links < $weight_category || |
700 | 700 | $weight_total_links > $weight_category |
701 | 701 | ) { |
702 | 702 | $warning_message = sprintf(get_lang('TotalWeightMustBeX'), $weight_category); |
703 | - $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cidReq='.$course_code.'&id_session='.api_get_session_id().'">'. |
|
703 | + $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cidReq='.$course_code.'&id_session='.api_get_session_id().'">'. |
|
704 | 704 | Display::return_icon('edit.png', $warning_message, array(), ICON_SIZE_SMALL).'</a>'; |
705 | 705 | $warning_message .= $modify_icons; |
706 | 706 | Display::display_warning_message($warning_message, false); |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | if (empty($certificate_min_score) || |
756 | 756 | ($certificate_min_score > $weight_category) |
757 | 757 | ) { |
758 | - $warning_message .= $course_code .' - '.get_lang('CertificateMinimunScoreIsRequiredAndMustNotBeMoreThan').' '.$weight_category.'<br />'; |
|
758 | + $warning_message .= $course_code.' - '.get_lang('CertificateMinimunScoreIsRequiredAndMustNotBeMoreThan').' '.$weight_category.'<br />'; |
|
759 | 759 | } |
760 | 760 | } |
761 | 761 | |
@@ -817,10 +817,10 @@ discard block |
||
817 | 817 | get_lang('Results'), |
818 | 818 | array("FontSize" => 11, "Align" => TEXT_ALIGN_BOTTOMMIDDLE) |
819 | 819 | ); |
820 | - $pChart->setGraphArea(50, 30, $xSize-50, $ySize-50); |
|
820 | + $pChart->setGraphArea(50, 30, $xSize - 50, $ySize - 50); |
|
821 | 821 | $pChart->setFontProperties( |
822 | 822 | array( |
823 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
823 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
824 | 824 | 'FontSize' => 10, |
825 | 825 | ) |
826 | 826 | ); |
@@ -868,13 +868,13 @@ discard block |
||
868 | 868 | $chartHash = $myCache->getHash($dataSet); |
869 | 869 | |
870 | 870 | $myCache->writeToCache($chartHash, $pChart); |
871 | - $imgSysPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
871 | + $imgSysPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
872 | 872 | $myCache->saveFromCache($chartHash, $imgSysPath); |
873 | - $imgWebPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
873 | + $imgWebPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
874 | 874 | |
875 | 875 | if (file_exists($imgSysPath)) { |
876 | 876 | $result = '<div id="contentArea" style="text-align: center;" >'; |
877 | - $result .= '<img src="' . $imgWebPath.'" >'; |
|
877 | + $result .= '<img src="'.$imgWebPath.'" >'; |
|
878 | 878 | $result .= '</div>'; |
879 | 879 | return $result; |
880 | 880 | } |
@@ -919,13 +919,13 @@ discard block |
||
919 | 919 | switch ($item->get_item_type()) { |
920 | 920 | // category |
921 | 921 | case 'C': |
922 | - return 'CATE' . $item->get_id(); |
|
922 | + return 'CATE'.$item->get_id(); |
|
923 | 923 | // evaluation |
924 | 924 | case 'E': |
925 | - return 'EVAL' . $item->get_id(); |
|
925 | + return 'EVAL'.$item->get_id(); |
|
926 | 926 | // link |
927 | 927 | case 'L': |
928 | - return 'LINK' . $item->get_id(); |
|
928 | + return 'LINK'.$item->get_id(); |
|
929 | 929 | } |
930 | 930 | } |
931 | 931 | |
@@ -953,10 +953,10 @@ discard block |
||
953 | 953 | switch ($item->get_item_type()) { |
954 | 954 | // category |
955 | 955 | case 'C': |
956 | - $prms_uri='?selectcat=' . $item->get_id() . '&view='.$view; |
|
956 | + $prms_uri = '?selectcat='.$item->get_id().'&view='.$view; |
|
957 | 957 | if (isset($_GET['isStudentView'])) { |
958 | - if ( isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) { |
|
959 | - $prms_uri=$prms_uri.'&isStudentView='.Security::remove_XSS($_GET['isStudentView']); |
|
958 | + if (isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')) { |
|
959 | + $prms_uri = $prms_uri.'&isStudentView='.Security::remove_XSS($_GET['isStudentView']); |
|
960 | 960 | } |
961 | 961 | } |
962 | 962 | |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | return ' <a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).$prms_uri.'">' |
966 | 966 | . $item->get_name() |
967 | 967 | . '</a>' |
968 | - . ($item->is_course() ? ' [' . $item->get_course_code() . ']'.$show_message : ''); |
|
968 | + . ($item->is_course() ? ' ['.$item->get_course_code().']'.$show_message : ''); |
|
969 | 969 | // evaluation |
970 | 970 | case 'E': |
971 | 971 | $cat = new Category(); |
@@ -973,10 +973,10 @@ discard block |
||
973 | 973 | $show_message = $cat->show_message_resource_delete($course_id); |
974 | 974 | |
975 | 975 | // course/platform admin can go to the view_results page |
976 | - if (api_is_allowed_to_edit() && $show_message===false) { |
|
976 | + if (api_is_allowed_to_edit() && $show_message === false) { |
|
977 | 977 | if ($item->get_type() == 'presence') { |
978 | 978 | return ' ' |
979 | - . '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval=' . $item->get_id() . '">' |
|
979 | + . '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
980 | 980 | . $item->get_name() |
981 | 981 | . '</a>'; |
982 | 982 | } else { |
@@ -985,20 +985,20 @@ discard block |
||
985 | 985 | $extra = ''; |
986 | 986 | } |
987 | 987 | return ' ' |
988 | - . '<a href="gradebook_view_result.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
988 | + . '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
989 | 989 | . $item->get_name() |
990 | 990 | . '</a> '.$extra; |
991 | 991 | } |
992 | - } elseif (ScoreDisplay :: instance()->is_custom() && $show_message===false) { |
|
992 | + } elseif (ScoreDisplay :: instance()->is_custom() && $show_message === false) { |
|
993 | 993 | // students can go to the statistics page (if custom display enabled) |
994 | 994 | return ' ' |
995 | - . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
995 | + . '<a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
996 | 996 | . $item->get_name() |
997 | 997 | . '</a>'; |
998 | 998 | |
999 | 999 | } elseif ($show_message === false && !api_is_allowed_to_edit() && !ScoreDisplay :: instance()->is_custom()) { |
1000 | 1000 | return ' ' |
1001 | - . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
1001 | + . '<a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
1002 | 1002 | . $item->get_name() |
1003 | 1003 | . '</a>'; |
1004 | 1004 | } else { |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | $url = $item->get_link(); |
1014 | 1014 | |
1015 | 1015 | if (isset($url) && $show_message === false) { |
1016 | - $text = ' <a href="' . $item->get_link() . '">' |
|
1016 | + $text = ' <a href="'.$item->get_link().'">' |
|
1017 | 1017 | . $item->get_name() |
1018 | 1018 | . '</a>'; |
1019 | 1019 | } else { |