Diff for /loncom/interface/lonwhatsnew.pm between versions 1.22 and 1.25

version 1.22, 2005/07/08 10:39:49 version 1.25, 2005/07/15 05:30:06
Line 38  use Apache::lonnavmaps(); Line 38  use Apache::lonnavmaps();
 use Apache::lonuserstate;  use Apache::lonuserstate;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Time::Local;  use Time::Local;
   use GDBM_File;
   
 #----------------------------  #----------------------------
 # handler  # handler
Line 190  sub display_actions_box() { Line 191  sub display_actions_box() {
         $r->print('<br /><b><center>You are accessing an invalid course.</center></b><br /><br />');          $r->print('<br /><b><center>You are accessing an invalid course.</center></b><br /><br />');
         return;          return;
     }      }
       if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
     my ($furl,$ferr)=      &GDBM_READER(),0640)) {
            &Apache::lonuserstate::readmap($cdom.'/'.$crs);   my $furl=$bighash{'first_url'};
     $r->print('<font size="+1"><a href="'.$furl.'">Go to first resource</a></font><a href="/adm/preferences?action=changecourseinit"></font><br />Change your preferences</a> to suppress display of this screen when accessing courses as Course Coordinator in the future.<br /><hr />');   $r->print('<font size="+1"><a href="'.$furl.'">Go to first resource</a></font><a href="/adm/preferences?action=changecourseinit"></font><br />Change your preferences</a> to suppress display of this screen when accessing courses as Course Coordinator in the future.<br /><hr />');
    untie(%bighash);
       }
   
     my $result;      my $result;
   
Line 264  END Line 267  END
         @bombs = sort { &cmp_title($a,$b,\%res_title) } @bombs;          @bombs = sort { &cmp_title($a,$b,\%res_title) } @bombs;
         foreach my $bomb (@bombs) {          foreach my $bomb (@bombs) {
             if ($bombnum %2 == 1) {              if ($bombnum %2 == 1) {
                  $rowColor = $rowColor1;   $rowColor = $rowColor1;
             } else {              } else {
                 $rowColor = $rowColor2;                  $rowColor = $rowColor2;
             }              }
Line 561  sub getitems { Line 564  sub getitems {
         if ($resource->is_problem()) {          if ($resource->is_problem()) {
             my $ctr = 0;              my $ctr = 0;
             my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);              my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
             my ($partlist,$handgrade,$responseType) =       my $partlist=$resource->parts();
  &Apache::grades::response_type($url,$symb);  
     my $handgradeable;      my $handgradeable;
     foreach my $value (values(%{$handgrade})) {      foreach my $part (@$partlist) {
  if ($value eq 'yes') { $handgradeable=1; last; }   if ($resource->handgrade($part) eq 'yes') {
       $handgradeable=1; last;
    }
       }
       if ($handgradeable) {
    foreach my $student (keys(%$classlist)) {
       my ($uname,$udom) = split(/:/,$student);
       my %status=&Apache::grades::student_gradeStatus($url,$symb,$udom,$uname,$partlist);
       my $submitted = 0;
       my $ungraded = 0;
       foreach (keys(%status)) {
    $submitted = 1 if ($status{$_} ne 'nothing');
    $ungraded = 1 if ($status{$_} =~ /^ungraded/);
    my ($foo,$partid,$foo1) = split(/\./,$_);
    if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
       $submitted = 0;
    }
       }
       next if (!$submitted || !$ungraded);
       $ctr ++;
    }
    if ($ctr) {
       $$ungraded{$symb}{count} = $ctr;
       $$ungraded{$symb}{title} = $title;
       push(@{$tograde}, $symb);
    }
     }      }
     next if (!$handgradeable);  
    
             foreach my $student (keys(%$classlist)) {  
                 my ($uname,$udom) = split(/:/,$student);  
                 my %status=&Apache::grades::student_gradeStatus($url,$symb,$udom,$uname,$partlist);  
                 my $submitted = 0;  
                 my $ungraded = 0;  
                 foreach (keys(%status)) {  
                     $submitted = 1 if ($status{$_} ne 'nothing');  
                     $ungraded = 1 if ($status{$_} =~ /^ungraded/);  
                     my ($foo,$partid,$foo1) = split(/\./,$_);  
                     if ($status{'resource.'.$partid.'.submitted_by'} ne '') {  
                         $submitted = 0;  
                     }  
                 }  
                 next if (!$submitted || !$ungraded);  
                 $ctr ++;  
             }  
             if ($ctr) {  
                 $$ungraded{$symb}{count} = $ctr;  
                 $$ungraded{$symb}{title} = $title;  
                 push(@{$tograde}, $symb);  
             }  
         }          }
   
 # Check for bombs  # Check for bombs
         if ($resource->getErrors()) {          if ($resource->getErrors()) {
             my $errors = $resource->getErrors();              my $errors = $resource->getErrors();
             $errors =~ s/^,//;      $errors =~ s/^,//;
             my @bombs = split(/,/, $errors);              my @bombs = split(/,/, $errors);
             my $errorcount = scalar(@bombs);              my $errorcount = scalar(@bombs);
             my $errorlink = '<a href="/adm/email?display='.              my $errorlink = '<a href="/adm/email?display='.

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


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