You are here

public function MatchingQuestion::getQuestionForm in Quiz 6.3

Same name and namespace in other branches
  1. 6.6 question_types/matching/matching.classes.inc \MatchingQuestion::getQuestionForm()
  2. 6.5 question_types/matching/matching.classes.inc \MatchingQuestion::getQuestionForm()

Get the form that will be displayed to the test-taking user.

Parameters

$node: The question node.

$context: The form context.

Return value

Must return a FAPI array.

Overrides QuizQuestion::getQuestionForm

1 call to MatchingQuestion::getQuestionForm()
MatchingQuestion::view in question_types/matching/matching.classes.inc
Retrieve information relevant for viewing the node. This data is generally added to the node's extra field.

File

question_types/matching/matching.classes.inc, line 92
quiz_directions.classes

Class

MatchingQuestion
Implementation of Matching.

Code

public function getQuestionForm($node, $context = NULL) {
  $form = array();
  $form['question'] = array(
    '#type' => 'markup',
    '#value' => check_markup($this->node->body, $this->node->format, FALSE),
  );
  list($questions, $select_option) = $this
    ->getQuestion($node);
  foreach ($questions as $question) {
    $form['subquestion']['tries[' . $question['match_id'] . ']'] = array(
      '#type' => 'select',
      '#title' => $question['question'],
      '#options' => $this
        ->customShuffle($select_option),
    );
  }
  return array(
    $form['question'],
    $this
      ->customShuffle($form['subquestion']),
  );
}