You are here

function theme_matching_question_form in Quiz 8.4

Same name and namespace in other branches
  1. 8.6 question_types/quiz_matching/theme/matching.theme.inc \theme_matching_question_form()
  2. 8.5 question_types/quiz_matching/theme/matching.theme.inc \theme_matching_question_form()
  3. 6.4 question_types/matching/theme/matching.theme.inc \theme_matching_question_form()
  4. 7.6 question_types/matching/theme/matching.theme.inc \theme_matching_question_form()
  5. 7 question_types/matching/theme/matching.theme.inc \theme_matching_question_form()
  6. 7.4 question_types/matching/theme/matching.theme.inc \theme_matching_question_form()
  7. 7.5 question_types/matching/theme/matching.theme.inc \theme_matching_question_form()

Theme the matching question form.

Parameters

$form: drupal form array

1 theme call to theme_matching_question_form()
MatchingQuestion::getCreationForm in question_types/matching/lib/Drupal/matching/MatchingQuestion.php
Implementation of getCreationForm

File

question_types/matching/matching.theme.inc, line 15
Themes for the matching module.

Code

function theme_matching_question_form($variables) {
  $form = $variables['form'];
  $rows = array();
  $header = array(
    'question' => t('Question'),
    'answer' => t('Correct answer'),
    'feedback' => t('Feedback'),
  );
  foreach (element_children($form) as $key) {
    $rows[] = array(
      'question' => drupal_render($form[$key]['question']),
      'answer' => drupal_render($form[$key]['answer']),
      'feedback' => drupal_render($form[$key]['feedback']),
    );
  }

  // Theme output and display to screen.
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}