--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/07 16:07:39 1.26
+++ loncom/interface/statistics/lonproblemanalysis.pm 2003/10/08 19:20:47 1.27
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.26 2003/10/07 16:07:39 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.27 2003/10/08 19:20:47 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -82,7 +82,7 @@ sub BuildProblemAnalysisPage {
}
$r->print('
');
} else {
- $r->print('No Problem Selected
');
+ $r->print(''.&mt('Please select a problem to analyze').'
');
}
# Okay, they asked for data, so make sure we get the latest data.
$r->print(&OptionResponseProblemSelector());
@@ -150,10 +150,34 @@ sub DoTriesAnalysis {
}
my @Data = (' | ');
for (my $i=$mintries;$i<=$maxtries;$i++) {
- push(@Data,''.&DrawGraph('Attempt '.$i,'Foil Number',
- 'Percent Correct',100,
- $PlotData[$i]->{'good'},
- $PlotData[$i]->{'bad'}).' | ');
+ my $minstu = $ResponseData{$Foils[0]}->[$i]->{'total'};
+ my $maxstu = $ResponseData{$Foils[0]}->[$i]->{'total'};
+ foreach my $foilid (@Foils) {
+ if ($minstu > $ResponseData{$foilid}->[$i]->{'total'}) {
+ $minstu = $ResponseData{$foilid}->[$i]->{'total'};
+ }
+ if ($maxstu < $ResponseData{$foilid}->[$i]->{'total'}) {
+ $maxstu = $ResponseData{$foilid}->[$i]->{'total'};
+ }
+ }
+ my $graphlink;
+ if ($maxstu == $minstu) {
+ $graphlink = &DrawGraph('Attempt '.$i.', '.$maxstu.' students',
+ 'Foil Number',
+ 'Percent Correct',
+ 100,
+ $PlotData[$i]->{'good'},
+ $PlotData[$i]->{'bad'});
+ } else {
+ $graphlink = &DrawGraph('Attempt '.$i.', '.$minstu.'-'.$maxstu.
+ ' students',
+ 'Foil Number',
+ 'Percent Correct',
+ 100,
+ $PlotData[$i]->{'good'},
+ $PlotData[$i]->{'bad'});
+ }
+ push(@Data,''.$graphlink.' | ');
}
push (@Rows,\@Data);
my $table = ''."\n";
@@ -193,6 +217,8 @@ sub analyze_option_data_by_tries {
! exists($tryhash->{'incorrect'})) ||
($tryhash->{'correct'} < 1 &&
$tryhash->{'incorrect'} < 1));
+ $tryhash->{'total'} = $tryhash->{'correct'} +
+ $tryhash->{'incorrect'};
$tryhash->{'percent_corr'} = 100 *
($tryhash->{'correct'} /
($tryhash->{'correct'} + $tryhash->{'incorrect'})