You are here

short_answer.theme.inc in Quiz 7.5

Theme functions for the short_answer question type.

File

question_types/short_answer/theme/short_answer.theme.inc
View source
<?php

/**
 * @file
 * Theme functions for the short_answer question type.
 */

/**
 * Theme the short_answer answer.
 *
 * @param array $variables
 *
 * @return string
 *   An HTML string.
 */
function theme_short_answer_user_answer($variables) {
  $answer = $variables['answer'];
  $correct = $variables['correct'];
  $header = array(
    t('Correct Answer'),
    t('User Answer'),
  );
  $row = array(
    array(
      $correct,
      $answer,
    ),
  );
  return theme('table', array(
    'header' => $header,
    'rows' => $row,
  ));
}

/**
 * Theme the short_answer response form.
 *
 * @param array $variables
 *
 * @return string
 *   An HTML string.
 */
function theme_short_answer_response_form($variables) {
  $form = $variables['form'];
  return drupal_render_children($form);
}

Functions

Namesort descending Description
theme_short_answer_response_form Theme the short_answer response form.
theme_short_answer_user_answer Theme the short_answer answer.