public function MatchingTestCase::testCreateQuizQuestion in Quiz 7.5
Same name and namespace in other branches
- 7.6 question_types/matching/matching.test \MatchingTestCase::testCreateQuizQuestion()
Test adding and taking a matching question.
Overrides QuizQuestionTestCase::testCreateQuizQuestion
3 calls to MatchingTestCase::testCreateQuizQuestion()
- MatchingTestCase::testChoicePenalty in question_types/
matching/ matching.test - Test if the penalty system for guessing wrong work.
- MatchingTestCase::testEditQuestionResponse in question_types/
matching/ matching.test - Test that the question response can be edited.
- MatchingTestCase::testTakeQuestion in question_types/
matching/ matching.test - Test using a matching question inside a quiz.
File
- question_types/
matching/ matching.test, line 33 - Unit tests for the matching Module.
Class
- MatchingTestCase
- Test class for matching questions.
Code
public function testCreateQuizQuestion() {
// Login as our privileged user.
$this
->drupalLogin($this->admin);
$match = array();
for ($i = 0; $i <= 2; $i++) {
$match[$i]['question'] = "MAQ " . ($i + 1);
$match[$i]['answer'] = "MAA " . ($i + 1);
$match[$i]['feedback'] = "MAF " . ($i + 1);
}
$question_node = $this
->drupalCreateNode(array(
'type' => $this->question_node_type,
'title' => 'MA 1 title',
'body' => array(
LANGUAGE_NONE => array(
array(
'value' => 'MA 1 body text',
),
),
),
'match' => $match,
'choice_penalty' => 0,
));
return $question_node;
}