Skip to content

Commit

Permalink
MDL-16427 changing $answer=='*' to $answer ==='*'
Browse files Browse the repository at this point in the history
  • Loading branch information
pichetp committed Sep 18, 2008
1 parent 2c16f76 commit 38d7392
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions question/type/numerical/questiontype.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 38d7392

Please sign in to comment.