diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index fd285e05f7..a9527447f6 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -615,7 +615,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') { echo '' . Display :: return_icon('hotpotatoes_s.png', get_lang('ImportHotPotatoesQuiz')) . get_lang('ImportHotPotatoesQuiz') . ''; // link to import qti2 ... echo '' . Display :: return_icon('import_db.png', get_lang('ImportQtiQuiz')) . get_lang('ImportQtiQuiz') . ''; - echo '' . Display :: return_icon('show_test_results.gif', get_lang('Results')) . get_lang('Results') . ''; + //echo '' . Display :: return_icon('show_test_results.gif', get_lang('Results')) . get_lang('Results') . ''; } // the actions for the statistics @@ -684,9 +684,9 @@ if ($show == 'result') { null; } if ($_GET['filter'] == '1' or !isset ($_GET['filter']) or $_GET['filter'] == 0 ) { - $view_result = ''.Display :: return_icon('check.gif', get_lang('ShowCorrectedOnly')).get_lang('ShowCorrectedOnly').''; + $view_result = ''.Display :: return_icon('check.gif', get_lang('ShowCorrectedOnly')).get_lang('ShowCorrectedOnly').''; } else { - $view_result = ''.Display :: return_icon('un_check.gif', get_lang('ShowUnCorrectedOnly')).get_lang('ShowUnCorrectedOnly').''; + $view_result = ''.Display :: return_icon('un_check.gif', get_lang('ShowUnCorrectedOnly')).get_lang('ShowUnCorrectedOnly').''; } echo $view_result; } @@ -816,6 +816,8 @@ if ($show == 'test') { $actions = Display::url(Display::return_icon('wizard_small.gif',get_lang('Edit'), array('width'=>'22px')), 'admin.php?'.api_get_cidreq().'&exerciseId='.$row['id']); + $actions .='' . Display :: return_icon('show_test_results.gif', get_lang('Results')).''; + //Export $actions .= Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick'=>"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'),ENT_QUOTES,$charset))." ".addslashes($row['title'])."?"."')) return false;",'href'=>'exercice.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id'])); //Clean exercise @@ -865,6 +867,7 @@ if ($show == 'test') { echo '';*/ echo Display::tag('tr',$item); } else { + // Student only $row['title']=text_filter($row['title']); @@ -878,8 +881,7 @@ if ($show == 'test') { } } else { $url = ''.$row['title'].''; - } - + } $item = Display::tag('td',$url.' '.$session_img); @@ -931,7 +933,7 @@ if ($show == 'test') { $percentage = ($row['exe_result'] / $row['exe_weighting']) * 100; } $attempt_text = get_lang('Attempted') . ' (' . get_lang('Score') . ': '; - $attempt_text .= printf("%1.2f\n", $percentage); + $attempt_text .= sprintf("%1.2f\n", $percentage); $attempt_text .= " %)"; } else { //echo get_lang('WillBeActivated' .' '. $row['start_time']); @@ -964,7 +966,7 @@ if ($show == 'test') { /* Exercise Results (uses tracking tool) */ // if tracking is enabled -if ($_configuration['tracking_enabled'] && ($show == 'result')) { +if ($show == 'result') { $parameters=array('cidReq'=>Security::remove_XSS($_GET['cidReq']),'show'=>Security::remove_XSS($_GET['show']),'filter' => Security::remove_XSS($_GET['filter']),'gradebook' =>Security::remove_XSS($_GET['gradebook'])); $exercise_id = intval($_GET['exercise_id']); if (!empty($exercise_id)) @@ -988,7 +990,7 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { $table->set_header(-$secuence + 3, get_lang('Duration'),false); $table->set_header(-$secuence + 4, get_lang('Date')); $table->set_header(-$secuence + 5, get_lang('Result'),false); - $table->set_header(-$secuence + 6, (($is_allowedToEdit||$is_tutor) ? get_lang('CorrectTest') : get_lang('ViewTest')), false); + $table->set_header(-$secuence + 6, (($is_allowedToEdit||$is_tutor) ? get_lang('CorrectTest') : get_lang('ViewTest')), false); $table->display(); } diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index e901a36a34..47cf927c8a 100755 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1075,25 +1075,25 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) { */ function show_score($score, $weight, $show_porcentage = true) { $html = ''; - $score_rounded = $score; - if ($score != '' && $weight != '') { - $max_note = api_get_setting('exercise_max_score'); - $min_note = api_get_setting('exercise_min_score'); - if ($max_note != '' && $min_note != '') { - if (!empty($weight) && intval($weight) != 0) { - $score = $min_note + ($max_note - $min_note) * $score /$weight; - } else { - $score = $min_note; - } - $score_rounded = round($score, 2); - $weight = $max_note; + $score_rounded = $score; + + $max_note = api_get_setting('exercise_max_score'); + $min_note = api_get_setting('exercise_min_score'); + + if ($max_note != '' && $min_note != '') { + if (!empty($weight) && intval($weight) != 0) { + $score = $min_note + ($max_note - $min_note) * $score /$weight; + } else { + $score = $min_note; } - if ($show_porcentage) { - $html = round(($score / ($weight != 0 ? $weight : 1)) * 100, 2) . '% (' . $score_rounded . ' / ' . $weight . ')'; - } else { - $html = $score_rounded . ' / ' . $weight; - } - } + $score_rounded = round($score, 2); + $weight = $max_note; + } + if ($show_porcentage) { + $html = round(($score / ($weight != 0 ? $weight : 1)) * 100, 2) . '% (' . $score_rounded . ' / ' . $weight . ')'; + } else { + $html = $score_rounded . ' / ' . $weight; + } return $html; } diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index e4265139c8..b821437039 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -248,7 +248,7 @@ if ($show_results) {