You are here

choice.theme.inc in Quiz 6.6

The theme file for choice.

Sponsored by: Norwegian Centre for Telemedicine Code: falcon

Theming functions for the choice questiontype.

File

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

/**
 * The theme file for choice.
 * 
 * Sponsored by: Norwegian Centre for Telemedicine
 * Code: falcon
 *
 * @file
 * Theming functions for the choice questiontype.
 */
function theme_choice_creation_form($form) {
  $path = drupal_get_path('module', 'choice') . '/choice.js';
  drupal_add_js($path, 'module');
  $errors = form_get_errors();
  if (isset($errors['choice_multi'])) {
    $form['settings']['#collapsed'] = FALSE;
  }
  if ($errors) {
    for ($i = 0; is_array($form[$i]); $i++) {
      if (drupal_strlen(strip_tags($_POST['alternatives'][$i]['answer'])) > 0) {
        $form[$i]['#collapsed'] = FALSE;
      }
    }
  }
  return drupal_render($form);
}

Functions

Namesort descending Description
theme_choice_creation_form The theme file for choice.