function _quiz_add_fields_for_creating_questions in Quiz 7
Same name and namespace in other branches
- 8.4 quiz.admin.inc \_quiz_add_fields_for_creating_questions()
- 6.4 quiz.admin.inc \_quiz_add_fields_for_creating_questions()
- 7.6 quiz.admin.inc \_quiz_add_fields_for_creating_questions()
- 7.4 quiz.admin.inc \_quiz_add_fields_for_creating_questions()
- 7.5 quiz.admin.inc \_quiz_add_fields_for_creating_questions()
Fields for creating new questions are added to the quiz_questions_form
Parameters
$form: FAPI form(array)
$types: All the question types(array)
$quiz: The quiz node
1 call to _quiz_add_fields_for_creating_questions()
- quiz_questions_form in ./
quiz.admin.inc - Handles "manage questions" tab.
File
- ./
quiz.admin.inc, line 895 - Administrator interface for Quiz module.
Code
function _quiz_add_fields_for_creating_questions(&$form, &$types, &$quiz) {
// Display links to create other questions.
$form['additional_questions'] = array(
'#type' => 'fieldset',
'#title' => t('Create new question'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$destination = drupal_get_destination();
foreach ($types as $type => $info) {
$url_type = str_replace('_', '-', $type);
$options = array(
'attributes' => array(
'title' => t('Create @name', array(
'@name' => $info['name'],
)),
),
'query' => $destination,
);
$form['additional_questions'][$type] = array(
'#markup' => '<div class="add-questions">' . l($info['name'], "node/add/{$url_type}", $options) . '</div>',
);
}
}