[LON-CAPA-cvs] cvs: loncom /homework response.pm /interface lonparmset.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 21 Nov 2003 19:54:42 -0000
albertel Fri Nov 21 14:54:42 2003 EDT
Modified files:
/loncom/interface lonparmset.pm
/loncom/homework response.pm
Log:
- BUG#2388, <responseparam> witha default of "0" was ignored
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.138 loncom/interface/lonparmset.pm:1.139
--- loncom/interface/lonparmset.pm:1.138 Fri Nov 21 13:18:04 2003
+++ loncom/interface/lonparmset.pm Fri Nov 21 14:54:42 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.138 2003/11/21 18:18:04 albertel Exp $
+# $Id: lonparmset.pm,v 1.139 2003/11/21 19:54:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -131,12 +131,12 @@
# -------------------------------------------------------- first, check default
- if ($def) { $outpar[11]=$def; $result=11; }
+ if (defined($def)) { $outpar[11]=$def; $result=11; }
# ----------------------------------------------------- second, check map parms
my $thisparm=$parmhash{$symbparm};
- if ($thisparm) { $outpar[10]=$thisparm; $result=10; }
+ if (defined($thisparm)) { $outpar[10]=$thisparm; $result=10; }
# --------------------------------------------------------- third, check course
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.88 loncom/homework/response.pm:1.89
--- loncom/homework/response.pm:1.88 Mon Nov 3 16:47:21 2003
+++ loncom/homework/response.pm Fri Nov 21 14:54:42 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.88 2003/11/03 21:47:21 albertel Exp $
+# $Id: response.pm,v 1.89 2003/11/21 19:54:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -111,8 +111,8 @@
}
$result.= ' name="'.$name.'"'.
' type="'.$type.'"'.
-($default?' default="'.$default.'"':'').
-($display?' display="'.$display.' [Part: '.$partref.']"':'')
+(defined($default)?' default="'.$default.'"':'').
+(defined($display)?' display="'.$display.' [Part: '.$partref.']"':'')
.'></parameter>'
."\n";
return $result;
@@ -555,7 +555,6 @@
for (my $i=0;$i<=$#bottomlist;$i++) {
if ($bottomlist[$i]) { push(@whichopt,$bottomlist[$i]) }
}
-
return @whichopt;
}