public function test_summarise_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual('{quick} {fox} {lazy}',
$gapselect->summarise_response(array('p1' => '1', 'p2' => '1', 'p3' => '1')));
public function test_summarise_response_maths() {
$gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual('{+} {-} {+} {-}', $gapselect->summarise_response(
array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2')));
public function test_get_right_choice_for() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(1, $gapselect->get_right_choice_for(1));
$this->assertEqual(1, $gapselect->get_right_choice_for(2));
public function test_get_right_choice_for_maths() {
$gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(1, $gapselect->get_right_choice_for(1));
$this->assertEqual(2, $gapselect->get_right_choice_for(2));
public function test_clear_wrong_from_response() {
$gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$initialresponse = array('p1' => '1', 'p2' => '1', 'p3' => '1', 'p4' => '1');
$this->assertEqual(array('p1' => '1', 'p2' => '0', 'p3' => '1', 'p4' => '0'),
public function test_get_num_parts_right() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(2, 3),
$gapselect->get_num_parts_right(array('p1' => '1', 'p2' => '1', 'p3' => '2')));
public function test_get_num_parts_right_maths() {
$gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(2, 4), $gapselect->get_num_parts_right(
array('p1' => '1', 'p2' => '1', 'p3' => '1', 'p4' => '1')));
public function test_get_expected_data() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array('p1' => PARAM_INT, 'p2' => PARAM_INT, 'p3' => PARAM_INT),
$gapselect->get_expected_data());
public function test_get_correct_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array('p1' => '1', 'p2' => '1', 'p3' => '1'),
$gapselect->get_correct_response());
public function test_get_correct_response_maths() {
$gapselect = qtype_gapselect_test_helper::make_a_maths_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2'),
$gapselect->get_correct_response());
public function test_is_same_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertTrue($gapselect->is_same_response(
array(),
}
public function test_is_complete_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertFalse($gapselect->is_complete_response(array()));
$this->assertFalse($gapselect->is_complete_response(
public function test_is_gradable_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertFalse($gapselect->is_gradable_response(array()));
$this->assertFalse($gapselect->is_gradable_response(
public function test_grading() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(1, question_state::$gradedright),
$gapselect->grade_response(array('p1' => '1', 'p2' => '1', 'p3' => '1')));
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());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(1, question_state::$gradedright), $gapselect->grade_response(
array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2')));
public function test_classify_response() {
$gapselect = qtype_gapselect_test_helper::make_a_gapselect_question();
$gapselect->shufflechoices = false;
- $gapselect->start_attempt(new question_attempt_step());
+ $gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(
1 => new question_classified_response(1, 'quick', 1),