Procházet zdrojové kódy

Changed the signs ' - ' and ' / ' when the results are disabled CT#601

Arthur Portugal před 15 roky
rodič
revize
95e30961df
1 změnil soubory, kde provedl 15 přidání a 11 odebrání
  1. 15 11
      main/newscorm/lp_stats.php

+ 15 - 11
main/newscorm/lp_stats.php

@@ -8,11 +8,11 @@
  * @author Yannick Warnier <ywarnier@beeznest.org>
  * @author Yannick Warnier <ywarnier@beeznest.org>
  */
  */
 
 
-require_once('learnpath.class.php');
+require_once 'learnpath.class.php';
 //require_once('scorm.class.php');
 //require_once('scorm.class.php');
-require_once ('resourcelinker.inc.php');
-require_once ('../inc/lib/tracking.lib.php');
-require_once ('../inc/lib/course.lib.php');
+require_once 'resourcelinker.inc.php';
+require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
 
 
 if(empty($_SESSION['_course']['id']) && isset($_GET['course'])) {
 if(empty($_SESSION['_course']['id']) && isset($_GET['course'])) {
 	$course_code = Security::remove_XSS($_GET['course']);
 	$course_code = Security::remove_XSS($_GET['course']);
@@ -20,7 +20,6 @@ if(empty($_SESSION['_course']['id']) && isset($_GET['course'])) {
 	$course_code = $_SESSION['_course']['id'];
 	$course_code = $_SESSION['_course']['id'];
 }
 }
 
 
-
 if (isset($_GET['student_id'])) {
 if (isset($_GET['student_id'])) {
 	$student_id = intval($_GET['student_id']);
 	$student_id = intval($_GET['student_id']);
 }
 }
@@ -45,7 +44,7 @@ if($origin != 'tracking') {
 		@import "../css/public_admin/scorm.css";
 		@import "../css/public_admin/scorm.css";
 		/*]]>*/
 		/*]]>*/
 	</style>';
 	</style>';
-	include_once ('../inc/reduced_header.inc.php');
+	include_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php';
 	echo '<body>';
 	echo '<body>';
 } else {
 } else {
     //Get learning path's encoding
     //Get learning path's encoding
@@ -146,7 +145,7 @@ if (isset($_GET['lp_id']) && isset($_GET['my_lp_id'])) {
 
 
 $TBL_QUIZ = Database :: get_course_table(TABLE_QUIZ_TEST);
 $TBL_QUIZ = Database :: get_course_table(TABLE_QUIZ_TEST);
 
 
-if (is_array($list) && count($list) > 0){
+if (is_array($list) && count($list) > 0) {
 	foreach ($list as $my_item_id) {
 	foreach ($list as $my_item_id) {
 		$extend_this = 0;
 		$extend_this = 0;
 		$qry_order = 'DESC';
 		$qry_order = 'DESC';
@@ -304,7 +303,7 @@ if (is_array($list) && count($list) > 0){
 
 
 				if ($row['item_type'] != 'dokeos_chapter') {
 				if ($row['item_type'] != 'dokeos_chapter') {
 					if (!$is_allowed_to_edit && $result_disabled_ext_all) {
 					if (!$is_allowed_to_edit && $result_disabled_ext_all) {
-						$view_score = '/';
+						$view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
 					} else {
 					} else {
 						$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1)));
 						$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1)));
 					}
 					}
@@ -571,7 +570,7 @@ if (is_array($list) && count($list) > 0){
 					 if ($row['item_type'] == 'quiz') {
 					 if ($row['item_type'] == 'quiz') {
 
 
 					 	if (!$is_allowed_to_edit && $result_disabled_ext_all) {
 					 	if (!$is_allowed_to_edit && $result_disabled_ext_all) {
-							$output .=  '/';
+							$output .= Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); 
 						} else {
 						} else {
 							$output .= ($score == 0 ? '0/'.float_format($maxscore, 1) : ($maxscore == 0 ? $score : float_format($score, 1) . '/' . float_format($maxscore, 1)));
 							$output .= ($score == 0 ? '0/'.float_format($maxscore, 1) : ($maxscore == 0 ? $score : float_format($score, 1) . '/' . float_format($maxscore, 1)));
 						}
 						}
@@ -655,7 +654,7 @@ if (is_array($list) && count($list) > 0){
 								$time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp);
 								$time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp);
 						
 						
 								if (!$is_allowed_to_edit && $result_disabled_ext_all) {
 								if (!$is_allowed_to_edit && $result_disabled_ext_all) {
-									$view_score =  '-';
+									$view_score =  Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
 								} else {
 								} else {
 									//show only float when need it
 									//show only float when need it
 									$my_score  = float_format( $my_score, 1);
 									$my_score  = float_format( $my_score, 1);
@@ -724,7 +723,12 @@ $total_time = learnpathItem :: get_scorm_time('js', $total_time);
 $total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time);
 $total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time);
 $lp_type = learnpath :: get_type_static($lp_id);
 $lp_type = learnpath :: get_type_static($lp_id);
 $total_percent = 0;
 $total_percent = 0;
-$final_score = $total_score.'%';
+
+if(!$is_allowed_to_edit && $result_disabled_ext_all) {
+	$final_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
+} else {
+	$final_score = $total_score.'%';
+}
 
 
 if (($counter % 2) == 0) {
 if (($counter % 2) == 0) {
 	$oddclass = "row_odd";
 	$oddclass = "row_odd";