--- loncom/interface/lonquickgrades.pm 2024/01/05 19:50:32 1.49.6.8.2.5 +++ loncom/interface/lonquickgrades.pm 2025/01/16 21:11:56 1.49.6.8.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.49.6.8.2.5 2024/01/05 19:50:32 raeburn Exp $ +# $Id: lonquickgrades.pm,v 1.49.6.8.2.6 2025/01/16 21:11:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -203,8 +203,19 @@ ENDCLOSE my $notshowTotals= $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, - $topLevelRight,$topLevelAttempted) = &getData($showPoints,$uname,$udom); + $topLevelRight,$topLevelAttempted) = &getData($showPoints,$uname,$udom,$usec); if (ref($navmap)) { my $nostdtotals; @@ -214,16 +225,6 @@ ENDCLOSE if ($hidetotals eq 'all') { $nostdtotals = 1; } 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 '') { my %secnototals; map { $secnototals{$_} = 1; } split(/,/,$hidetotals); @@ -277,10 +278,10 @@ sub grades_blocked { sub getData { - my ($showPoints,$uname,$udom)=@_; + my ($showPoints,$uname,$udom,$usec)=@_; # Create the nav map - my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); + my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom,$usec); if (!defined($navmap)) { return ();