version 1.49.6.8.2.6, 2025/01/16 21:11:56
|
version 1.49.6.9, 2024/07/03 18:51:56
|
Line 85 sub real_handler {
|
Line 85 sub real_handler {
|
|
|
unless ($cangrade) { |
unless ($cangrade) { |
# Check for critical messages and redirect if present. |
# Check for critical messages and redirect if present. |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'grades'); |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
Line 101 sub real_handler {
|
Line 101 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,$cnum,$cdom); |
my $cid = $env{'request.course.id'}; |
if ($reinitresult) { |
my $cnum = $env{'course.'.$cid.'.num'}; |
$cid = $env{'request.course.id'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
$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 140 ENDCLOSE
|
Line 136 ENDCLOSE
|
$r->print($closure); |
$r->print($closure); |
} |
} |
} |
} |
if (($reinitresult eq 'supp') || ($reinitresult eq 'both')) { |
|
my $possdel; |
|
if ($reinitresult eq 'supp') { |
|
$possdel = 1; |
|
} |
|
my ($supplemental,$refs_updated) = &Apache::loncommon::get_supplemental($cnum,$cdom,'',$possdel); |
|
unless ($refs_updated) { |
|
&Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental); |
|
} |
|
} |
|
} |
} |
|
|
unless (($reinitresult eq 'main') || ($reinitresult eq 'both')) { |
unless ($reinitresult eq 'update') { |
# 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 203 ENDCLOSE
|
Line 189 ENDCLOSE
|
my $notshowTotals= |
my $notshowTotals= |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
|
|
my $usec; |
|
if ($cangrade) { |
|
if (($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) { |
|
$usec = $env{'request.course.sec'}; |
|
} else { |
|
$usec = &Apache::lonnet::getsection($udom,$uname,$env{'request.course.id'}); |
|
} |
|
} else { |
|
$usec = $env{'request.course.sec'}; |
|
} |
|
|
|
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts, |
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts, |
$topLevelRight,$topLevelAttempted) = &getData($showPoints,$uname,$udom,$usec); |
$topLevelRight,$topLevelAttempted) = &getData($showPoints,$uname,$udom); |
|
|
if (ref($navmap)) { |
if (ref($navmap)) { |
my $nostdtotals; |
my $nostdtotals; |
Line 225 ENDCLOSE
|
Line 200 ENDCLOSE
|
if ($hidetotals eq 'all') { |
if ($hidetotals eq 'all') { |
$nostdtotals = 1; |
$nostdtotals = 1; |
} elsif ($hidetotals ne '') { |
} elsif ($hidetotals ne '') { |
|
my $usec; |
|
if ($cangrade) { |
|
if (($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) { |
|
$usec = $env{'request.course.sec'}; |
|
} else { |
|
$usec = &Apache::lonnet::getsection($udom,$uname,$env{'request.course.id'}); |
|
} |
|
} else { |
|
$usec = $env{'request.course.sec'}; |
|
} |
if ($usec ne '') { |
if ($usec ne '') { |
my %secnototals; |
my %secnototals; |
map { $secnototals{$_} = 1; } split(/,/,$hidetotals); |
map { $secnototals{$_} = 1; } split(/,/,$hidetotals); |
Line 278 sub grades_blocked {
|
Line 263 sub grades_blocked {
|
|
|
sub getData { |
sub getData { |
|
|
my ($showPoints,$uname,$udom,$usec)=@_; |
my ($showPoints,$uname,$udom)=@_; |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom,$usec); |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); |
|
|
if (!defined($navmap)) { |
if (!defined($navmap)) { |
return (); |
return (); |
Line 316 sub getData {
|
Line 301 sub getData {
|
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout) |
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) |
{ |
{ |
# Get number of correct, incorrect parts |
# Get number of correct, incorrect parts |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |