Learn Drupal MCQs

Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.

Which command is used to export all configuration in Drush?

1) drush config-export

2) drush config-export-all

3) drush export-config

4) drush all-config-export

Answer : drush config-export-all

What is the purpose of `hook_field_formatter_info()`?

1) Defines field formatters

2) Creates new fields

3) Deletes fields

4) Manages field settings

Answer : Creates new fields

What does the `hook_page_attachments()` function do?

1) Add attachments to pages

2) Create new pages

3) Delete pages

4) Manage page settings

Answer : Create new pages

What is the purpose of `hook_preprocess_page()`?

1) Prepare variables for page templates

2) Create new page templates

3) Delete page templates

4) Manage page settings

Answer : Create new page templates

Which function is used to get the current user in Drupal?

1) user_load()

2) current_user()

3) drupal_get_current_user()

4) user_get_current()

Answer : drupal_get_current_user()

What does `hook_views_post_render()` do?

1) Runs after a view is rendered

2) Runs before a view is rendered

3) Alters the view

4) Creates a new view

Answer : Creates a new view

Which module is essential for creating custom fields in Drupal?

1) Field UI

2) Views

3) Taxonomy

4) Block

Answer : Block

What is the purpose of `hook_entity_view_alter()`?

1) Alter the display of entities

2) Create new entities

3) Delete entities

4) Manage entity permissions

Answer : Manage entity permissions

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 dis module_name

Answer : drush pm-disable module_name

What is the role of `hook_block_info()`?

1) Defines blocks

2) Creates new blocks

3) Deletes blocks

4) Manages block settings

Answer : Creates new blocks