--- loncom/homework/grades.pm	2003/06/13 15:43:28	1.96
+++ loncom/homework/grades.pm	2003/06/18 17:37:46	1.100
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.96 2003/06/13 15:43:28 albertel Exp $
+# $Id: grades.pm,v 1.100 2003/06/18 17:37:46 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2395,7 +2395,7 @@ sub csvuploadassign {
     }
     $request->print('<h3>Assigning Grades</h3>');
     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) {
@@ -2427,7 +2427,6 @@ sub csvuploadassign {
 	$request->print('<br /><font size="+1"><b>Skipped Students</b></font><br />');
 	foreach my $student (@skipped) { $request->print("<br />$student"); }
     }
-    $request->print(&view_edit_entire_class_form($symb,$url));
     $request->print(&show_grading_menu_form($symb,$url));
     return '';
 }
@@ -2601,7 +2600,7 @@ sub getSymbMap {
 	    my $ctr=0;
 	    while ($mapdepth > 0) {
 		if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; }
-		if($mapcurRes == $mapiterator->END_MAP) { $mapdepth++; }
+		if($mapcurRes == $mapiterator->END_MAP) { $mapdepth--; }
 
 		if (ref($mapcurRes) && $mapcurRes->is_problem() && !$mapcurRes->randomout) {
 		    $countProblems++;
@@ -2674,7 +2673,7 @@ sub displayPage {
     my $curRes = $iterator->next(); # for "current resource"
     while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
-        if($curRes == $iterator->END_MAP) { $depth++; }
+        if($curRes == $iterator->END_MAP) { $depth--; }
 
         if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
 	    my $parts = $curRes->parts();
@@ -2760,6 +2759,8 @@ sub displayPage {
 	$ctr++;
     }
 
+    $navmap->untieHashes();
+
     $studentTable.='</td></tr></table></td></tr></table>'."\n".
 	'&nbsp;&nbsp;<input type="button" value="Save" '.
 	'onClick="javascript:checkSubmitPage(this.form,'.$question.');" TARGET=_self />'.
@@ -2806,7 +2807,7 @@ sub updateGradeByPage {
     my ($depth,$ctr,$question,$changeflag)= (1,0,1,0);
     while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
-        if($curRes == $iterator->END_MAP) { $depth++; }
+        if($curRes == $iterator->END_MAP) { $depth--; }
 
         if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
 	    my $parts = $curRes->parts();
@@ -2869,6 +2870,8 @@ sub updateGradeByPage {
 	$ctr++;
     }
 
+    $navmap->untieHashes();
+
     $studentTable.='</td></tr></table></td></tr></table>';
     $studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'});
     my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :
@@ -3425,15 +3428,14 @@ sub handler {
 		if ($tsymb) {
 		    my ($map,$id,$url)=split(/\_\_\_/,$tsymb);
 		    if (&Apache::lonnet::allowed('mgr',$tcrsid)) {
-			$request->print(
-					&Apache::lonnet::ssi('/res/'.$url,
-							     ('grade_username' => $tuname,
-							      'grade_domain' => $tudom,
-							      'grade_courseid' => $tcrsid,
-							      'grade_symb' => $tsymb)));
+			$request->print(&Apache::lonnet::ssi_body('/res/'.$url,
+					  ('grade_username' => $tuname,
+					   'grade_domain' => $tudom,
+					   'grade_courseid' => $tcrsid,
+					   'grade_symb' => $tsymb)));
 		    } else {
 			$request->print('<h3>Not authorized: '.$token.'</h3>');
-		    }           
+		    }
 		} else {
 		    $request->print('<h3>Not a valid DocID: '.$token.'</h3>');
 		}