Diff for /loncom/interface/statistics/loncorrectproblemplot.pm between versions 1.11 and 1.14

version 1.11, 2004/06/04 21:42:18 version 1.14, 2004/12/10 20:41:39
Line 110  sub BuildCorrectProblemsPage { Line 110  sub BuildCorrectProblemsPage {
                     }                      }
                 }                  }
             }              }
           } else {
               $title = "All Problems";
               foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()){
                   foreach my $res (@{$seq->{'contents'}}) {
                       next if ($res->{'type'} ne 'assessment');
                       $total_parts += scalar(@{$res->{'parts'}});
                   }
               }
         }          }
         my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();          my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
         if (defined($starttime) || defined($endtime)) {          if (defined($starttime) || defined($endtime)) {
Line 148  sub AnalyzeScoreData { Line 156  sub AnalyzeScoreData {
     my ($score_data,$title,$total_parts) = @_;      my ($score_data,$title,$total_parts) = @_;
     #      #
     # Basic check first      # Basic check first
     if (@$score_data < 1) {      if (ref($score_data) ne 'ARRAY' || @$score_data < 1) {
         return '<h2>There is no data to plot</h2>';          return '<h2>'.&mt('There is no data to plot').'</h2>';
     }      }
     #      #
     # Determine which bins to use      # Determine which bins to use
     my $lowest  = $score_data->[0]->[0];      my $lowest  = $score_data->[0]->[0];
     $lowest = 0;      $lowest = 0;
     my $highest = $score_data->[-1]->[0];      my $highest = $score_data->[-1]->[0];
     &Apache::lonnet::logthis('highest = '.$highest);  
     my $binsize = 1;      my $binsize = 1;
     if ($highest > 50) { $binsize = 2; }      if ($highest > 50) { $binsize = 2; }
     if ($highest > 100) { $binsize = 5; }      if ($highest > 100) { $binsize = 5; }
Line 186  sub AnalyzeScoreData { Line 193  sub AnalyzeScoreData {
     $Str .= "</table><br />\n";      $Str .= "</table><br />\n";
     $title = &HTML::Entities::decode($title);      $title = &HTML::Entities::decode($title);
     $Str = "\n<p>".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum,      $Str = "\n<p>".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum,
                                  'Num Correct Problems (max:'.$total_parts.')',                                   'Correct Problems (max possible = '.$total_parts.')',
                                                        'Number of students',                                                         'Number of students',
                                                        $max,                                                         $max,
                                                        undef, # colors                                                         undef, # colors

Removed from v.1.11  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>