--- loncom/interface/lonquickgrades.pm 2021/02/18 14:48:02 1.120 +++ loncom/interface/lonquickgrades.pm 2022/10/19 00:03:10 1.123 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.120 2021/02/18 14:48:02 raeburn Exp $ +# $Id: lonquickgrades.pm,v 1.123 2022/10/19 00:03:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -86,8 +86,9 @@ sub real_handler { if ($env{'request.course.id'}) { my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $clientip = &Apache::lonnet::get_requestor_ip($r); my ($blocked,$blocktext) = - &Apache::loncommon::blocking_status('grades',$cnum,$cdom); + &Apache::loncommon::blocking_status('grades',$clientip,$cnum,$cdom); if ($blocked) { my $checkrole = "cm./$cdom/$cnum"; if ($env{'request.course.sec'} ne '') { @@ -119,10 +120,14 @@ sub real_handler { $r->send_http_header; $r->print(&Apache::loncommon::check_release_result(@reinit)); return OK; - } elsif ($reinitresult eq 'update') { - my $cid = $env{'request.course.id'}; - my $cnum = $env{'course.'.$cid.'.num'}; - my $cdom = $env{'course.'.$cid.'.domain'}; + } + my ($cid,$cnum,$cdom); + if ($reinitresult) { + $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'); $r->send_http_header; &startpage($r,$showPoints); @@ -160,9 +165,15 @@ ENDCLOSE $r->header_out(Location => $furl); return REDIRECT; } + if (($reinitresult eq 'supp') || ($reinitresult eq 'both')) { + my ($supplemental,$refs_updated) = &Apache::lonnet::get_supplemental($cnum,$cdom); + 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 &Apache::loncommon::no_cache($r); $r->send_http_header; @@ -484,7 +495,8 @@ sub getData { 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; $iterator->next(); # ignore first BEGIN_MAP my $curRes = $iterator->next(); @@ -510,9 +522,17 @@ sub getData { while ( $depth > 0 ) { if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} if ($curRes == $iterator->END_MAP()) { $depth--; } - - if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout && - ($curRes->deeplink ne 'absent')) + my ($deeplink,$nodeeplinkcheck,$symb); + $nodeeplinkcheck = 1; + 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 my $parts = $curRes->parts(); @@ -634,7 +654,8 @@ sub outputTable { # 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; $iterator->next(); # ignore first BEGIN_MAP my $curRes = $iterator->next(); @@ -765,7 +786,8 @@ sub dumpdata { # 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; $iterator->next(); # ignore first BEGIN_MAP my $curRes = $iterator->next();