Permalink
Browse files

MDL-16427 changing $answer=='*' to $answer ==='*'

  • Loading branch information...
1 parent 2c16f76 commit 38d739257df48986b839a826b1732f6c5dc94cf5 pichetp committed Sep 18, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 question/type/numerical/questiontype.php
@@ -122,7 +122,7 @@ function save_question_options($question) {
$answer = new stdClass;
$answer->question = $question->id;
- if (trim($dataanswer) == '*') {
+ if (trim($dataanswer) === '*') {
$answer->answer = '*';
} else {
$answer->answer = $this->apply_unit($dataanswer, $units);
@@ -215,6 +215,7 @@ function save_numerical_units($question) {
for ($i = 0; $i < $n; $i++) {
// Discard any unit which doesn't specify the unit or the multiplier
if (!empty($question->multiplier[$i]) && !empty($question->unit[$i])) {
+ $units[$i] = new stdClass;
$units[$i]->question = $question->id;
$units[$i]->multiplier = $this->apply_unit($question->multiplier[$i], array());
$units[$i]->unit = $question->unit[$i];
@@ -274,7 +275,7 @@ function compare_responses(&$question, $state, $teststate) {
*/
function test_response(&$question, &$state, $answer) {
// Deal with the match anything answer.
- if ($answer->answer == '*') {
+ if ($answer->answer === '*') {
return true;
}

0 comments on commit 38d7392

Please sign in to comment.