function quiz_admin_node_form in Quiz 7.6
Same name and namespace in other branches
- 8.4 quiz.admin.inc \quiz_admin_node_form()
- 6.4 quiz.admin.inc \quiz_admin_node_form()
- 7 quiz.admin.inc \quiz_admin_node_form()
- 7.4 quiz.admin.inc \quiz_admin_node_form()
- 7.5 quiz.admin.inc \quiz_admin_node_form()
Renders the quiz node form for the admin pages
This form is used to configure default values for the quiz node form
1 string reference to 'quiz_admin_node_form'
- quiz_menu in ./
quiz.module - Implements hook_menu().
File
- ./
quiz.admin.inc, line 268 - Administrator interface for Quiz module.
Code
function quiz_admin_node_form($form, &$form_state) {
// Create a dummy node to use as input for quiz_form
$dummy_node = new stdClass();
// def_uid is the uid of the default user holding the default values for the node form(no real user with this uid exists)
$settings = quiz_get_defaults();
foreach ($settings as $key => $value) {
if (!isset($dummy_node->{$key})) {
$dummy_node->{$key} = $value;
}
}
$form = quiz_form($dummy_node, $form_state);
$form['direction'] = array(
'#markup' => t('Here you can change the default @quiz settings for new users.', array(
'@quiz' => QUIZ_NAME,
)),
'#weight' => -10,
);
// unset values we can't or won't let the user edit default values for
unset($form['#quiz_check_revision_access'], $form['title'], $form['body_field'], $form['taking']['aid'], $form['taking']['addons'], $form['quiz_availability']['quiz_open'], $form['quiz_availability']['quiz_close'], $form['resultoptions'], $form['number_of_random_questions'], $form['remember_global']);
$form['remember_settings']['#type'] = 'value';
$form['remember_settings']['#default_value'] = TRUE;
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#submit' => array(
'quiz_admin_node_form_submit',
),
);
return $form;
}