version 1.127, 2024/01/05 19:10:30
|
version 1.128, 2024/12/10 04:52:30
|
Line 261 ENDCLOSE
|
Line 261 ENDCLOSE
|
my $showCategories= |
my $showCategories= |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
|
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); |
$topLevelRight,$topLevelAttempted) = &getData($showPoints,$uname,$udom,$usec); |
|
|
if (ref($navmap)) { |
if (ref($navmap)) { |
if ($showCategories) { |
if ($showCategories) { |
Line 277 ENDCLOSE
|
Line 288 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 336 sub grades_blocked {
|
Line 337 sub grades_blocked {
|
} |
} |
|
|
sub getStudentCatGrade { |
sub getStudentCatGrade { |
my ($uname,$udom,%categories)=@_; |
my ($uname,$udom,$usec,%categories)=@_; |
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
&getData(1,$uname,$udom); |
&getData(1,$uname,$udom,$usec); |
return &output_category_table(undef,0,$navmap,0,%categories); |
return &output_category_table(undef,0,$navmap,0,%categories); |
} |
} |
|
|
Line 354 sub getAllStudentData {
|
Line 355 sub getAllStudentData {
|
my $usernameidx = &Apache::loncoursedata::CL_SNAME(); |
my $usernameidx = &Apache::loncoursedata::CL_SNAME(); |
my $domainidx = &Apache::loncoursedata::CL_SDOM(); |
my $domainidx = &Apache::loncoursedata::CL_SDOM(); |
my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME(); |
my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME(); |
|
my $sectionidx = &Apache::loncoursedata::CL_SECTION(); |
|
|
foreach my $key (keys(%{$classlist})) { |
foreach my $key (keys(%{$classlist})) { |
my $student = $classlist->{$key}; |
my $student = $classlist->{$key}; |
my $perc=&getStudentCatGrade($classlist->{$student}->[$usernameidx], |
my $perc=&getStudentCatGrade($classlist->{$student}->[$usernameidx], |
$classlist->{$student}->[$domainidx], |
$classlist->{$student}->[$domainidx], |
|
$classlist->{$student}->[$sectionidx], |
%categories); |
%categories); |
} |
} |
} |
} |
Line 531 sub excel_finish {
|
Line 534 sub excel_finish {
|
|
|
sub getData { |
sub getData { |
|
|
my ($showPoints,$uname,$udom)=@_; |
my ($showPoints,$uname,$udom,$usec)=@_; |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom,$usec); |
|
|
if (!defined($navmap)) { |
if (!defined($navmap)) { |
return (); |
return (); |