Index: numerical/questiontype.php =================================================================== RCS file: /cvsroot/moodle/moodle/question/type/numerical/questiontype.php,v retrieving revision 1.14.4.10 diff -u -r1.14.4.10 questiontype.php --- numerical/questiontype.php 18 Sep 2008 14:37:50 -0000 1.14.4.10 +++ numerical/questiontype.php 22 Nov 2008 18:26:06 -0000 @@ -257,17 +257,6 @@ return ($answer->min <= $response && $response <= $answer->max); } - // ULPGC ecastro - function check_response(&$question, &$state){ - $answers = &$question->options->answers; - foreach($answers as $aid => $answer) { - if($this->test_response($question, $state, $answer)) { - return $aid; - } - } - return false; - } - function get_correct_responses(&$question, &$state) { $correct = parent::get_correct_responses($question, $state); $unit = $this->get_default_numerical_unit($question); Index: shortanswer/questiontype.php =================================================================== RCS file: /cvsroot/moodle/moodle/question/type/shortanswer/questiontype.php,v retrieving revision 1.20.2.8 diff -u -r1.20.2.8 questiontype.php --- shortanswer/questiontype.php 28 Aug 2008 01:46:48 -0000 1.20.2.8 +++ shortanswer/questiontype.php 22 Nov 2008 18:27:42 -0000 @@ -179,23 +179,21 @@ } // ULPGC ecastro - function check_response(&$question, &$state) { + function check_response(&$question, &$state){ $answers = &$question->options->answers; - $testedstate = clone($state); - $teststate = clone($state); foreach($answers as $aid => $answer) { - $teststate->responses[''] = trim($answer->answer); - if($this->compare_responses($question, $testedstate, $teststate)) { + if($this->test_response($question, $state, $answer)) { return $aid; } } return false; } + function compare_responses($question, $state, $teststate) { if (isset($state->responses['']) && isset($teststate->responses[''])) { return $this->compare_string_with_wildcard(stripslashes_safe($state->responses['']), - $teststate->responses[''], !$question->options->usecase); + $teststate->responses[''], !$question->options->usecase, false); } return false; } @@ -207,16 +205,20 @@ $answer->answer, !$question->options->usecase); } - function compare_string_with_wildcard($string, $pattern, $ignorecase) { - // Break the string on non-escaped asterisks. - $bits = preg_split('/(?