[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 06 Sep 2002 20:59:28 -0000


albertel		Fri Sep  6 16:59:28 2002 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - BUG #724, listStudent never got the symb if it didn't already exist
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.47 loncom/homework/grades.pm:1.48
--- loncom/homework/grades.pm:1.47	Mon Aug 26 08:47:28 2002
+++ loncom/homework/grades.pm	Fri Sep  6 16:59:28 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.47 2002/08/26 12:47:28 www Exp $
+# $Id: grades.pm,v 1.48 2002/09/06 20:59:28 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -324,6 +324,7 @@
 </script>
 LISTJAVASCRIPT
 
+    my ($symb,$url) = &get_symb_and_url();
     my $cdom      = $ENV{"course.$ENV{'request.course.id'}.domain"};
     my $cnum      = $ENV{"course.$ENV{'request.course.id'}.num"};
     my $getsec    = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'};
@@ -333,8 +334,8 @@
 	'View/Grade Submissions for a Student or a Group of Students</font></h3>';
     $result.='<table border="0">';
     $result.='<tr><td colspan=3><font size=+1>'.
-	'<b>Resource: </b>'.$ENV{'form.url'}.'</font></td></tr>';
-    my ($partlist,$handgrade) = &response_type($ENV{'form.url'});
+	'<b>Resource: </b>'.$url.'</font></td></tr>';
+    my ($partlist,$handgrade) = &response_type($url);
     for (sort keys(%$handgrade)) {
 	my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
 	$ENV{'form.handgrade'} = 'yes' if ($handgrade eq 'yes');
@@ -361,8 +362,8 @@
 	'<input type="hidden" name="response"    value="'.$ENV{'form.response'}.'" />'."\n".
 	'<input type="hidden" name="handgrade"   value="'.$ENV{'form.handgrade'}.'" /><br />'."\n".
 	'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" /><br />'."\n".
-	'<input type="hidden" name="url"  value="'.$ENV{'form.url'}.'" />'."\n".
-	'<input type="hidden" name="symb" value="'.$ENV{'form.symb'}.'" />'."\n".
+	'<input type="hidden" name="url"  value="'.$url.'" />'."\n".
+	'<input type="hidden" name="symb" value="'.$symb.'" />'."\n".
 	'To view/grade a submission, click on the check box next to the student\'s name. Then '."\n".
 	'click on the View/Grade button. To view the submissions for a group of students, click'."\n".
 	' on the check boxes for the group of students.<br />'."\n".
@@ -385,8 +386,7 @@
     my $ctr = 0;
     foreach my $student (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) {
 	my ($uname,$udom) = split(/:/,$student);
-	my (%status) = &student_gradeStatus($ENV{'form.url'},
-					    $ENV{'form.symb'},$udom,$uname,$partlist);
+	my (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
 	my $statusflg = '';
 	foreach (keys(%status)) {
 	    $statusflg = 1 if ($status{$_} ne 'nothing');
@@ -423,7 +423,7 @@
     if ($ctr == 0) {
 	$gradeTable='<br />&nbsp;<font color="red">'.
 	    'No submission found for this resource.</font><br />';
-	$gradeTable.=&show_grading_menu_form ($ENV{'form.symb'},$ENV{'form.url'});
+	$gradeTable.=&show_grading_menu_form($symb,$url);
     } elsif ($ctr == 1) {
 	$gradeTable =~ s/type=checkbox/type=checkbox checked/;
     }