MDL-39507 qtype_essay: hacky fix for unit tests

This is just to get the tests passing for integration purposes. Tim
may want to do a robust fix and revert this.
This commit is contained in:
Dan Poltawski
2013-08-13 10:47:46 +08:00
parent 2e91dfc66c
commit d835ad6935
2 changed files with 6 additions and 6 deletions
@@ -56,7 +56,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
$this->get_does_not_contain_feedback_expectation());
// Simulate some data submitted by the student.
$this->process_submission(array('answer' => 'This is my wonderful essay!'));
$this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
// Verify.
$this->check_current_state(question_state::$complete);
@@ -68,7 +68,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
// Process the same data again, check it does not create a new step.
$numsteps = $this->get_step_count();
$this->process_submission(array('answer' => 'This is my wonderful essay!'));
$this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
$this->check_step_count($numsteps);
// Process different data, check it creates a new step.
@@ -77,7 +77,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
$this->check_current_state(question_state::$todo);
// Change back, check it creates a new step.
$this->process_submission(array('answer' => 'This is my wonderful essay!'));
$this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
$this->check_step_count($numsteps + 2);
// Finish the attempt.
@@ -164,7 +164,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
$this->check_current_mark(null);
// Simulate some data submitted by the student.
$this->process_submission(array('answer' => 'This is my wonderful essay!'));
$this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
// Verify.
$this->check_current_state(question_state::$complete);
@@ -241,7 +241,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
$this->get_does_not_contain_feedback_expectation());
// Simulate some data submitted by the student.
$this->process_submission(array('answer' => 'This is my wonderful essay!'));
$this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
// Verify.
$this->check_current_state(question_state::$complete);
+1 -1
View File
@@ -47,7 +47,7 @@ class qtype_essay_question_test extends advanced_testcase {
$longstring = str_repeat('0123456789', 50);
$essay = test_question_maker::make_an_essay_question();
$this->assertEquals($longstring,
$essay->summarise_response(array('answer' => $longstring)));
$essay->summarise_response(array('answer' => $longstring, 'answerformat' => FORMAT_PLAIN)));
}
public function test_is_complete_response() {