You are here

public function QuizTakingTestCase::testQuestionCount in Quiz 7.5

Verify non gradable questions are excluded from counts.

File

tests/QuizTakingTestCase.test, line 426

Class

QuizTakingTestCase

Code

public function testQuestionCount() {
  $quiz_node = $this
    ->drupalCreateQuiz(array(
    'review_options' => array(
      'question' => array(
        'score' => 'score',
      ),
    ),
  ));
  $question_node1 = $this
    ->drupalCreateNode(array(
    'type' => 'truefalse',
    'correct_answer' => 1,
  ));
  $this
    ->linkQuestionToQuiz($question_node1, $quiz_node);
  $question_node2 = $this
    ->drupalCreateNode(array(
    'type' => 'quiz_directions',
  ));
  $this
    ->linkQuestionToQuiz($question_node2, $quiz_node);
  $question_node3 = $this
    ->drupalCreateNode(array(
    'type' => 'truefalse',
    'correct_answer' => 1,
  ));
  $this
    ->linkQuestionToQuiz($question_node3, $quiz_node);
  $question_node4 = $this
    ->drupalCreateNode(array(
    'type' => 'truefalse',
    'correct_answer' => 1,
  ));
  $this
    ->linkQuestionToQuiz($question_node4, $quiz_node);
  $question_node5 = $this
    ->drupalCreateNode(array(
    'type' => 'truefalse',
    'correct_answer' => 1,
  ));
  $this
    ->linkQuestionToQuiz($question_node5, $quiz_node);
  $this
    ->drupalGet("node/{$quiz_node->nid}");
  $this
    ->assertText("4");
}