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

www www@source.lon-capa.org
Fri, 29 Oct 2010 19:18:49 -0000


www		Fri Oct 29 19:18:49 2010 EDT

  Modified files:              
    /loncom/homework	functionplotresponse.pm 
  Log:
  Remember which splines go with which response
  
  
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.16 loncom/homework/functionplotresponse.pm:1.17
--- loncom/homework/functionplotresponse.pm:1.16	Thu Oct 28 00:27:56 2010
+++ loncom/homework/functionplotresponse.pm	Fri Oct 29 19:18:48 2010
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: functionplotresponse.pm,v 1.16 2010/10/28 00:27:56 www Exp $
+# $Id: functionplotresponse.pm,v 1.17 2010/10/29 19:18:48 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,7 +107,7 @@
           $script.="if (param=='applet_$id') { loaded_$id=true; }\n";
       }
       $script.="if (".join(' && ',map { "loaded_$_" } (@Apache::functionplotresponse::callscripts)).
-               ") { setTimeout('ggbInitAll()',20) }\n";
+               ") { setTimeout('ggbInitAll()',20) }";
       my $calls=join("\n",map { "ggbInit_$_();" } (@Apache::functionplotresponse::callscripts)); 
       return (<<ENDGGBINIT);
 <script type="text/javascript">
@@ -119,7 +119,7 @@
 $script
 }
 function ggbInitAll() {
-$calls;
+$calls
 }
 // ]]>
 </script>
@@ -625,6 +625,13 @@
      }
 # close the init script
      $result.=&end_init_script();
+# register all splines in this response 
+     $result.='<input type="hidden" name="HWVAL_AllSplines_'.$internalid.'" value="'.
+                 join(',',keys(%Apache::functionplotresponse::splineorder)).'" />'."\n";
+     foreach my $label (keys(%Apache::functionplotresponse::splineorder)) {
+        $result.='<input type="hidden" name="HWVAL_SplineOrder_'.$internalid.'_'.$label.'" value="'.
+                 $Apache::functionplotresponse::splineorder{$label}.'" />'."\n";
+     }
 # generate the input fields
      $result.=$Apache::functionplotresponse::inputfields;
 # actually start the <applet>-tag