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

www www@source.lon-capa.org
Sat, 09 Oct 2010 20:02:02 -0000


www		Sat Oct  9 20:02:02 2010 EDT

  Modified files:              
    /loncom/homework	functionplotresponse.pm 
  Log:
  Coordinates can be zero ...
  
  
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.10 loncom/homework/functionplotresponse.pm:1.11
--- loncom/homework/functionplotresponse.pm:1.10	Sat Oct  9 17:43:25 2010
+++ loncom/homework/functionplotresponse.pm	Sat Oct  9 20:02:02 2010
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: functionplotresponse.pm,v 1.10 2010/10/09 17:43:25 www Exp $
+# $Id: functionplotresponse.pm,v 1.11 2010/10/09 20:02:02 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -178,10 +178,10 @@
 #
 sub new_coordinate {
     my ($id,$variable,$x,$y)=@_;
-    if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'x')}) {
+    if (defined($Apache::functionplotresponse::previous{&field_name($id,$variable,'x')})) {
        $x=$Apache::functionplotresponse::previous{&field_name($id,$variable,'x')};
     }
-    if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'y')}) {
+    if (defined($Apache::functionplotresponse::previous{&field_name($id,$variable,'y')})) {
        $y=$Apache::functionplotresponse::previous{&field_name($id,$variable,'y')};
     }
     &generate_input_field($id,$variable,$x,$y);