Skip to content

Commit

Permalink
MDL-39507 qtype_essay: hacky fix for unit tests
Browse files Browse the repository at this point in the history
This is just to get the tests passing for integration purposes. Tim
may want to do a robust fix and revert this.
  • Loading branch information
danpoltawski committed Aug 13, 2013
1 parent 969de2a commit ed07242
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions question/behaviour/manualgraded/tests/walkthrough_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test_manual_graded_essay() {
$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);
Expand All @@ -68,7 +68,7 @@ public function test_manual_graded_essay() {

// 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.
Expand All @@ -77,7 +77,7 @@ public function test_manual_graded_essay() {
$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.
Expand Down Expand Up @@ -206,7 +206,7 @@ public function test_manual_graded_ignore_repeat_sumbission() {
$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);
Expand Down Expand Up @@ -283,7 +283,7 @@ public function test_manual_graded_essay_can_grade_0() {
$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);
Expand Down
2 changes: 1 addition & 1 deletion question/type/essay/tests/question_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function test_summarise_response() {
$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_same_response() {
Expand Down

0 comments on commit ed07242

Please sign in to comment.