--- loncom/interface/statistics/lonproblemanalysis.pm 2004/09/29 14:38:35 1.90
+++ loncom/interface/statistics/lonproblemanalysis.pm 2004/10/04 19:10:26 1.91
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.90 2004/09/29 14:38:35 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.91 2004/10/04 19:10:26 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -56,7 +56,6 @@ my @SubmitButtons = ({ name => 'PrevProb
{ name => 'ExcelOutput',
text => 'Produce Excel Output' });
-
sub BuildProblemAnalysisPage {
my ($r,$c)=@_;
#
@@ -135,7 +134,9 @@ sub BuildProblemAnalysisPage {
my $resource = $current_problem->{'resource'};
$r->print('
'.$resource->{'title'}.'
');
$r->print(''.$resource->{'src'}.'
');
- $r->print(&Apache::lonstathelpers::render_resource($resource));
+ if ($ENV{'form.show_prob'} eq 'true') {
+ $r->print(&Apache::lonstathelpers::render_resource($resource));
+ }
$r->rflush();
my %Data = &Apache::lonstathelpers::get_problem_data
($resource->{'src'});
@@ -404,7 +405,7 @@ sub RadioResponseAnalysis {
} else {
$analysis_html .= ''.
&mt('The analysis you have selected is not supported at this time').
- '
';
+ '';
}
$r->print($analysis_html);
}
@@ -481,8 +482,8 @@ sub RR_Tries_Foil_Analysis {
}
}
}
- my $title='Attempt '.$try;
- my $xlabel = $total.' Submissions';
+ my $title='Attempt '.$try.' (N='.$total.')';
+ my $xlabel = 'Foil Chosen';
$html.= &Apache::loncommon::DrawBarGraph($title,
$xlabel,
'Percent Choosing',
@@ -830,8 +831,12 @@ sub OR_time_analysis {
> $starttime);
}
$begin_index = $j;
- while (++$j < scalar(@$performance_data)) {
- last if (&get_time_from_row($performance_data->[$j]) > $endtime);
+ while ($j < scalar(@$performance_data)) {
+ if (&get_time_from_row($performance_data->[$j]) > $endtime) {
+ last;
+ } else {
+ $j++;
+ }
}
$end_index = $j;
##
@@ -924,12 +929,13 @@ sub OR_Foil_Time_Analysis {
#
# Create the plot
my $count = $end_index-$begin_index;
+ return ('No data','') if ($count <= 0);
my $title;
if ($count == 0) {
$title = 'no submissions';
} elsif ($count == 1) {
$title = 'one submission';
- } else {
+ } elsif ($count > 1) {
$title = $count.' submissions';
}
my $correct_plot = &Apache::loncommon::DrawBarGraph($title,
@@ -945,6 +951,8 @@ sub OR_Foil_Time_Analysis {
$count = $end_index-$begin_index-$TimeData{'_correct'};
if ($count == 0) {
$title = 'no submissions';
+ } elsif ($count < 0) {
+ return ($correct_plot,'');
} elsif ($count == 1) {
$title = 'one submission';
} else {
@@ -956,8 +964,7 @@ sub OR_Foil_Time_Analysis {
100,
$plotcolors,
undef,
- @plotdata);
-
+ @plotdata);
return ($correct_plot,$incorrect_plot);
}
@@ -1376,6 +1383,17 @@ sub CreateInterface {
##
##
$Str .= '';
+ ##
+ my $showprob_checkbox =
+ '';
+ $Str.= ' ';
+ ##
my $analyze_selector = '';
- $Str .= ''.
+ $Str .= ' '.$/;
+ ' '.$/;
##
my $numplots_selector = ' |