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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 30 May 2003 20:57:40 -0000


albertel		Fri May 30 16:57:40 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - fixes BUG#1535, excused should work now (didn't like : in label names)
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.89 loncom/homework/grades.pm:1.90
--- loncom/homework/grades.pm:1.89	Fri May 16 15:00:23 2003
+++ loncom/homework/grades.pm	Fri May 30 16:57:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.89 2003/05/16 19:00:23 albertel Exp $
+# $Id: grades.pm,v 1.90 2003/05/30 20:57:40 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1913,8 +1913,9 @@
     my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1');
     my $ctr = 0;
     foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
-	my ($uname,$udom) = split(/:/);
-	$result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$_.'" />'."\n";
+	my $uname = $_;
+	$uname=~s/:/_/;
+	$result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$uname.'" />'."\n";
 	$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},
 				   $_,$$fullname{$_},\@parts,\%weight);
 	$ctr++;
@@ -1931,6 +1932,7 @@
 sub viewstudentgrade {
     my ($url,$symb,$courseid,$student,$fullname,$parts,$weight) = @_;
     my ($uname,$udom) = split(/:/,$student);
+    $student=~s/:/_/;
     my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname);
     my $result='<tr bgcolor="#ffffdd"><td>'.
 	'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
@@ -2657,8 +2659,8 @@
         if($curRes == $iterator->END_MAP) { $depth++; }
 
         if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
-	    my $parts = $curRes->parts();
-	    $parts = &temp_parts_fix($parts); # remove line when lonnavmap is fixed
+	    my $parts = ['0',@{$curRes->parts()}];
+	    &APache::lonnet::logthis("parts ".join(':',@$parts));
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
 	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question.
@@ -2751,18 +2753,6 @@
     return '';
 }
 
-sub temp_parts_fix { #remove sub once lonnavmap is fixed
-    my $parts = shift;
-    my %seen = ();
-    my @correctParts = ();
-    foreach (@{$parts}) {
-	next if ($seen{$_} > 0);
-	$seen{$_}++;
-	push @correctParts,$_;
-    }
-    return \@correctParts;
-}
-
 sub updateGradeByPage {
     my ($request) = shift;
 
@@ -2802,8 +2792,8 @@
         if($curRes == $iterator->END_MAP) { $depth++; }
 
         if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
-	    my $parts = $curRes->parts();
-	    $parts = &temp_parts_fix($parts); # remove line when lonnavmap is fixed
+	    my $parts = ['0',@{$curRes->parts()}];
+	    &APache::lonnet::logthis("parts ".join(':',@$parts));
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
 	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question.