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

raeburn raeburn@source.lon-capa.org
Sat, 14 Feb 2009 19:45:26 -0000


raeburn		Sat Feb 14 19:45:26 2009 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Use \Q$part\E in the substitution instead of \w+ because the partID might contain chancters which do not match \w+.  
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.550 loncom/homework/grades.pm:1.551
--- loncom/homework/grades.pm:1.550	Sat Feb 14 17:03:40 2009
+++ loncom/homework/grades.pm	Sat Feb 14 19:45:26 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.550 2009/02/14 17:03:40 raeburn Exp $
+# $Id: grades.pm,v 1.551 2009/02/14 19:45:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3426,7 +3426,7 @@
 	    if ($part !~ m/^\Q$partid\E/) { next;}
 	    if ($type eq 'awarded' || $type eq 'solved') { next; }
 	    my $display=&Apache::lonnet::metadata($url,$stores.'.display');
-	    $display =~ s/\[Part: (\w)+\]//;
+	    $display =~ s/\[Part: \Q$part\E\]//;
             my $narrowtext = &mt('Tries');
 	    $display =~ s/Number of Attempts/$narrowtext/;
 	    $header .= '<th align="center">'.&mt('Old').' '.$display.'</th>'.