You are here

function _quiz_categorized_existing_terms_form in Quiz 7

Same name and namespace in other branches
  1. 8.4 quiz.admin.inc \_quiz_categorized_existing_terms_form()
  2. 6.4 quiz.admin.inc \_quiz_categorized_existing_terms_form()
  3. 7.6 quiz.admin.inc \_quiz_categorized_existing_terms_form()
  4. 7.4 quiz.admin.inc \_quiz_categorized_existing_terms_form()
  5. 7.5 quiz.admin.inc \_quiz_categorized_existing_terms_form()
1 call to _quiz_categorized_existing_terms_form()
quiz_categorized_form in ./quiz.admin.inc
Form for managing what questions should be added to a quiz with categorized random questions.

File

./quiz.admin.inc, line 550
Administrator interface for Quiz module.

Code

function _quiz_categorized_existing_terms_form(&$form, $form_state, $quiz) {
  $terms = _quiz_get_terms($quiz->vid);
  foreach ($terms as $term) {
    $form[$term->tid]['name'] = array(
      '#value' => check_plain($term->name),
    );
    $form[$term->tid]['number'] = array(
      '#type' => 'textfield',
      '#size' => 3,
      '#default_value' => $term->number,
    );
    $form[$term->tid]['max_score'] = array(
      '#type' => 'textfield',
      '#size' => 3,
      '#default_value' => $term->max_score,
    );
    $form[$term->tid]['remove'] = array(
      '#type' => 'checkbox',
      '#default_value' => 0,
    );
    $form[$term->tid]['weight'] = array(
      '#type' => 'textfield',
      '#size' => 3,
      '#default_value' => $term->weight,
      '#attributes' => array(
        'class' => array(
          'term-weight',
        ),
      ),
    );
  }
}