Diff for /loncom/interface/lonstatistics.pm between versions 1.149 and 1.156.2.7

version 1.149, 2010/04/12 15:55:29 version 1.156.2.7, 2016/08/14 16:38:05
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 365  sub section_or_group_text { Line 366  sub section_or_group_text {
   
 sub get_students {  sub get_students {
     if (! @Students) {      if (! @Students) {
         &PrepareClasslist()          &PrepareClasslist();
     }      }
     return @Students;      return @Students;
 }  }
Line 412  sub StudentDataSelect { Line 413  sub StudentDataSelect {
             last;              last;
         }          }
     }      }
     $Str .= ">all</option>\n";      $Str .= '>'.&mt('all')."</option>\n";
     #      #
     # Loop through the student data fields      # Loop through the student data fields
     foreach my $item (@StudentDataOrder) {      foreach my $item (@StudentDataOrder) {
Line 423  sub StudentDataSelect { Line 424  sub StudentDataSelect {
                 last;                  last;
             }              }
         }          }
         $Str .= '>'.$item."</option>\n";          $Str .= '>'.&mt($item)."</option>\n";
     }      }
     $Str .= "</select>\n";      $Str .= "</select>\n";
     return $Str;      return $Str;
Line 510  sub map_select { Line 511  sub map_select {
     if ($selected_maps[0] eq 'all') {      if ($selected_maps[0] eq 'all') {
         $form .= ' selected="selected"';          $form .= ' selected="selected"';
     }      }
     $form .= ">all</option>\n";      $form .= '>'.&mt('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 546  sub SectionSelect { Line 547  sub SectionSelect {
         &PrepareClasslist()          &PrepareClasslist()
     }      }
     #      #
       # Make sure course's student table is up to date
       if (@Sections) {
           &Apache::loncoursedata::ensure_current_sections();
       }
       #
     # Build the form element      # Build the form element
     my $Str = "\n";      my $Str = "\n";
     $Str .= '<select name="'.$elementname.'" ';      $Str .= '<select name="'.$elementname.'" ';
Line 581  sub GroupSelect { Line 587  sub GroupSelect {
         &PrepareClasslist();          &PrepareClasslist();
     }      }
     #      #
       # Make sure course's groupnames and studentgroups tables
       # are up to date.
       #
       if (@Groups) {
           &Apache::loncoursedata::ensure_current_groups();
           &Apache::loncoursedata::ensure_current_students_groups();
       }
       #
     # Build the form element      # Build the form element
     my $Str = "\n";      my $Str = "\n";
     $Str .= '<select name="'.$elementname.'" ';      $Str .= '<select name="'.$elementname.'" ';
Line 614  sub DisplayClasslist { Line 628  sub DisplayClasslist {
     # Output some of the standard interface components      # Output some of the standard interface components
     my $Str;      my $Str;
     $Str .= &Apache::lonhtmlcommon::breadcrumbs('Select One Student');      $Str .= &Apache::lonhtmlcommon::breadcrumbs('Select One Student');
     $Str .= '<p><table cellspacing="5">'."\n";      $Str .= '<table cellspacing="5">'."\n";
     $Str .= '<tr>';      $Str .= '<tr>';
     $Str .= '<th align="center"><b>'.&mt('Sections').'</b></th>';      $Str .= '<th align="center"><b>'.&mt('Sections').'</b></th>';
     $Str .= '<th align="center"><b>'.&mt('Groups').'</b></th>';      $Str .= '<th align="center"><b>'.&mt('Groups').'</b></th>';
Line 632  sub DisplayClasslist { Line 646  sub DisplayClasslist {
         '</td>';          '</td>';
           
     $Str .= '</tr>'.$/;      $Str .= '</tr>'.$/;
     $Str .= '</table></p>';      $Str .= '</table>';
     $Str .= '<input type="submit" name="selectstudent" value="'.      $Str .= '<input type="submit" name="selectstudent" value="'.
         &mt('Update Display').'" />';          &mt('Update Display').'" />';
     $r->print($Str);      $r->print($Str);
Line 690  sub DisplayClasslist { Line 704  sub DisplayClasslist {
     }      }
   
     $Str .= '<h2>'.&mt('Select One Student').'</h2>'      $Str .= '<h2>'.&mt('Select One Student').'</h2>'
            .'<p>'.&mt("Click on a student's name or username to view their chart").'</p>'             .'<p>'.&mt("Click on a student's name or username to view their chart.").'</p>'
            .&Apache::loncommon::start_data_table()             .&Apache::loncommon::start_data_table()
            .&Apache::loncommon::start_data_table_header_row();             .&Apache::loncommon::start_data_table_header_row();
     foreach my $field (@Fields) {      foreach my $field (@Fields) {
         $Str .= '<th><a href="/adm/statistics?'.          $Str .= '<th><a href="/adm/statistics?'.
             'reportSelected=student_assessment&'.              'reportSelected=student_assessment&amp;'.
             'selectstudent=1&'.              'selectstudent=1&amp;'.
             'sort='.$field.'">'.&mt($field).              'sort='.$field.'">'.&mt($field).
             '</a></th>';              '</a></th>';
     }      }
Line 711  sub DisplayClasslist { Line 725  sub DisplayClasslist {
             if ($field eq 'fullname' || $field eq 'username') {              if ($field eq 'fullname' || $field eq 'username') {
                 $Str .= '<a href="/adm/statistics?reportSelected=';                  $Str .= '<a href="/adm/statistics?reportSelected=';
                 $Str .= &escape('student_assessment');                  $Str .= &escape('student_assessment');
                 $Str .= '&sort='.&escape($env{'form.sort'});                  $Str .= '&amp;sort='.&escape($env{'form.sort'});
                 $Str .= '&SelectedStudent=';                  $Str .= '&amp;SelectedStudent=';
                 $Str .= &escape($sname).'">';                  $Str .= &escape($sname).'">';
                 $Str .= $student->{$field}.'&nbsp;';                  $Str .= $student->{$field};
                 $Str .= '</a>';                  $Str .= '</a>';
             } elsif ($field eq 'status') {              } elsif ($field eq 'status') {
                 $Str .= &mt($student->{$field});                  $Str .= &mt($student->{$field});
             } else {              } else {
                 $Str .= $student->{$field};                  if ($student->{$field} eq 'none') {
                       $Str .= &mt('none')
                   } else {
                       $Str .= $student->{$field};
                   }
             }              }
             $Str .= '</td>';              $Str .= '</td>';
         }          }
Line 749  sub CreateMainMenu { Line 767  sub CreateMainMenu {
                 
             {url => '/adm/statistics?reportSelected=problem_analysis',              {url => '/adm/statistics?reportSelected=problem_analysis',
  permission => 'F',   permission => 'F',
              icon => 'edit-find.png',               icon => 'prob_ana.png',
              linktext => ('Detailed Problem Analysis'),               linktext => ('Detailed Problem Analysis'),
              linktitle => ('Detailed statistics and graphs of student performance on problems.')},               linktitle => ('Detailed statistics and graphs of student performance on problems.')},
          ]},           ]},
Line 777  sub CreateMainMenu { Line 795  sub CreateMainMenu {
                                           
             {url => '/adm/statistics?reportSelected=survey_reports',              {url => '/adm/statistics?reportSelected=survey_reports',
  permission => 'F',   permission => 'F',
              icon => 'docs.png',               icon => 'survey_rep.png',
  linktext => ('Survey Reports'),   linktext => ('Survey Reports'),
              linktitle => ('Prepare reports on survey results.')},               linktitle => ('Prepare reports on survey results.')},
          ]});           ]});
Line 792  sub handler { Line 810  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 852  ENDSTYLE Line 862  ENDSTYLE
     #      #
         if (! &Apache::lonmysql::verify_sql_connection()) {          if (! &Apache::lonmysql::verify_sql_connection()) {
             my $serveradmin = $r->dir_config('lonAdmEMail');              my $serveradmin = $r->dir_config('lonAdmEMail');
             $r->print('<h2 class="LC_error">'.              $r->print('<p class="LC_error">'.
                       &mt('Unable to connect to database!').                        &mt('Unable to connect to database!').
                       '</h2>');                        '</p>');
             $r->print('<p>'              $r->print('<p>'
                      .&mt('Please notify the server administrator [_1]',                       .&mt('Please notify the server administrator [_1]',
                          ,'<b>'.$serveradmin.'</b>')                           ,'<b>'.$serveradmin.'</b>')
Line 870  ENDSTYLE Line 880  ENDSTYLE
         #          #
         # Clean out the caches          # Clean out the caches
         if (exists($env{'form.ClearCache'})) {          if (exists($env{'form.ClearCache'})) {
             &Apache::loncoursedata::delete_caches($env{'requres.course.id'});              &Apache::loncoursedata::delete_caches($env{'request.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') {

Removed from v.1.149  
changed lines
  Added in v.1.156.2.7


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