Minor fixing document results. Replacing 0/100 with "/" see #5286

skala
Julio Montoya 12 years ago
parent ecf7e9c248
commit 92209d8055
  1. 2
      main/exercice/exercise.lib.php
  2. 12
      main/newscorm/lp_controller.php
  3. 42
      main/newscorm/lp_stats.php

@ -1166,7 +1166,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
* @param float score
* @param float weight
* @param bool show porcentage or not
* @param bool use or not the platform settings
* @param bool use or not the platform settings
* @return string an html with the score modified
*/
function show_score($score, $weight, $show_percentage = true, $use_platform_settings = true, $show_success_message = false, $pass_percentage = null) {

@ -831,11 +831,7 @@ switch ($action) {
if (!$lp_found) { error_log('New LP - No learnpath given for stats', 0); require 'lp_list.php'; }
else {
$_SESSION['oLP']->save_current();
$_SESSION['oLP']->save_last();
// Declare variables to be used in lp_stats.php.
$lp_id = $_SESSION['oLP']->get_id();
$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
$user_id = api_get_user_id();
$_SESSION['oLP']->save_last();
require 'lp_stats.php';
}
break;
@ -926,11 +922,7 @@ switch ($action) {
if (!$lp_found) { error_log('New LP - No learnpath given for stats', 0); require 'lp_list.php'; }
else {
$_SESSION['oLP']->save_current();
$_SESSION['oLP']->save_last();
// Declare variables to be used in lp_stats.php.
$lp_id = $_SESSION['oLP']->get_id();
$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
$user_id = api_get_user_id();
$_SESSION['oLP']->save_last();
header('location: '.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/?id_session='.api_get_session_id());
}
break;

@ -16,6 +16,10 @@ require_once 'resourcelinker.inc.php';
require_once '../exercice/exercise.lib.php';
$course_code = api_get_course_id();
$user_id = api_get_user_id();
// Declare variables to be used in lp_stats.php.
$lp_id = $_SESSION['oLP']->get_id();
$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
@ -292,23 +296,35 @@ if (is_array($list) && count($list) > 0) {
$my_lesson_status = get_lang($mylanglist[$lesson_status]);
if ($row['item_type'] != 'dokeos_chapter') {
if ($row['item_type'] != 'dokeos_chapter') {
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
$view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
} else {
//$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1)));
if ($row['item_type'] == 'sco') {
if ($maxscore == 0 ) {
$view_score = $score;
} else {
} else {
switch ($row['item_type']) {
case 'sco':
if ($maxscore == 0 ) {
$view_score = $score;
} else {
$view_score = show_score($score, $maxscore, false);
}
break;
case 'document':
$view_score = ($score == 0 ? '/' : show_score($score, $maxscore, false));
break;
default:
$view_score = show_score($score, $maxscore, false);
}
} else {
$view_score = show_score($score, $maxscore, false);
}
break;
}
}
$output .= "<tr class='$oddclass'>" . "<td></td>" . "<td>$extend_attempt_link</td>" . '<td colspan="3">' . get_lang('Attempt') . ' ' . $row['iv_view_count'] . "</td>"
. '<td colspan="2">' . Display::label($my_lesson_status, $class_status) . "</td>\n" . '<td colspan="2"><div class="mystatus" align="center">' . $view_score . "</div></td>" . '<td colspan="2"><div class="mystatus">'.$time.'</div></td><td></td></tr>';
$output .= '<tr class="'.$oddclass.'">
<td></td>
<td>'.$extend_attempt_link.'</td>
<td colspan="3">'.get_lang('Attempt').' '.$row['iv_view_count'].'</td>
<td colspan="2">'.Display::label($my_lesson_status, $class_status).'</td>
<td colspan="2"><div class="mystatus" align="center">'.$view_score.'</div></td>
<td colspan="2"><div class="mystatus">'.$time.'</div></td>
<td></td>
</tr>';
if (!empty($export_csv)) {
$temp = array ();

Loading…
Cancel
Save