[svn r18548] Minor - Added 0/0 when the score is empty into flat view and round score about certificate into gradebook tool - see FS#3510

skala
Cristian Fasanando 16 years ago
parent 4c03c4d0de
commit 3d9f792a8b
  1. 2
      main/gradebook/lib/fe/gradebooktable.class.php
  2. 5
      main/gradebook/lib/scoredisplay.class.php

@ -178,7 +178,7 @@ class GradebookTable extends SortableTable
$item_value = number_format($item_value, 2, '.', ' '); $item_value = number_format($item_value, 2, '.', ' ');
$cattotal = Category :: load($id); $cattotal = Category :: load($id);
$scoretotal= $cattotal[0]->calc_score(api_get_user_id()); $scoretotal= $cattotal[0]->calc_score(api_get_user_id());
$scoretotal_display = (isset($scoretotal)? $scoretotal[0].'/'.$scoretotal[1].'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)': '-'); $scoretotal_display = (isset($scoretotal)? round($scoretotal[0],2).'/'.round($scoretotal[1],2).'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)': '-');
$row[] = $item_value; $row[] = $item_value;
} else { } else {
$row[] = $invisibility_span_open . $data[3] . $invisibility_span_close; $row[] = $invisibility_span_open . $data[3] . $invisibility_span_close;

@ -266,9 +266,14 @@ class ScoreDisplay
} }
private function display_as_div ($score) { private function display_as_div ($score) {
if ($score==1) {
return '0/0';
} else {
return $score[0] . ' / ' . $score[1]; return $score[0] . ' / ' . $score[1];
} }
}
private function display_custom ($score) { private function display_custom ($score) {
$my_score_denom= ($score[1]==0)?1:$score[1]; $my_score_denom= ($score[1]==0)?1:$score[1];
$scaledscore = $score[0] / $my_score_denom; $scaledscore = $score[0] / $my_score_denom;

Loading…
Cancel
Save