function quiz_entity_bundle_info in Quiz 8.6
Same name and namespace in other branches
- 8.5 quiz.module \quiz_entity_bundle_info()
Implements hook_entity_bundle_info().
@todo doesn't work yet
Define a question and answer bundle for each question type so they don't have to do it in configuration.
File
- ./
quiz.module, line 814 - Contains quiz.module
Code
function quiz_entity_bundle_info() {
/* @var $type QuizQuestionPluginManager */
$type = Drupal::service('plugin.manager.quiz.question');
$question_types = $type
->getDefinitions();
$bundles = array();
foreach ($question_types as $key => $question_type) {
$bundles['quiz_question'][$key] = [
'label' => $question_type['label'],
];
}
//return $bundles;
}