Permalink
Browse files

Fixed a bug

Cleaned out a flaw that ruled out generation of negative random numbers
  • Loading branch information...
kaipe
kaipe committed Aug 8, 2004
1 parent e7b64b0 commit 908a708e7cf07cc0f9efec622b1268e1d76018ae
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/quiz/questiontypes/calculated/questiontype.php
@@ -36,7 +36,7 @@ function supports_dataset_item_generation() {
}
function custom_generator_tools($datasetdef) {
- if (ereg('^(uniform|loguniform):([^-]*):([^-]*):([0-9]*)$',
+ if (ereg('^(uniform|loguniform):([^:]*):([^:]*):([0-9]*)$',
$datasetdef->options, $regs)) {
for ($i = 0 ; $i<10 ; ++$i) {
$lengthoptions[$i] = get_string(($regs[1] == 'uniform'
@@ -101,7 +101,7 @@ function update_dataset_options($datasetdefs, $form) {
}
function generate_dataset_item($options) {
- if (!ereg('^(uniform|loguniform):([^-]*):([^-]*):([0-9]*)$',
+ if (!ereg('^(uniform|loguniform):([^:]*):([^:]*):([0-9]*)$',
$options, $regs)) {
// Unknown options...
return false;

0 comments on commit 908a708

Please sign in to comment.