public function LongAnswerTestCase::testCreateQuizQuestion in Quiz 7.5
Same name and namespace in other branches
- 7.6 question_types/long_answer/long_answer.test \LongAnswerTestCase::testCreateQuizQuestion()
Test adding and taking a long answer question.
Overrides QuizQuestionTestCase::testCreateQuizQuestion
2 calls to LongAnswerTestCase::testCreateQuizQuestion()
- LongAnswerTestCase::testEditQuestionResponse in question_types/
long_answer/ long_answer.test - Test that the question response can be edited.
- LongAnswerTestCase::testGradeAnswerManualFeedback in question_types/
long_answer/ long_answer.test - Test manually graded questions.
File
- question_types/
long_answer/ long_answer.test, line 102 - Unit tests for the long_answer Module.
Class
- LongAnswerTestCase
- Test class for long answer.
Code
public function testCreateQuizQuestion($settings = array()) {
if (!$settings) {
$settings = array(
'rubric' => array(
'value' => 'LA 1 rubric.',
'format' => 'plain_text',
),
'answer_text_processing' => 0,
);
}
// Login as our privileged user.
$this
->drupalLogin($this->admin);
$question_node = $this
->drupalCreateNode(array(
'type' => $this->question_node_type,
'title' => 'LA 1 title',
'body' => array(
LANGUAGE_NONE => array(
array(
'value' => 'LA 1 body text.',
),
),
),
) + $settings);
return $question_node;
}