From 88ba0fed41dfe99fbca4a55548105881b01b70ff Mon Sep 17 00:00:00 2001 From: trobb Date: Sat, 17 Jan 2004 10:27:01 +0000 Subject: [PATCH] Report lines after a matching question in screen display and Excel fixed. --- mod/quiz/report/fullstat/report.php | 91 ++++++++++++++++------------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/mod/quiz/report/fullstat/report.php b/mod/quiz/report/fullstat/report.php index ab4e3c384a..eb53de6c34 100755 --- a/mod/quiz/report/fullstat/report.php +++ b/mod/quiz/report/fullstat/report.php @@ -1,8 +1,8 @@ write_string($row,0,$label,$formatb); $myxls->write_string($row,1,$quests[$qid]['qtext'],$formatb); - $itemcount = 0; if($quests[$qid]['qtype']==3){ $nowchoices = $quests[$qid]['choice']; foreach($nowchoices as $thischoice){ - $row++; - $label = "A-$thischoice[choiceno]"; - $myxls->write_string($row,2,$label,$formatb); - $myxls->write_string($row,3,$thischoice[answer],$formatb); + $cno = $thischoice['choiceno']; + $row++; + $label = "A-$thischoice[choiceno]"; + $nowstat = $analysis[$cno][$itemcount]; + $pct = qr_make_pct($nowstat,$total_user_count); + $myxls->write_number($row,1,$nowstat,$formatb); + $myxls->write_number($row,2,$pct,$formatbpct); + $myxls->write_string($row,3,$thischoice[answer],$formatb); } } + if($quests[$qid]['qtype']==2){ + //"True" responses + $row++; + $nowstat = $analysis[1][$itemcount]; + $nowresp = substr($nowstat,5); + $pct = qr_make_pct($nowresp,$total_user_count); + $myxls->write_number($row,1,$nowresp,$formatb); + $myxls->write_number($row,2,$pct,$formatbpct); + $myxls->write_string($row,3,'True',$formatb); + //"False" responses + $row++; + $nowstat = $analysis[2][$itemcount]; + $nowresp = substr($nowstat,6); + $pct = qr_make_pct($nowresp,$total_user_count); + $myxls->write_number($row,1,$nowresp,$formatb); + $myxls->write_number($row,2,$pct,$formatbpct); + $myxls->write_string($row,3,'False',$formatb); + } } $workbook->close(); @@ -750,18 +757,18 @@ $string[''] = ""; } if($quests[$qid]['qtype']==2){ //"True" responses - $nowstat = $analysis[1][$qcount]; + $nowstat = $analysis[1][$itemcount]; $colpos = strpos($nowstat,":"); $nowresp = substr($nowstat,$colpos+1); - $pct_cor = qr_make_pct($nowresp,$total_user_count); - print("$nowresp ($pct_cor) "); + $pct_cor = qr_make_pct($nowresp,$total_user_count) *100; + print("$nowresp ($pct_cor%) "); print("True\n"); //"False" responses - $nowstat = $analysis[2][$qcount]; + $nowstat = $analysis[2][$itemcount]; $colpos = strpos($nowstat,":"); $nowresp = substr($nowstat,$colpos+1); - $pct_cor = qr_make_pct($nowresp,$total_user_count); - print("$nowresp ($pct_cor) "); + $pct_cor = qr_make_pct($nowresp,$total_user_count) *100; + print("$nowresp ($pct_cor%) "); print("False\n"); } } -- 2.39.5