Diff for /loncom/interface/lonstatistics.pm between versions 1.76 and 1.78.2.2

version 1.76, 2003/06/10 19:19:57 version 1.78.2.2, 2003/10/03 15:40:47
Line 805  sub DisplayClasslist { Line 805  sub DisplayClasslist {
     my @Fields = ('fullname','username','domain','id','section');      my @Fields = ('fullname','username','domain','id','section');
     #      #
     my $Str='';      my $Str='';
       if (! @Students) {
           if ($SelectedSections[0] eq 'all') { 
               if (lc($ENV{'form.Status'}) eq 'any') {
                   $Str .= '<h2>There are no students in the course.</h2>';
               } elsif (lc($ENV{'form.Status'}) eq 'active') {
                   $Str .= '<h2>There are no currently enrolled students in '.
                       'the course.</h2>';
               } elsif (lc($ENV{'form.Status'}) eq 'expired') {
                   $Str .= '<h2>There are no previously enrolled '.
                       'students in the course.</h2>';
               }
           } else { 
               my $sections;
               if (@SelectedSections == 1) {
                   $sections = 'section '.$SelectedSections[0];
               } elsif (@SelectedSections > 2) {
                   $sections = 'sections '.join(', ',@SelectedSections);
                   $sections =~ s/, ([^,])*$/, and $1/;
               } else {
                   $sections = 'sections '.join(' and ',@SelectedSections);
               }
               if (lc($ENV{'form.Status'}) eq 'any') {
                   $Str .= '<h2>There are no students in '.$sections.'.</h2>';
               } elsif (lc($ENV{'form.Status'}) eq 'active') {
                   $Str .= '<h2>There are no currently enrolled students '.
                       'in '.$sections.'.</h2>';
               } elsif (lc($ENV{'form.Status'}) eq 'expired') {
                   $Str .= '<h2>There are no previously enrolled students '.
                       'in '.$sections.'.</h2>';
               }
           }
           $Str.= '<a href="/adm/statistics?reportSelected=student_assessment">'.
               'Return to the chart.</a>';
           $r->print($Str);
           $r->rflush();
           return;
       }
   
     # "Click" is asinine but it is probably not my place to change the world.      # "Click" is asinine but it is probably not my place to change the world.
     $Str .= '<h2>Click on a users name to view their chart</h2>';      $Str .= '<h2>Click on a students name or username to view their chart</h2>';
     $Str .= '<table border="0"><tr><td bgcolor="#777777">'."\n";      $Str .= '<table border="0"><tr><td bgcolor="#777777">'."\n";
     $Str .= '<table border="0" cellpadding="3"><tr bgcolor="#e6ffff">'."\n";      $Str .= '<table border="0" cellpadding="3"><tr bgcolor="#e6ffff">'."\n";
     foreach my $field (@Fields) {      foreach my $field (@Fields) {
Line 827  sub DisplayClasslist { Line 865  sub DisplayClasslist {
         #          #
         foreach my $field (@Fields) {          foreach my $field (@Fields) {
             $Str .= '<td>';              $Str .= '<td>';
             if ($field eq 'fullname') {              if ($field eq 'fullname' || $field eq 'username') {
                 $Str .= '<a href="/adm/statistics?reportSelected=';                  $Str .= '<a href="/adm/statistics?reportSelected=';
                 $Str .= &Apache::lonnet::escape('student_assessment');                  $Str .= &Apache::lonnet::escape('student_assessment');
                 $Str .= '&sort='.&Apache::lonnet::escape($ENV{'form.sort'});                  $Str .= '&sort='.&Apache::lonnet::escape($ENV{'form.sort'});
Line 857  sub CreateMainMenu { Line 895  sub CreateMainMenu {
     #      #
     my $Str = '';      my $Str = '';
     #      #
     $Str .= '<table border="0"><tbody><tr>'."\n";      $Str  = '<input type="hidden" name="reportSelected" value="'.$current.'">';
     $Str .= '<td align="center"><b>Report:</b></td>'."\n";  #    $Str .= '<table border="0"><tbody><tr>'."\n";
     $Str .= '<td align="center">';  #    $Str .= '<td align="center"><b>Report:</b></td>'."\n";
     $Str .= '<select name="reportSelected" '.  #    $Str .= '<td align="center">';
         'onchange="document.Statistics.submit()">'."\n";  #    $Str .= '<select name="reportSelected" '.
     foreach (sort(keys(%$reports))) {  #        'onchange="document.Statistics.submit()">'."\n";
         $Str .= '<option value="'.$_.'"';  #    foreach (sort(keys(%$reports))) {
         if($current eq $_) {  #        $Str .= '<option value="'.$_.'"';
             $Str .= ' selected';  #        if($current eq $_) {
         }  #            $Str .= ' selected';
         $Str .= '>'.$reports->{$_}.'</option>'."\n";  #        }
     }  #        $Str .= '>'.$reports->{$_}.'</option>'."\n";
     $Str .= '</select></td>'."\n";  #    }
     #  #    $Str .= '</select></td>'."\n";
     $Str .= '<td>'.('&nbsp;'x30).'</td>';  #    #
     $Str .= '<td align="center">'.  #    $Str .= '<td>'.('&nbsp;'x30).'</td>';
         '<input type="submit" name="ClearCache" value="Clear Caches" />'.  #    $Str .= '<td align="center">'.
             "</td>\n";  #        '<input type="submit" name="ClearCache" value="Clear Caches" />'.
     $Str .= '</tr></tbody></table>'."\n";  #            "</td>\n";
     $Str .= '<hr>'."\n";  #    $Str .= '</tr></tbody></table>'."\n";
   #    $Str .= '<hr>'."\n";
     #      #
     return $Str;      return $Str;
 }  }
Line 887  sub handler { Line 926  sub handler {
     my $r=shift;      my $r=shift;
     my $c = $r->connection();      my $c = $r->connection();
     #      #
       &Apache::loncoursedata::clear_internal_caches();
       #
       &Apache::loncoursedata::clear_internal_caches();
       #
     # Check for overloading      # Check for overloading
     my $loaderror=&Apache::lonnet::overloaderror($r);      my $loaderror=&Apache::lonnet::overloaderror($r);
     if ($loaderror) { return $loaderror; }      if ($loaderror) { return $loaderror; }
Line 987  END Line 1030  END
         &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);          &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);
     } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') {      } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') {
 #        &Apache::lonproblemstatistics::BuildGraphicChart($r,$c);  #        &Apache::lonproblemstatistics::BuildGraphicChart($r,$c);
     } elsif($GoToPage eq 'classlist') {  
         &DisplayClasslist($r);  
     } elsif($GoToPage eq 'Correct-problems Plot') {      } elsif($GoToPage eq 'Correct-problems Plot') {
 # &Apache::lonpercentage::BuildPercentageGraph($r,$c);  # &Apache::lonpercentage::BuildPercentageGraph($r,$c);
     }      }

Removed from v.1.76  
changed lines
  Added in v.1.78.2.2


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