public function test_grading_maths() { $gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question(); $gapselect->shufflechoices = false; $gapselect->start_attempt(new question_attempt_step(), 1); $this->assertEquals(array(1, question_state::$gradedright), $gapselect->grade_response(array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2'))); $this->assertEquals(array(0.5, question_state::$gradedpartial), $gapselect->grade_response(array('p1' => '1', 'p2' => '1', 'p3' => '1', 'p4' => '1'))); $this->assertEquals(array(0, question_state::$gradedwrong), $gapselect->grade_response(array('p1' => '0', 'p2' => '1', 'p3' => '2', 'p4' => '1'))); }