Log Message:
-----------
Fixed minor bug that complains if the problem-maxattempts field is not numeric.
Tags:
----
rel-2-4-patches
Modified Files:
--------------
webwork2/lib/WeBWorK/ContentGenerator:
ProblemSet.pm
Revision Data
-------------
Index: ProblemSet.pm
===================================================================
RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v
retrieving revision 1.88.2.1.2.1
retrieving revision 1.88.2.1.2.2
diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.88.2.1.2.1 -r1.88.2.1.2.2
--- lib/WeBWorK/ContentGenerator/ProblemSet.pm
+++ lib/WeBWorK/ContentGenerator/ProblemSet.pm
@@ -385,7 +385,7 @@
my $interactive = CGI::a({-href=>$interactiveURL}, "Problem $problemID");
my $attempts = $problem->num_correct + $problem->num_incorrect;
- my $remaining = $problem->max_attempts < 0
+ my $remaining = (($problem->max_attempts||-1) < 0) #a blank yields 'infinite' because it evaluates as false with out giving warnings about comparing non-numbers
? "unlimited"
: $problem->max_attempts - $attempts;
my $rawStatus = $problem->status || 0;
|