private function MultichoiceQuestion::getDefaultAltSettings in Quiz 8.4
Helper function provding the default settings for the creation form.
Return value
Array with the default settings
1 call to MultichoiceQuestion::getDefaultAltSettings()
- MultichoiceQuestion::getCreationForm in question_types/
multichoice/ lib/ Drupal/ multichoice/ MultichoiceQuestion.php - Implementation of getCreationForm
File
- question_types/
multichoice/ lib/ Drupal/ multichoice/ MultichoiceQuestion.php, line 696 - The main classes for the multichoice question type.
Class
- MultichoiceQuestion
- Extension of QuizQuestion.
Namespace
Drupal\multichoiceCode
private function getDefaultAltSettings() {
// If the node is being updated the default settings are those stored in the node
if ($this->node
->id()) {
$settings['choice_multi'] = $this->node->choice_multi;
$settings['choice_random'] = $this->node->choice_random;
$settings['choice_boolean'] = $this->node->choice_boolean;
}
elseif ($settings = $this
->getUserSettings()) {
}
else {
$settings['choice_multi'] = 0;
$settings['choice_random'] = 0;
$settings['choice_boolean'] = 0;
}
return $settings;
}