Bug preventing numeric values from being saved...

Bug preventing numeric values from being saved...

by Greg Oster -
Number of replies: 1

Hi

In moodle/mod/questionnaire/questiontypes/questiontypes.class.php there is a bug that results in numeric responses not being saved in the database.  The bug is on line 238:

            $val = preg_replace("[/^0-9.\-]*(-?[0-9]*\.?[0-9]*).*/", '\1', $val);

which should be:

            $val = preg_replace("/[^0-9.\-]*(-?[0-9]*\.?[0-9]*).*/", '\1', $val);

That is, the first two characters of the regex have been transposed.  I don't think this has been fixed yet, but, if it has, apologies for the noise.


Thanks.


Later...


Greg Oster

Average of ratings: Useful (1)