Diff for /loncom/interface/lonquickgrades.pm between versions 1.120 and 1.124

version 1.120, 2021/02/18 14:48:02 version 1.124, 2022/10/19 18:09:04
Line 86  sub real_handler { Line 86  sub real_handler {
     if ($env{'request.course.id'}) {      if ($env{'request.course.id'}) {
         my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};          my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};          my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
           my $clientip = &Apache::lonnet::get_requestor_ip($r);
         my ($blocked,$blocktext) =          my ($blocked,$blocktext) =
             &Apache::loncommon::blocking_status('grades',$cnum,$cdom);              &Apache::loncommon::blocking_status('grades',$clientip,$cnum,$cdom);
         if ($blocked) {          if ($blocked) {
             my $checkrole = "cm./$cdom/$cnum";              my $checkrole = "cm./$cdom/$cnum";
             if ($env{'request.course.sec'} ne '') {              if ($env{'request.course.sec'} ne '') {
Line 119  sub real_handler { Line 120  sub real_handler {
             $r->send_http_header;              $r->send_http_header;
             $r->print(&Apache::loncommon::check_release_result(@reinit));              $r->print(&Apache::loncommon::check_release_result(@reinit));
             return OK;              return OK;
         } elsif ($reinitresult eq 'update') {          }
             my $cid = $env{'request.course.id'};          my ($cid,$cnum,$cdom);
             my $cnum = $env{'course.'.$cid.'.num'};          if ($reinitresult) {
             my $cdom = $env{'course.'.$cid.'.domain'};              $cid = $env{'request.course.id'};
               $cnum = $env{'course.'.$cid.'.num'};
               $cdom = $env{'course.'.$cid.'.domain'};
           }
           if (($reinitresult eq 'main') || ($reinitresult eq 'both')) {
             &Apache::loncommon::content_type($r,'text/html');              &Apache::loncommon::content_type($r,'text/html');
             $r->send_http_header;              $r->send_http_header;
             &startpage($r,$showPoints);              &startpage($r,$showPoints);
Line 160  ENDCLOSE Line 165  ENDCLOSE
             $r->header_out(Location => $furl);              $r->header_out(Location => $furl);
             return REDIRECT;              return REDIRECT;
         }          }
           if (($reinitresult eq 'supp') || ($reinitresult eq 'both')) {
               my $possdel;
               if ($reinitresult eq 'supp') {
                   $possdel = 1;
               }
               my ($supplemental,$refs_updated) = &Apache::lonnet::get_supplemental($cnum,$cdom,'',$possdel);
               unless ($refs_updated) {
                   &Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental);
               }
           }
     }      }
   
     unless ($reinitresult eq 'update') {      unless (($reinitresult eq 'main') || ($reinitresult eq 'both')) {
         # Send header, don't cache this page          # Send header, don't cache this page
         &Apache::loncommon::no_cache($r);          &Apache::loncommon::no_cache($r);
         $r->send_http_header;          $r->send_http_header;
Line 484  sub getData { Line 499  sub getData {
   
     my $res = $navmap->firstResource(); # temp resource to access constants      my $res = $navmap->firstResource(); # temp resource to access constants
   
     my $iterator = $navmap->getIterator(undef, undef, undef, 1);      my $deeplinkcond = 1;
       my $iterator = $navmap->getIterator(undef, undef, undef, 1, undef, undef, $deeplinkcond);
     my $depth = 1;      my $depth = 1;
     $iterator->next(); # ignore first BEGIN_MAP      $iterator->next(); # ignore first BEGIN_MAP
     my $curRes = $iterator->next();      my $curRes = $iterator->next();
Line 510  sub getData { Line 526  sub getData {
     while ( $depth > 0 ) {      while ( $depth > 0 ) {
         if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}          if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}
         if ($curRes == $iterator->END_MAP()) { $depth--; }          if ($curRes == $iterator->END_MAP()) { $depth--; }
           my ($deeplink,$nodeeplinkcheck,$symb);
         if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout &&           $nodeeplinkcheck = 1;
             ($curRes->deeplink ne 'absent'))          if (ref($curRes)) {
               $symb = $curRes->symb();
               $deeplink = $curRes->deeplink('quickgrades');
               if ($deeplink eq 'absent') {
                   $nodeeplinkcheck = 0;
               }
           }
           if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout &&
               ($nodeeplinkcheck))
         {          {
             # Get number of correct, incorrect parts              # Get number of correct, incorrect parts
             my $parts = $curRes->parts();              my $parts = $curRes->parts();
Line 634  sub outputTable { Line 658  sub outputTable {
 # Output of folder scores  # Output of folder scores
 #  #
   
     my $iterator = $navmap->getIterator(undef, undef, undef, 1);      my $deeplinkcond = 1;
       my $iterator = $navmap->getIterator(undef, undef, undef, 1, undef, undef, $deeplinkcond);
     my $depth = 1;      my $depth = 1;
     $iterator->next(); # ignore first BEGIN_MAP      $iterator->next(); # ignore first BEGIN_MAP
     my $curRes = $iterator->next();      my $curRes = $iterator->next();
Line 765  sub dumpdata { Line 790  sub dumpdata {
   
 # Run through the map and get all data  # Run through the map and get all data
   
     my $iterator = $navmap->getIterator(undef, undef, undef, 1);      my $deeplinkcond = 1;
       my $iterator = $navmap->getIterator(undef, undef, undef, 1, undef, undef, $deeplinkcond);
     my $depth = 1;      my $depth = 1;
     $iterator->next(); # ignore first BEGIN_MAP      $iterator->next(); # ignore first BEGIN_MAP
     my $curRes = $iterator->next();      my $curRes = $iterator->next();

Removed from v.1.120  
changed lines
  Added in v.1.124


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