Explorar o código

[svn r13260] Improved output of percentages

Yannick Warnier %!s(int64=17) %!d(string=hai) anos
pai
achega
5baec0ceba
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      main/exercice/exercice.php

+ 2 - 2
main/exercice/exercice.php

@@ -885,7 +885,7 @@ if($_configuration['tracking_enabled'])
 				}
 				echo '<td>'.$test.'</td>';
 				echo '<td>'.format_locale_date(get_lang('dateTimeFormatLong'),$results[$i][4]).'</td>';
-		  		echo '<td>'.(floor($res/($results[$i][3]!=0?$results[$i][3]:1))*100).'% ('.$res.' / '.$results[$i][3].')</td>';
+		  		echo '<td>'.round(($res/($results[$i][3]!=0?$results[$i][3]:1))*100).'% ('.$res.' / '.$results[$i][3].')</td>';
 				echo '<td>'.($is_allowedToEdit || $is_courseTutor?"<a href='exercise_show.php?user=$user&dt=$dt&res=$res&id=$id&email=$mailid'>".get_lang("Edit")."</a>":"<a href='exercise_show.php?dt=$dt&res=$res&id=$id'>".get_lang('Show')."</a>").'</td>';
 				echo '</tr>';
 			}
@@ -911,7 +911,7 @@ if($_configuration['tracking_enabled'])
 				}
 				echo '<td class="content">'.$title.'</td>';
 				echo '<td class="content">'.strftime($dateTimeFormatLong,$hpresults[$i][4]).'</td>';
-				echo '<td class="content">'.(floor($hpresults[$i][2]/($hpresults[$i][3]!=0?$hpresults[$i][3]:1))*100).'% ('.$hpresults[$i][2].' / '.$hpresults[$i][3].')</td>';
+				echo '<td class="content">'.round(($hpresults[$i][2]/($hpresults[$i][3]!=0?$hpresults[$i][3]:1))*100).'% ('.$hpresults[$i][2].' / '.$hpresults[$i][3].')</td>';
 				echo '<td></td>'; //there is no possibility to edit the results of a Hotpotatoes test
 				echo '</tr>';
 			}