Learn Drupal MCQs
Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.
Which file contains the main configuration settings in Drupal?
1) settings.php
2) config.yml
3) routes.yml
4) config.php
Answer : settings.php
What does the `hook_theme()` function do?
1) Defines the theme for a module
2) Creates new themes
3) Deletes themes
4) Manages theme settings
Answer : Creates new themes
What is a node in Drupal?
1) A piece of content
2) A module
3) A user role
4) A theme
Answer : A module
Which of the following commands is used to revert a feature in Drupal?
1) drush features-revert
2) drush revert-feature
3) drush feature-reset
4) drush feature-undo
Answer : drush features-revert
What is the function of `drupal_get_form()`?
1) Retrieve a form array
2) Create a new form
3) Delete a form
4) Manage form submissions
Answer : Create a new form
Which command is used to export configuration in Drush?
1) drush config-export
2) drush config-export-all
3) drush config-download
4) drush export-config
Answer : drush config-export
What does the `hook_cron()` function do?
1) Runs scheduled tasks
2) Creates new content
3) Deletes old content
4) Manages user permissions
Answer : Creates new content
Which of the following files is used to define a module in Drupal?
1) module_name.info.yml
2) module_name.module
3) module_name.install
4) module_name.routing.yml
Answer : module_name.info.yml
What is the purpose of `hook_menu_local_tasks_alter()`?
1) Alter local tasks
2) Create new menu items
3) Delete menu items
4) Manage menu permissions
Answer : Manage menu permissions
Which function is used to fetch configuration settings in Drupal?
1) config()
2) get_config()
3) drupal_get_configuration()
4) get_settings()
Answer : config()