function quiz_result_type_form in Quiz 7.5
File
- ./
quiz.module, line 4008 - quiz.module Main file for the Quiz module.
Code
function quiz_result_type_form($form, &$form_state, $quiz_result_type, $op = 'edit') {
if ($op == 'clone') {
$quiz_result_type->label .= ' (cloned)';
$quiz_result_type->type = '';
}
$form['label'] = array(
'#title' => t('Label'),
'#type' => 'textfield',
'#default_value' => isset($quiz_result_type->label) ? $quiz_result_type->label : '',
'#description' => t('The human-readable name of this quiz result type.'),
'#required' => TRUE,
'#size' => 30,
);
// Machine-readable type name.
$form['type'] = array(
'#type' => 'machine_name',
'#default_value' => isset($quiz_result_type->type) ? $quiz_result_type->type : '',
'#maxlength' => 32,
'#disabled' => !isset($quiz_result_type->is_new) && $op != 'clone',
'#machine_name' => array(
'exists' => 'quiz_result_types',
'source' => array(
'label',
),
),
'#description' => t('A unique machine-readable name for this quiz result type. It must only contain lowercase letters, numbers, and underscores.'),
);
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save quiz result type'),
'#weight' => 40,
);
return $form;
}