--- loncom/homework/grades.pm 2003/06/12 19:56:13 1.94 +++ loncom/homework/grades.pm 2003/06/18 17:28:35 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.94 2003/06/12 19:56:13 bowersj2 Exp $ +# $Id: grades.pm,v 1.98 2003/06/18 17:28:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -466,8 +466,13 @@ LISTJAVASCRIPT 'onClick="javascript:checkSelect(this.form.stuinfo);" '. 'value="'.$viewgrade.'" />'."\n"; if ($ctr == 0) { - $gradeTable='
 '. - 'No submission found for this resource.
'; + my $num_students=(scalar(keys(%$fullname))); + if ($num_students eq 0) { + $gradeTable='
 There are no students currently enrolled.'; + } else { + $gradeTable='
 '. + 'No submissions found for this resource for any students. ('.$num_students.' checked for submissions
'; + } } elsif ($ctr == 1) { $gradeTable =~ s/type=checkbox/type=checkbox checked/; } @@ -1924,6 +1929,10 @@ sub viewgrades { $result.=''."\n"; $result.=''."\n"; + if (scalar(%$fullname) eq 0) { + my $colspan=3+scalar(@parts); + $result='There are no students in section "'.$ENV{'form.section'}.'" with enrollment status "'.$ENV{'form.status'}.'" to modify or grade.'; + } $result.=&show_grading_menu_form($symb,$url); return $result; } @@ -2386,7 +2395,7 @@ sub csvuploadassign { } $request->print('

Assigning Grades

'); my $courseid=$ENV{'request.course.id'}; - my ($classlist) = &getclasslist('all','1'); + my ($classlist) = &getclasslist('all',0); my @skipped; my $countdone=0; foreach my $grade (@gradedata) { @@ -2418,7 +2427,6 @@ sub csvuploadassign { $request->print('
Skipped Students
'); foreach my $student (@skipped) { $request->print("
$student"); } } - $request->print(&view_edit_entire_class_form($symb,$url)); $request->print(&show_grading_menu_form($symb,$url)); return ''; } @@ -2590,14 +2598,13 @@ sub getSymbMap { $mapiterator->next(); # skip the first BEGIN_MAP my $mapcurRes = $mapiterator->next(); # for "current resource" my $ctr=0; - while ($mapdepth > 0 && $ctr < 100) { + while ($mapdepth > 0) { if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; } if($mapcurRes == $mapiterator->END_MAP) { $mapdepth++; } if (ref($mapcurRes) && $mapcurRes->is_problem() && !$mapcurRes->randomout) { $countProblems++; } - $ctr++; $mapcurRes = $mapiterator->next(); } if ($countProblems > 0) { @@ -2752,6 +2759,8 @@ sub displayPage { $ctr++; } + $navmap->untieHashes(); + $studentTable.=''."\n". '  '. @@ -2861,6 +2870,8 @@ sub updateGradeByPage { $ctr++; } + $navmap->untieHashes(); + $studentTable.=''; $studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'}); my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :