Learn Drupal MCQs
Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.
Which command would you use to export configuration from the active site?
1) drush config-export
2) drush config-export-all
3) drush export-config
4) drush config-save
Answer : drush config-export
What does `hook_entity_view_alter()` allow you to do?
1) Alter the display of entities
2) Create new entities
3) Delete entities
4) Manage entity permissions
Answer : Alter the display of entities
Which function is used to get a list of all available languages in Drupal?
1) language_list()
2) drupal_get_languages()
3) get_available_languages()
4) languages()
Answer : language_list()
What is the primary purpose of a Drupal theme?
1) To control the look and feel of the site
2) To manage users
3) To configure modules
4) To store data
Answer : To manage users
Which command is used to disable a module in Drush?
1) drush pm-disable module_name
2) drush disable module_name
3) drush module-disable module_name
4) drush pm-dis module_name
Answer : drush module-disable module_name
What does the `hook_entity_update()` function allow you to do?
1) Perform actions after an entity is updated
2) Create new entities
3) Delete entities
4) Alter entity permissions
Answer : Alter entity permissions
What is the purpose of the `hook_node_view()` function?
1) Alters the node display
2) Creates new nodes
3) Deletes nodes
4) Manages node settings
Answer : Manages node settings
Which function is used to retrieve user roles in Drupal?
1) user_roles()
2) user_load_roles()
3) drupal_get_user_roles()
4) get_user_roles()
Answer : drupal_get_user_roles()
What command would you use to clear the cache for a specific service?
1) drush cache-clear service_name
2) drush cache-rebuild service_name
3) drush cr service_name
4) drush clear-cache service_name
Answer : drush clear-cache service_name
What does `hook_field_widget_info()` do?
1) Defines field widgets
2) Creates new fields
3) Deletes field widgets
4) Manages field settings
Answer : Defines field widgets