public function MultichoiceTestCase::testRandomOrder in Quiz 7.5
Same name and namespace in other branches
- 7.6 question_types/multichoice/multichoice.test \MultichoiceTestCase::testRandomOrder()
Test random order of choices.
@todo I don't know how we would test random questions.
File
- question_types/
multichoice/ multichoice.test, line 180 - Test suite for choice Questions type module.
Class
- MultichoiceTestCase
- Test class for multichoice questions.
Code
public function testRandomOrder() {
$this
->drupalLogin($this->admin);
$question_node = $this
->testCreateQuizQuestion(array(
'choice_random' => 1,
));
$quiz_node = $this
->linkQuestionToQuiz($question_node);
$this
->drupalLogin($this->user);
$this
->drupalGet("node/{$quiz_node->nid}/take");
$this
->drupalPost(NULL, array(
"question[{$question_node->nid}][answer][user_answer]" => $question_node->alternatives[0]['id'],
), t('Finish'));
}