You are here

function LongAnswerTestCase::testCreateQuizQuestion in Quiz 7.6

Same name and namespace in other branches
  1. 7.5 question_types/long_answer/long_answer.test \LongAnswerTestCase::testCreateQuizQuestion()

Test adding and taking a truefalse question.

Overrides QuizQuestionTestCase::testCreateQuizQuestion

1 call to LongAnswerTestCase::testCreateQuizQuestion()
LongAnswerTestCase::testGradeAnswerManualFeedback in question_types/long_answer/long_answer.test
Test manually graded questions. Also test feedback here instead of its own test case.

File

question_types/long_answer/long_answer.test, line 88
Unit tests for the long_answer Module.

Class

LongAnswerTestCase
Test class for long answer.

Code

function testCreateQuizQuestion($settings = array()) {
  if (!$settings) {
    $settings = array(
      'rubric' => 'LA 1 rubric.',
    );
  }

  // 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;
}