Diff for /loncom/interface/lonstatistics.pm between versions 1.144.2.1 and 1.148.2.7

version 1.144.2.1, 2009/12/11 00:12:21 version 1.148.2.7, 2010/12/05 17:27:30
Line 400  sub StudentDataSelect { Line 400  sub StudentDataSelect {
     my $Str = "\n";      my $Str = "\n";
     $Str .= '<select name="'.$elementname.'" ';      $Str .= '<select name="'.$elementname.'" ';
     if ($status ne 'single') {      if ($status ne 'single') {
         $Str .= 'multiple="true" ';          $Str .= 'multiple="multiple" ';
     }      }
     $Str .= 'size="'.$numvisible.'" >'."\n";      $Str .= 'size="'.$numvisible.'" >'."\n";
     #      #
Line 456  sub selected_sequences_with_assessments Line 456  sub selected_sequences_with_assessments
         return ('Can not open Coursemap');          return ('Can not open Coursemap');
     }      }
     #      #
     my @sequences = $navmap->retrieveResources(undef,      my $mapurl;
       if (&Apache::loncommon::needs_gci_custom()) {
           my $cid = $env{'request.course.id'};
           if ($cid) {
               my $cdom = $env{'course.'.$cid.'.domain'};
               if ($cdom =~ /^\w+citest$/) {
                   my $sequence = &Apache::loncommon::get_citest_map($cdom);
                   my $cnum = $env{'course.'.$cid.'.num'};  
                   if ($sequence) {
                       $mapurl = '/uploaded/'.$cdom.'/'.$cnum.'/'.$sequence;
                   }
               }
           }
       }
       my @sequences = $navmap->retrieveResources($mapurl,
                                                sub { shift->is_map(); },1,0,1);                                                 sub { shift->is_map(); },1,0,1);
     my $toplevelseq = $navmap->getById('0.0');      unless (&Apache::loncommon::needs_gci_custom()) {
     if (!grep(/^\Q$toplevelseq\E$/,@sequences)) {          my $toplevelseq = $navmap->getById('0.0');
         unshift(@sequences,$toplevelseq);          if (!grep(/^\Q$toplevelseq\E$/,@sequences)) {
               unshift(@sequences,$toplevelseq);
           }
     }      }
   
     my @sequences_with_assessments;      my @sequences_with_assessments;
Line 501  sub map_select { Line 517  sub map_select {
     my $form = "\n";      my $form = "\n";
     $form .= '<select name="'.$elementname.'" ';      $form .= '<select name="'.$elementname.'" ';
     if ($status ne 'single') {      if ($status ne 'single') {
         $form .= 'multiple="true" ';          $form .= 'multiple="multiple" ';
     }      }
     $form .= 'size="'.$numvisible.'" >'."\n";      $form .= 'size="'.$numvisible.'" >'."\n";
     #      unless (&Apache::loncommon::needs_gci_custom()) {
     # Put in option for 'all'          #
     $form .= '    <option value="all" ';          # Put in option for 'all'
     if ($selected_maps[0] eq 'all') {          $form .= '    <option value="all" ';
         $form .= 'selected ';          if ($selected_maps[0] eq 'all') {
               $form .= 'selected ';
           }
           $form .= ">all</option>\n";
     }      }
     $form .= ">all</option>\n";  
     #      #
     # Loop through the sequences      # Loop through the sequences
     my @sequences = &selected_sequences_with_assessments('all');      my @sequences = &selected_sequences_with_assessments('all');
Line 522  sub map_select { Line 540  sub map_select {
     }      }
     foreach my $seq (@sequences){      foreach my $seq (@sequences){
         $form .= '    <option value="'.$seq->symb.'" ';          $form .= '    <option value="'.$seq->symb.'" ';
         foreach (@selected_maps) {          if ((&Apache::loncommon::needs_gci_custom()) && (@selected_maps == 1)) {
             if ($seq->symb eq $_) {              $form .= 'selected ';
                 $form .= 'selected ';          } else {
                 last;              foreach (@selected_maps) {
                   if ($seq->symb eq $_) {
                       $form .= 'selected ';
                       last;
                   }
             }              }
         }          }
         $form .= '>'.$seq->compTitle."</option>\n";          $form .= '>'.$seq->compTitle."</option>\n";
Line 550  sub SectionSelect { Line 572  sub SectionSelect {
     my $Str = "\n";      my $Str = "\n";
     $Str .= '<select name="'.$elementname.'" ';      $Str .= '<select name="'.$elementname.'" ';
     if ($status ne 'single') {      if ($status ne 'single') {
         $Str .= 'multiple="true" ';          $Str .= 'multiple="multiple" ';
     }      }
     $Str .= 'size="'.$numvisible.'" >'."\n";      $Str .= 'size="'.$numvisible.'" >'."\n";
     #      #
Line 585  sub GroupSelect { Line 607  sub GroupSelect {
     my $Str = "\n";      my $Str = "\n";
     $Str .= '<select name="'.$elementname.'" ';      $Str .= '<select name="'.$elementname.'" ';
     if ($status ne 'single') {      if ($status ne 'single') {
         $Str .= 'multiple="true" ';          $Str .= 'multiple="multiple" ';
     }      }
     $Str .= 'size="'.$numvisible.'" >'."\n";      $Str .= 'size="'.$numvisible.'" >'."\n";
     #      #
Line 738  sub DisplayClasslist { Line 760  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 => 'edit-find.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.'),           ]});
                  },      if (&Apache::loncommon::needs_gci_custom()) {
 #                   { internal_name => 'grading_analysis',          push(@reports,
 #                     name => &mt('Detailed Grading Analysis'),          {categorytitle => 'Reports',
 #                     short_description =>            items => [
 #    &mt('Display statistics about who graded who.'),              {url => '/adm/statistics?reportSelected=student_submission_reports',
 #                 },                           permission => 'F',
 #                   { internal_name => 'student_assessment',               icon => 'edit-copy.png',
 #                     name => &mt('Problem Status Chart'),               linktext => ('Student Submission Reports'),
 #                     short_description =>                linktitle => ('Prepare reports of student submissions.')},
 #    &mt('Brief view of each students performance in course.'),           ]});
 #                 },      } else {
                    # 'percentage'  => 'Correct-problems Plot',          push(@reports,
                    # 'activitylog' => 'Activity Log',          {categorytitle => 'Reports',
                    );           items => [
     #              {url => '/adm/statistics?reportSelected=student_submission_reports',
     # Create the menu   permission => 'F',
     my $Str;               icon => 'edit-copy.png',
     $Str .= '<h2>'.&mt('Please select a report to generate').'</h2>';               linktext => ('Student Submission Reports'),
     foreach my $reportdata (@reports) {               linktitle => ('Prepare reports of student submissions.')},
         $Str .='    <h3><a href="/adm/statistics?reportSelected='.                      
             $reportdata->{'internal_name'}.'" >'.              {url => '/adm/statistics?reportSelected=survey_reports',
             $reportdata->{'name'}."</a></h3>\n";   permission => 'F',
         $Str .= '    '.('&nbsp;'x8).$reportdata->{'short_description'}.               icon => 'docs.png',
             "\n";   linktext => ('Survey Reports'),
                linktitle => ('Prepare reports on survey results.')},
            ]});
     }      }
     $Str .="</dl>\n";      
     #  return &Apache::lonhtmlcommon::generate_menu(@reports);
     return $Str;   
 }  }
   
   
   
 sub handler {  sub handler {
     my $r=shift;      my $r=shift;
     my $c = $r->connection();      my $c = $r->connection();
Line 828  sub handler { Line 850  sub handler {
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     if ($r->header_only) { return OK; }      if ($r->header_only) { return OK; }
       my $gcicustom = &Apache::loncommon::needs_gci_custom();
       if ($gcicustom) {
           my $now = time;
           my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
           my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
           my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
           my $duedate = $courseopt->{$env{'request.course.id'}.'.0.duedate'};
           if ((!$duedate) || ($duedate > $now)) {
               my $brcrum = [{href=> '/adm/statistics',
                              text=> 'Statistics',}];
               my $args = {bread_crumbs           => $brcrum,
                           bread_crumbs_component => 'Statistics Main Page'};
               $r->print(&Apache::loncommon::start_page('Course Statistics',undef,$args));
               $r->print('<h3>'.&mt('Display of statistics').'</h3>');
               if ($duedate > $now) { 
                   $r->print('<p>'.&mt('Aggregate test performance data will be available after the Concept Test end date: [_1].',
                            &Apache::lonlocal::locallocaltime($duedate)).'</p>');
               } else {
                   $r->print('<p>'.
                             &mt('Aggregate test performance data unavailable without definition of an end date for the Concept Test.').'</p>');
               }
               $r->print(&Apache::loncommon::end_page());
               return OK;
           }
       }
   
     #      #
     # Extract form elements from query string      # Extract form elements from query string
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
Line 872  ENDSTYLE Line 920  ENDSTYLE
                      .'</p>');                       .'</p>');
             $r->print('<p>'.              $r->print('<p>'.
                       &mt('Course Statistics and Charts cannot be '.                        &mt('Course Statistics and Charts cannot be '.
                           'retrieved until the database is restarted.  '.                            'retrieved until the database is restarted. '.
                           'Your data is intact but cannot be displayed '.                            'Your data is intact but cannot be displayed '.
                           'at this time.').'</p>');                            'at this time.').'</p>');
             $r->print(&Apache::loncommon::end_page());              $r->print(&Apache::loncommon::end_page());
Line 913  ENDSTYLE Line 961  ENDSTYLE
             &Apache::lonsubmissiontimeanalysis::BuildSubmissionTimePage($r,$c);              &Apache::lonsubmissiontimeanalysis::BuildSubmissionTimePage($r,$c);
         } elsif($GoToPage eq 'student_submission_reports') {          } elsif($GoToPage eq 'student_submission_reports') {
             &Apache::lonhtmlcommon::add_breadcrumb              &Apache::lonhtmlcommon::add_breadcrumb
                 ({href=>              ({href=>
                   '/adm/statistics?reportselected=student_submission_reports',                '/adm/statistics?reportselected=student_submission_reports',
                   text=>'Student Submission Reports'});                text=>'Student Submission Reports'});
             &Apache::lonstudentsubmissions::BuildStudentSubmissionsPage($r,$c);              &Apache::lonstudentsubmissions::BuildStudentSubmissionsPage($r,$c);
         } elsif($GoToPage eq 'survey_reports') {          } elsif($GoToPage eq 'survey_reports') {
             &Apache::lonhtmlcommon::add_breadcrumb              &Apache::lonhtmlcommon::add_breadcrumb
Line 933  ENDSTYLE Line 981  ENDSTYLE
             &Apache::lonhtmlcommon::add_breadcrumb              &Apache::lonhtmlcommon::add_breadcrumb
                 ({href=>'/adm/statistics?reportselected=student_assessment',                  ({href=>'/adm/statistics?reportselected=student_assessment',
                   text=>'Chart'});                    text=>'Chart'});
             &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);              if ($gcicustom) {
                   $r->print(&mt('Only aggregate performance data are available for Concept Tests.'));  
               } else {
                   &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);
               }
         } elsif($GoToPage eq 'grading_analysis') {          } elsif($GoToPage eq 'grading_analysis') {
             &Apache::lonhtmlcommon::add_breadcrumb              &Apache::lonhtmlcommon::add_breadcrumb
                 ({href=>'/adm/statistics?reportselected=grading_anaylsis',                  ({href=>'/adm/statistics?reportselected=grading_anaylsis',

Removed from v.1.144.2.1  
changed lines
  Added in v.1.148.2.7


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