public function ClozeQuestion::getCreationForm in Cloze 7
Same name and namespace in other branches
- 6 cloze.classes.inc \ClozeQuestion::getCreationForm()
Implementation of getCreationForm
See also
QuizQuestion#getCreationForm($form_state)
File
- ./
cloze.classes.inc, line 217 - The main classes for the cloze question type. These inherit or implement code found in quiz_question.classes.inc.
Class
- ClozeQuestion
- Extension of QuizQuestion.
Code
public function getCreationForm(array &$form_state = NULL) {
$module_path = drupal_get_path('module', 'cloze');
$form['#attached']['css'][] = $module_path . '/theme/cloze.css';
$form['instructions'] = array(
'#markup' => '<div class="cloze-instruction">' . t('For free text cloze, mention the correct answer inside the square bracket. For multichoice cloze, provide the options separated by commas with correct answer as first. <br/>Example question: [The] Sun raises in the [east, west, north, south]. <br/>Answer: <span class="answer correct correct-answer">The</span> Sun raises in the <span class="answer correct correct-answer">east</span>.') . '</div>',
'#weight' => -10,
);
$form['learning_mode'] = array(
'#type' => 'checkbox',
'#title' => t('Allow right answers only'),
'#description' => t('This is meant to be used for learning purpose. If this option is enabled only the right answers will be accepted.'),
);
return $form;
}