You are here

function _quiz_categorized_new_term_form in Quiz 7

Same name and namespace in other branches
  1. 8.4 quiz.admin.inc \_quiz_categorized_new_term_form()
  2. 6.4 quiz.admin.inc \_quiz_categorized_new_term_form()
  3. 7.6 quiz.admin.inc \_quiz_categorized_new_term_form()
  4. 7.4 quiz.admin.inc \_quiz_categorized_new_term_form()
  5. 7.5 quiz.admin.inc \_quiz_categorized_new_term_form()

Form for adding new terms to a quiz

See also

quiz_categorized_form

1 call to _quiz_categorized_new_term_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 586
Administrator interface for Quiz module.

Code

function _quiz_categorized_new_term_form(&$form, $form_state, $quiz) {
  $form['new'] = array(
    '#type' => 'fieldset',
    '#title' => t('Add category'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#tree' => FALSE,
  );
  $form['new']['term'] = array(
    '#type' => 'textfield',
    '#title' => t('Category'),
    '#description' => t('Type in the name of the term you would like to add questions from.'),
    '#autocomplete_path' => "node/{$quiz->nid}/questions/term_ahah",
    '#field_suffix' => '<a id="browse-for-term" href="#">' . t('browse') . '</a>',
  );
  $form['new']['number'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of questions'),
    '#description' => t('How many questions would you like to draw from this term?'),
  );
  $form['new']['max_score'] = array(
    '#type' => 'textfield',
    '#title' => t('Max score for each question'),
    '#description' => t('The number of points a user will be awarded for each question he gets correct.'),
    '#default_value' => 1,
  );
}