Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed a bug that was reported by James Balfour:

Numerical/Calculated questions failed to grade negative responses on questions with units.
  • Loading branch information...
commit efa9b7fa01ef37de6d0fb226c7797e87c0c86ecd 1 parent 6babaf0
authored January 17, 2005
2  mod/quiz/questiontypes/numerical/questiontype.php
@@ -163,7 +163,7 @@ function grade_response($question, $nameprefix, $addedanswercondition='') {
163 163
                     unset($responsenum); // Answer is not numeric
164 164
                 }
165 165
             } else if (ereg(
166  
-                    '^(([0-9]+(\\.[0-9]*)?|[.][0-9]+)([eE][-+]?[0-9]+)?)([^0-9].*)?$',
  166
+                    '^([+-]?([0-9]+(\\.[0-9]*)?|[.][0-9]+)([eE][-+]?[0-9]+)?)([^0-9].*)?$',
167 167
                     $responsenum, $responseparts)) {
168 168
                 $responsenum = (float)$responseparts[1];
169 169
                 if ($responseparts[5]) {

0 notes on commit efa9b7f

Please sign in to comment.
Something went wrong with that request. Please try again.