--- loncom/homework/grades.pm 2021/01/05 21:53:44 1.781 +++ loncom/homework/grades.pm 2021/01/25 14:21:17 1.784 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.781 2021/01/05 21:53:44 raeburn Exp $ +# $Id: grades.pm,v 1.784 2021/01/25 14:21:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1173,6 +1173,8 @@ LISTJAVASCRIPT my @sections; if ($env{'request.course.sec'} ne '') { @sections = ($env{'request.course.sec'}); + } elsif ($env{'form.section'} eq '') { + @sections = ('all'); } else { @sections = &Apache::loncommon::get_env_multiple('form.section'); } @@ -1214,7 +1216,7 @@ LISTJAVASCRIPT ''."\n". ''."\n"; if (exists($env{'form.Status'})) { - $gradeTable .= ''."\n"; + $gradeTable .= ''."\n"; } else { $gradeTable .= &Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title(&mt('Student Status')) @@ -10632,6 +10634,14 @@ sub selectfield { (&substatus_options, 'select_form_order' => ['yes','queued','graded','incorrect','all']); } + + # + # PrepareClasslist() needs to be called to avoid getting a sections list + # for a different course from the @Sections global in lonstatistics.pm, + # populated by an earlier request. + # + &Apache::lonstatistics::PrepareClasslist(); + my $result='