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

www www@source.lon-capa.org
Tue, 05 Apr 2011 02:29:22 -0000


www		Tue Apr  5 02:29:22 2011 EDT

  Modified files:              
    /loncom/homework	functionplotresponse.pm 
  Log:
  Indices greater than 9 need brackets.
  
  
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.60 loncom/homework/functionplotresponse.pm:1.61
--- loncom/homework/functionplotresponse.pm:1.60	Mon Apr  4 21:27:30 2011
+++ loncom/homework/functionplotresponse.pm	Tue Apr  5 02:29:22 2011
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: functionplotresponse.pm,v 1.60 2011/04/04 21:27:30 www Exp $
+# $Id: functionplotresponse.pm,v 1.61 2011/04/05 02:29:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -388,10 +388,10 @@
    $output=~s/\,$//;
    $output.=']");'."\n";
    for (my $i=2; $i<2*$order; $i+=2) {
-       $output.='document.ggbApplet_'.$id.'.setColor("'.$label.'_'.$i.'",0,170,0);'."\n";
+       $output.='document.ggbApplet_'.$id.'.setColor("'.$label.'_'.($i>=10?'{':'').$i.($i>=10?'}':'').'",0,170,0);'."\n";
    }
    for (my $i=1; $i<2*$order; $i+=2) {
-       $output.='document.ggbApplet_'.$id.'.setVisible("'.$label.'_'.$i.'",false);'."\n";
+       $output.='document.ggbApplet_'.$id.'.setVisible("'.$label.'_'.($i>=10?'{':'').$i.($i>=10?'}':'').'",false);'."\n";
    }
 
    return $output;