Diff for /loncom/interface/lonstatistics.pm between versions 1.144.2.2 and 1.154

version 1.144.2.2, 2010/02/13 00:30:53 version 1.154, 2011/01/17 00:19:38
Line 64  use Apache::lonpercentage; Line 64  use Apache::lonpercentage;
 use Apache::lonstudentsubmissions();  use Apache::lonstudentsubmissions();
 use Apache::lonsurveyreports();  use Apache::lonsurveyreports();
 use Apache::longradinganalysis();  use Apache::longradinganalysis();
   use Apache::lonquickgrades();
 use LONCAPA;  use LONCAPA;
   
 #  #
Line 405  sub StudentDataSelect { Line 406  sub StudentDataSelect {
     $Str .= 'size="'.$numvisible.'" >'."\n";      $Str .= 'size="'.$numvisible.'" >'."\n";
     #      #
     # Deal with 'all'      # Deal with 'all'
     $Str .= '    <option value="all" ';      $Str .= '    <option value="all"';
     foreach (@SelectedStudentData) {      foreach (@SelectedStudentData) {
         if ($_ eq 'all') {          if ($_ eq 'all') {
             $Str .= 'selected ';              $Str .= ' selected="selected"';
             last;              last;
         }          }
     }      }
Line 416  sub StudentDataSelect { Line 417  sub StudentDataSelect {
     #      #
     # Loop through the student data fields      # Loop through the student data fields
     foreach my $item (@StudentDataOrder) {      foreach my $item (@StudentDataOrder) {
         $Str .= '    <option value="'.$item.'" ';          $Str .= '    <option value="'.$item.'"';
         foreach (@SelectedStudentData) {          foreach (@SelectedStudentData) {
             if ($item eq $_ ) {              if ($item eq $_ ) {
                 $Str .= 'selected ';                  $Str .= ' selected="selected"';
                 last;                  last;
             }              }
         }          }
Line 506  sub map_select { Line 507  sub map_select {
     $form .= 'size="'.$numvisible.'" >'."\n";      $form .= 'size="'.$numvisible.'" >'."\n";
     #      #
     # Put in option for 'all'      # Put in option for 'all'
     $form .= '    <option value="all" ';      $form .= '    <option value="all"';
     if ($selected_maps[0] eq 'all') {      if ($selected_maps[0] eq 'all') {
         $form .= 'selected ';          $form .= ' selected="selected"';
     }      }
     $form .= ">all</option>\n";      $form .= ">all</option>\n";
     #      #
Line 521  sub map_select { Line 522  sub map_select {
         $navmap = shift(@sequences);          $navmap = shift(@sequences);
     }      }
     foreach my $seq (@sequences){      foreach my $seq (@sequences){
         $form .= '    <option value="'.$seq->symb.'" ';          $form .= '    <option value="'.$seq->symb.'"';
         foreach (@selected_maps) {          foreach (@selected_maps) {
             if ($seq->symb eq $_) {              if ($seq->symb eq $_) {
                 $form .= 'selected ';                  $form .= ' selected="selected"';
                 last;                  last;
             }              }
         }          }
Line 556  sub SectionSelect { Line 557  sub SectionSelect {
     #      #
     # Loop through the sequences      # Loop through the sequences
     foreach my $s (@Sections) {      foreach my $s (@Sections) {
         $Str .= '    <option value="'.$s.'" ';          $Str .= '    <option value="'.$s.'"';
         foreach (&get_selected_sections()) {          foreach (&get_selected_sections()) {
             if ($s eq $_) {              if ($s eq $_) {
                 $Str .= 'selected ';                  $Str .= ' selected="selected"';
                 last;                  last;
             }              }
         }          }
Line 591  sub GroupSelect { Line 592  sub GroupSelect {
     #      #
     # Loop through the groups      # Loop through the groups
     foreach my $s (@Groups) {      foreach my $s (@Groups) {
         $Str .= '    <option value="'.$s.'" ';          $Str .= '    <option value="'.$s.'"';
         foreach my $group (&get_selected_groups()) {          foreach my $group (&get_selected_groups()) {
             if ($s eq $group) {              if ($s eq $group) {
                 $Str .= 'selected ';                  $Str .= ' selected="selected"';
                 last;                  last;
             }              }
         }          }
Line 738  sub DisplayClasslist { Line 739  sub DisplayClasslist {
 sub CreateMainMenu {  sub CreateMainMenu {
     #      #
     # Define menu data      # Define menu data
     my @reports = ({ internal_name => 'problem_statistics',      my @reports = (
                      name => &mt('Overall Problem Statistics'),      {categorytitle => 'Statistics and Analyses',
                      short_description =>            items => [
     &mt('Student performance statistics on all problems.'),              {url => '/adm/statistics?reportSelected=problem_statistics',
                  },   permission => 'F',
                    { internal_name => 'problem_analysis',               icon => 'document-open.png',
                      name => &mt('Detailed Problem Analysis'),               linktext => ('Overall Problem Statistics'),
                      short_description =>                linktitle => ('Student performance statistics on all problems.')},
     &mt('Detailed statistics and graphs of student performance on problems.'),         
                  },              {url => '/adm/statistics?reportSelected=problem_analysis',
                    { internal_name => 'submissiontime_analysis',   permission => 'F',
                      name => &mt('Submission Time Plots'),               icon => 'prob_ana.png',
                      short_description =>                linktext => ('Detailed Problem Analysis'),
     &mt('Display and analysis of submission times on assessments.'),               linktitle => ('Detailed statistics and graphs of student performance on problems.')},
                  },           ]},
                    { internal_name => 'student_submission_reports',          {categorytitle => 'Plots',
                      name => &mt('Student Submission Reports'),           items => [
                      short_description =>               {url => '/adm/statistics?reportSelected=submissiontime_analysis',
     &mt('Prepare reports of student submissions.'),   permission => 'F',
                  },               icon => 'subtimpl.png',
                    { internal_name => 'survey_reports',               linktext => ('Submission Time Plots'),
                      name => &mt('Survey Reports'),               linktitle => ('Display and analysis of submission times on assessments.')},
                      short_description =>         
     &mt('Prepare reports on survey results.'),              {url => '/adm/statistics?reportSelected=correct_problems_plot',
                  },   permission => 'F',
                    { internal_name => 'correct_problems_plot',               icon => 'coprplot.png',
                      name => &mt('Correct Problems Plot'),               linktext => ('Correct Problems Plot'),
                      short_description =>                linktitle => ('Display a histogram of student performance in the course.')},
     &mt('Display a histogram of student performance in the course.'),           ]},
                  },          {categorytitle => 'Reports',
 #                   { internal_name => 'grading_analysis',           items => [
 #                     name => &mt('Detailed Grading Analysis'),              {url => '/adm/statistics?reportSelected=student_submission_reports',
 #                     short_description =>    permission => 'F',
 #    &mt('Display statistics about who graded who.'),               icon => 'edit-copy.png',
 #                 },               linktext => ('Student Submission Reports'),
 #                   { internal_name => 'student_assessment',               linktitle => ('Prepare reports of student submissions.')},
 #                     name => &mt('Problem Status Chart'),                      
 #                     short_description =>               {url => '/adm/statistics?reportSelected=survey_reports',
 #    &mt('Brief view of each students performance in course.'),   permission => 'F',
 #                 },               icon => 'survey_rep.png',
                    # 'percentage'  => 'Correct-problems Plot',   linktext => ('Survey Reports'),
                    # 'activitylog' => 'Activity Log',               linktitle => ('Prepare reports on survey results.')},
                    );           ]});
     #      
     # Create the menu  return &Apache::lonhtmlcommon::generate_menu(@reports);
     my $Str;   
     $Str .= '<h2>'.&mt('Please select a report to generate').'</h2>';  
     foreach my $reportdata (@reports) {  
         $Str .='    <h3><a href="/adm/statistics?reportSelected='.  
             $reportdata->{'internal_name'}.'" >'.  
             $reportdata->{'name'}."</a></h3>\n";  
         $Str .= '    '.('&nbsp;'x8).$reportdata->{'short_description'}.  
             "\n";  
     }  
     $Str .="</dl>\n";  
     #  
     return $Str;  
 }  }
   
   
Line 803  sub handler { Line 793  sub handler {
     my $r=shift;      my $r=shift;
     my $c = $r->connection();      my $c = $r->connection();
     #      #
     # Check for overloading  
     my $loaderror=&Apache::lonnet::overloaderror($r);  
     if ($loaderror) { return $loaderror; }  
     $loaderror=  
        &Apache::lonnet::overloaderror($r,  
          $env{'course.'.$env{'request.course.id'}.'.home'});  
     if ($loaderror) { return $loaderror; }  
     #  
     # Check for access      # Check for access
     if (! &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {      if (! &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
         $env{'user.error.msg'}=          $env{'user.error.msg'}=
Line 857  ENDSTYLE Line 839  ENDSTYLE
                                             bug=>'Statistics and Charts'});                                              bug=>'Statistics and Charts'});
     if (! exists($env{'form.reportSelected'}) ||       if (! exists($env{'form.reportSelected'}) || 
         $env{'form.reportSelected'} eq '') {          $env{'form.reportSelected'} eq '') {
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page').          $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page'));
                   &CreateMainMenu());          &Apache::lonquickgrades::startGradeScreen($r,'statistics');
           $r->print(&CreateMainMenu());
     } else {      } else {
     #      #
         if (! &Apache::lonmysql::verify_sql_connection()) {          if (! &Apache::lonmysql::verify_sql_connection()) {
Line 884  ENDSTYLE Line 867  ENDSTYLE
             &Apache::loncoursedata::delete_caches($env{'requres.course.id'});              &Apache::loncoursedata::delete_caches($env{'requres.course.id'});
         }          }
         #          #
           my $GoToPage = $env{'form.reportSelected'};
           #
         # Begin form output          # Begin form output
         $r->print('<form name="Statistics" ');          $r->print('<form name="Statistics" ');
           if ($GoToPage eq 'student_submission_reports') {
               $r->print('onsubmit="return checkanon();" ');
           }
         $r->print('method="post" action="/adm/statistics">');          $r->print('method="post" action="/adm/statistics">');
         $r->rflush();          $r->rflush();
         #  
         my $GoToPage = $env{'form.reportSelected'};  
         #  
         $r->print('<input type="hidden" name="reportSelected" value="'.          $r->print('<input type="hidden" name="reportSelected" value="'.
                   $GoToPage.'">');                    $GoToPage.'" />');
         if($GoToPage eq 'activitylog') {          if($GoToPage eq 'activitylog') {
 #        &Apache::lonproblemstatistics::Activity();  #        &Apache::lonproblemstatistics::Activity();
         } elsif($GoToPage eq 'problem_statistics') {          } elsif($GoToPage eq 'problem_statistics') {
Line 943  ENDSTYLE Line 928  ENDSTYLE
         #          #
         $r->print("</form>\n");          $r->print("</form>\n");
     }      }
       &Apache::lonquickgrades::endGradeScreen($r);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     $r->rflush();      $r->rflush();
     #      #

Removed from v.1.144.2.2  
changed lines
  Added in v.1.154


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