From: trobb Date: Sun, 21 Dec 2003 13:56:24 +0000 (+0000) Subject: Bug in percentage calculation for on-screen display fixed X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=83d8e36f15296cfcce6c7332bbd839a87fc473c9;p=moodle.git Bug in percentage calculation for on-screen display fixed --- diff --git a/mod/quiz/report/fullstat/report.php b/mod/quiz/report/fullstat/report.php index c9b703338b..d5e76f57d7 100755 --- a/mod/quiz/report/fullstat/report.php +++ b/mod/quiz/report/fullstat/report.php @@ -723,7 +723,7 @@ $string[''] = ""; } print("\n"); - //display a row for each possible multiple choice with $max_choices being highest row,$table_colcount is the width + //display a row for each possible separate response with $max_choices being highest row,$table_colcount is the width for ($i = 1; $i<= $max_choices;$i++){ print(" M/C #$i"); //display answer tallies @@ -739,7 +739,8 @@ $string[''] = ""; //Display the total percent correct print("$strpercentcorrect:"); for ($i = 0; $i< $table_colcount;$i++){ - print ("{$pct_correct[$i]}% "); + $nowpct = $pct_correct[$i] * 100; + print ("$nowpct% "); } print("\n"); //Finally display the itemanalysis @@ -932,7 +933,7 @@ function qr_make_footers(){ function qr_make_pct($this_correct,$totusers){ global $qs_in_order,$qtally,$quests,$total_user_count; if($this_correct>0 and $totusers > 0){ - $pct_cor =(floor(($this_correct/$totusers)*10)/10); + $pct_cor =(floor(($this_correct/$totusers)*1000)/1000); } else { $pct_cor = 0; }