From: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:36
|
Log Message: ----------- HEAD backport: Modifications to make sure that problems with weight 0 print weight as 0 rather than as a blank. This addresses bug #730 (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.13 -r1.13.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -268,9 +268,10 @@ my $choose = ($properties{type} eq "choose") && ($properties{override} ne "none"); my $globalValue = $globalRecord->{$field}; - $globalValue = $globalValue ? ($labels{$globalValue || ""} || $globalValue) : ""; + # use defined instead of value in order to allow 0 to printed, e.g. for the 'value' field + $globalValue = (defined($globalValue)) ? ($labels{$globalValue || ""} || $globalValue) : ""; my $userValue = $userRecord->{$field}; - $userValue = $userValue ? ($labels{$userValue || ""} || $userValue) : ""; + $userValue = (defined($userValue)) ? ($labels{$userValue || ""} || $userValue) : ""; if ($field =~ /_date/) { $globalValue = $self->formatDateTime($globalValue) if $globalValue; |