Diff for /loncom/interface/statistics/loncorrectproblemplot.pm between versions 1.22 and 1.28

version 1.22, 2006/12/31 22:43:48 version 1.28, 2012/05/07 10:12:42
Line 31  use strict; Line 31  use strict;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
   use Apache::lonquickgrades();
 use Apache::loncoursedata();  use Apache::loncoursedata();
 use Apache::lonstatistics;  use Apache::lonstatistics;
 use Apache::lonstathelpers;  use Apache::lonstathelpers;
Line 67  sub BuildCorrectProblemsPage { Line 68  sub BuildCorrectProblemsPage {
                                                 \%Saveable_Parameters);                                                  \%Saveable_Parameters);
     #      #
     &Apache::lonstatistics::PrepareClasslist();          &Apache::lonstatistics::PrepareClasslist();    
       
       $r->print(&Apache::lonhtmlcommon::breadcrumbs('Correct Problems Plot'));
       &Apache::lonquickgrades::startGradeScreen($r,'statistics');
     #      #
     $r->print(&CreateInterface());      $r->print(&CreateInterface());
     #      #
Line 123  sub BuildCorrectProblemsPage { Line 127  sub BuildCorrectProblemsPage {
                 }                  }
             }              }
         }          }
         $r->print('<h4>'.          $r->print('<p>'.
                   &Apache::lonstatistics::section_and_enrollment_description().                    &Apache::lonstatistics::section_and_enrollment_description().
                   '</h4>');                    '</p>');
         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)) {
             # Inform the user what the time limits on the data are.              # Inform the user what the time limits on the data are.
Line 142  sub BuildCorrectProblemsPage { Line 146  sub BuildCorrectProblemsPage {
              $starttime,$endtime);               $starttime,$endtime);
         $r->print(&AnalyzeScoreData($score_data,$title,$total_weights));          $r->print(&AnalyzeScoreData($score_data,$title,$total_weights));
     } else {      } else {
         $r->print('<h3>'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'</h3>');          $r->print('<p>'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'</p>');
     }      }
     return;      return;
 }  }
Line 166  sub AnalyzeScoreData { Line 170  sub AnalyzeScoreData {
     #      #
     # Basic check first      # Basic check first
     if (ref($score_data) ne 'ARRAY' || @$score_data < 1) {      if (ref($score_data) ne 'ARRAY' || @$score_data < 1) {
         return '<h2>'.&mt('There is no data to plot').'</h2>';          return '<p class="LC_warning">'.&mt('There is no data to plot').'</p>';
     }      }
     #      #
     # Determine which bins to use      # Determine which bins to use
Line 188  sub AnalyzeScoreData { Line 192  sub AnalyzeScoreData {
         '<p>'.          '<p>'.
         &mt('Problem weights do not reflect individual student settings.')          &mt('Problem weights do not reflect individual student settings.')
         .'</p>'.          .'</p>'.
         '<table border="1">'."\n".'<tr><th>Range</th><th>Count</th></tr>'."\n";          &Apache::loncommon::start_data_table().
           &Apache::loncommon::start_data_table_header_row().
           '<th>'.&mt('Range').'</th><th>'.&mt('Count').'</th>'.
           &Apache::loncommon::end_data_table_header_row();
     my $sum = 0;      my $sum = 0;
     while (my $bin = shift(@Bins)) {      while (my $bin = shift(@Bins)) {
         push (@Xdata,$bin->{'start'});          push (@Xdata,$bin->{'start'});
Line 197  sub AnalyzeScoreData { Line 204  sub AnalyzeScoreData {
         if ($bin->{'count'} > $max) {          if ($bin->{'count'} > $max) {
             $max = $bin->{'count'};              $max = $bin->{'count'};
         }          }
         $Str.= '<tr><td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'.          $Str.= &Apache::loncommon::start_data_table_row().
             '<td>'.$bin->{'count'}.'</td></tr>'."\n";              '<td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'.
               '<td>'.$bin->{'count'}.'</td>'.
               &Apache::loncommon::end_data_table_row().'<br>';
     }      }
     # scale max to an integer.      # scale max to an integer.
     $max = 5*(int($max/5)+1);      $max = 5*(int($max/5)+1);
     $Str .= "</table><br />\n";      $Str .= &Apache::loncommon::end_data_table()."<br />\n";
     $title = &HTML::Entities::decode($title);      $title = &HTML::Entities::decode($title);
     $Str = "\n<p>".      $Str = "\n<p>".
         &Apache::loncommon::DrawBarGraph($title.' ('.$sum.' students)',          &Apache::loncommon::DrawBarGraph($title.' ('.$sum.' students)',
Line 290  sub CreateInterface { Line 299  sub CreateInterface {
     ##      ##
     ## Environment variable initialization      ## Environment variable initialization
     my $Str;      my $Str;
     $Str .= &Apache::lonhtmlcommon::breadcrumbs('Correct Problems Plot');  
     $Str .= '<p>';      $Str .= '<p>';
     #      #
     $Str .= '<table cellspacing="5">'."\n";      $Str .= &Apache::loncommon::start_data_table();
     $Str .= '<tr>';      $Str .= &Apache::loncommon::start_data_table_header_row();
     $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';      $Str .= '<th>'.&mt('Sections').'</th>';
     $Str .= '<td align="center"><b>'.&mt('Groups').'</b></td>';      $Str .= '<th>'.&mt('Groups').'</th>';
     $Str .= '<td align="center"><b>'.&mt('Access Status').'</b></td>';      $Str .= '<th>'.&mt('Access Status').'</th>';
     $Str .= '<td align="center"><b>'.&mt('Sequences and Folders').'</b></td>';      $Str .= '<th>'.&mt('Sequences and Folders').'</th>';
     $Str .= '<td rowspan="2">'.      $Str .= '<th>'.&mt('Time Period').'</th>';
         &Apache::lonstathelpers::limit_by_time_form().'</td>';      $Str .= &Apache::loncommon::end_data_table_header_row();
     $Str .= '</tr>'."\n";  
     #      #
     $Str .= '<tr><td align="center">'."\n";      $Str .= &Apache::loncommon::start_data_table_row();
       $Str .= '<td align="center" valign="top">'."\n";
     $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);      $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
     $Str .= '</td>';      $Str .= '</td>';
     #      #
     $Str .= '<td align="center">'."\n";      $Str .= '<td align="center" valign="top">'."\n";
     $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5);      $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5);
     $Str .= '</td>';      $Str .= '</td>';
     $Str .= '<td align="center">';      $Str .= '<td align="center" valign="top">';
     $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);      $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
     $Str .= '</td><td>'."\n";      $Str .= '</td>'."\n";
     #      #
       $Str .= '<td align="center" valign="top">'."\n";
     $Str .= &Apache::lonstatistics::map_select('Maps','multiple,all',5);      $Str .= &Apache::lonstatistics::map_select('Maps','multiple,all',5);
     $Str .= '</td>';      $Str .= '</td>';
     #      #
     $Str .= '</tr>'."\n";      $Str .= '<td align="center" valign="top">'."\n";
     $Str .= '</table>'."\n";      $Str .= &Apache::lonstathelpers::limit_by_time_form();
       $Str .= '</td>';
     #      #
     $Str .= '<nobr>'.&mt('Status: [_1]',      $Str .= &Apache::loncommon::end_data_table_row();
                          '<input type="text" '.      $Str .= &Apache::loncommon::end_data_table();
                          'name="stats_status" size="60" value="" />').  
             '</nobr>'.'</p>';  
     ##      ##
     return $Str;      return $Str;
 }  }

Removed from v.1.22  
changed lines
  Added in v.1.28


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