Permalink
Browse files

Merge branch 'MDL-44981-26' of git://github.com/jamiepratt/moodle int…

…o MOODLE_26_STABLE
  • Loading branch information...
danpoltawski committed Apr 18, 2014
2 parents 6e674be + 6569d67 commit cafeac819fc745c24674a2d44e87793538c84655
@@ -107,7 +107,7 @@ public function has_actual_responses() {
return true;
} else if (count($this->actualresponses) == 1) {
$onlyactualresponse = reset($this->actualresponses);
return !$onlyactualresponse->response_matches($this->modelresponse);
return (string)$onlyactualresponse != $this->modelresponse;
}
return false;
}
@@ -249,7 +249,7 @@ public function grade_response(array $response) {
}
public function classify_response(array $response) {
if (empty($response['answer'])) {
if (!$this->is_gradable_response($response)) {
return array($this->id => question_classified_response::no_response());
}
@@ -211,6 +211,9 @@ public function test_classify_response() {
$this->assertEquals(array(
new question_classified_response(17, '42', 0.0)),
$num->classify_response(array('answer' => '42')));
$this->assertEquals(array(
new question_classified_response(17, '0', 0.0)),
$num->classify_response(array('answer' => '0')));
$this->assertEquals(array(
new question_classified_response(13, '3.14', 1.0)),
$num->classify_response(array('answer' => '3.14')));
@@ -238,6 +241,9 @@ public function test_classify_response_no_star() {
$this->assertEquals(array(
new question_classified_response(null, 'abc', 0.0)),
$num->classify_response(array('answer' => 'abc')));
$this->assertEquals(array(
new question_classified_response(0, '0', 0.0)),
$num->classify_response(array('answer' => '0')));
$this->assertEquals(array(
question_classified_response::no_response()),
$num->classify_response(array('answer' => '')));

0 comments on commit cafeac8

Please sign in to comment.