Upwork Drupal Test Answers August 2022 | Drupal Test Answers earnwithfs

 Upwork Drupal Test Answers August 2022 | Drupal Test Answers earnwithfs




Upwork Drupal Test Answers August 2022








In this article I will provide you 50 Upwork Drupal Test Answers August 2022. If you want to get 100% score in Upwork Drupal Test then read this article carefully. 





Upwork Drupal Test Answers August 2022 | Drupal Test Answers earnwithfs ( Q No 1 to Q No 20 ) 


1.) By using the auto-complete field for a CCK nodereference, nodereference gives node id as [nid: node id]; which Drupal hook can be used to remove the bracket from the auto-complete list?

Answers:

� menu_alter()

� form_alter()

� A & B both

� None of above

2.) Which of the following is the correct way to customize the template for a view thas has been created using CCK and the Views 2 module?

Answers:

� By creating a node-contentname.tpl.php or views-view-field–viewname–field-name-value.tpl.php

� By creating views-view-field–viewname–field-name-value.tpl.php

� Using Semantic Views

� Clicking on admin/build/views/edit/ViewName -> Basic Settings -> Theme

3.) Which of the following is the correct way to make a partial or substring search in Drupal?

Answers:

� By using the Apache Solr module

� By using the Search Lucene API

� By patching the core modules

� By using all of the above methods

4.) How can all the input filters that have been created in the code be applied?

Answers:

� Using check_markup()

� You can only apply filters one at time in your code.

� Using apply_filter()

� Using input_filter()

5.) Which of the following statements are true?

Answers:

� Can insert a block to a template programmatically using block_invoke().

� Can insert a block to a template programmatically using module_invoke().

� Can insert a block to a template programmatically using module_invoke() and block_invoke().

� Cannot insert a block to a template programmatically.

C

6.) Which of the following is the correct way to get the current theme path in Drupal?

Answers:

� drupal_get_path()

� path_to_theme()

� theme_path()

� drupal_get_path() without the variables.

7.) Which of the following are best practices for scaling Drupal for a high traffic site?

Answers:

� Setting the page cache lifetime minimum to 1 minute

� Enabling CSS and JavaScript aggregation

� Sorting and filtering by CCK fields

� Using a PHP opcode cache

8.) hich of the following is not a desired way to create a custom page with custom layout in Drupal?

Answers:

� Using panels

� Using a .tpl.php file specificially for that page

� Build page with exact HTML structure you want

� None of above

9.) Which function can be used to invoke a hook in all enabled modules in Drupal?

Answers:

� module_invoke_all()

� module_invoke_hook()

� module_hook_invoke()

� hook_invoke_all()

10.) The following are advantages of using Drupal Views vs. custom module development EXCEPT:

Answers:

� Development speed – creating a View will be faster than creating a custom module most of the time

� Performance – Views offer increased performance over custom modules

� Maintenance – Views is a Drupal standard, as opposed to using custom modules, which gives your site’s maintenance an unnecessary learning curve

� Upgrading – Views provide an upgrade path to future versions of Drupal, which custom modules don’t provide out-of-the-box

11 .) ow can the taxonomy term pages be themed?

Answers:

� Creating two files named node-taxonomy.tpl.php and page-taxonomy-term.tpl.php for theming the taxonomy pages

� Adding CSS in the default style in the drupal theme

� Adding code to the template.php file

� Adding the CSS to the taxonomy pages 12.) hich of the following is the correct way to resolve the array_flip() error in Drupal which flips string and integer values?

Answers:

� Values of trans need to be string or integer values; if any other type is there, then a warning will be fired

� The array flip function can also flip the nested array also

� It should use array for the ID which are passed

� Pass only values in the string rather than the array itself

13.) What is the best way to display the plain HTML content of view's node using only one .tpl.php file for all views?

Answers:

� By using Ajax we can pull the data from the node, and using the convention mysite.com/node/1?ajax=1 to view the content

� By implementing both hook_preprocess_page and hook_preprocess_html

� By implementing hook_theme_registry_alter

� Placing a phptemplate_views_view_unformatted_VIEWNAME call in template.php

14.) How can the theme be changed in Drupal using a Drush command?

Answers:

� drush -l http://yoursitename.com/ pm-disable theme_name

� drush -l http://yoursitename.com/ pm-enable theme_name

� drush -l http://yoursitename.com/ vset theme_default theme_name

� drush ???l http://yoursitename.com/ settheme theme_name

15.) How can a Drupal site be taken offline or in maintenance mode using Drush?

Answers:


� drush vset site_offline 1

� drush vdel site_offline

� drush vset maintenance_mode 0

� drush setoffline 1


16.) Which software architectural pattern is Drupal most closely associated with?

Answers:

� PAC: Presentation-Abstraction-Control

� MVC: Model-View-Controller

� MVVM: Model-View-ViewModel

� SOA: Service-Oriented Architecture

17.) Which function can be used to attach images to a particular node at runtime?

Answers:

� node_save()

� node_insert_image()

� node_create()

� node_load()

18.) Which of the following is the correct way to remove core CSS files and add custom CSS files to a theme?

Answers:

� By using the drupal_get_css() & drupal_add_css() function

� By using the drupal_attach_css() & drupal_remove_css() function

� By placing the <style > tag in the theme, and placing an overwrite to all classes and IDs that need to be removed

� Core CSS files cannot be removed and custom CSS files cannot be added to a theme

19.) Which of following will have a negative effect on the performance of a Drupal website?

Answers:

� using cache

� using memcahe

� using APC

� using base theme

20.) Which of the following is the correct way to display recent nodes/posts created by a user on their profile page?

Answers:

� By using views module to create a block, and configuring a view to take an argument as user ID and set that block to show only on profile pages

� By enabling the node created by users options from the admin panel

� By installing & configuring the related posts module of drupal

� It is a default feature of Drupal to show recent posts created by the user on their profile




Upwork Drupal Test Answers August 2022 | Drupal Test Answers earnwithfs ( Q No 21 to Q No 40 ) 


21.) WhC
  
ich of the following will not change the value of a CCK field automatically as soon as the user creates a new node?

Answers:

� By using the Rules module and adding and configuring a new Triggered Rule.

� By installing the Computed Field module and creating a Computed Field as the changing field.

� By implementing the hook_nodeapi hook in a custom module.

� By implementing the hook_node_info hook in a custom module.

22.) Which of the following is the correct method to fire another process when a new node is created in Drupal?

Answers:

� Use hook_nodeapi and inside the insert handler add the code that you want to run after node creation. Code below: function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) switch ($op) case ‘insert’: // Add you code here break;

� Can do this in the node settings and add the code there.

� In the admin settings, add in the code that must be ran when the new node is done.

� B and C are correct.

23.) Which of the following is the correct way to control the maximum character length in views, while displaying field content?

Answers:

� Select “exclude from display” and use token values to display fields

� Select “Trim this field to a maximum length” and put the number of characters

� Select “rewrite output” and write a PHP function for the maximum length

� Use the maximum field formatter to restrict the character length


24.) require './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); 
$db_result = db_query('SELECT * FROM users');
while($user_object = db_fetch_object($db_result))
    // .. code here 


Which of the following statement(s) about the above code is/are true?

Answers:

� The code can be written in the theme template.php file to fetch all users

� The code won’t run correctly; drupal_bootstrap can’t run from an external script file

� The code can be used in a custom module script to fetch all users

� The code can be used in an external PHP file to fetch all users

25.) Which of the following is the correct way to install another Drupal that shares the same modules, themes, libraries and core code of an existing site, while using a new database?

Answers:

� By installing the Subdomain module and its required modules.

� By creating a new folder in the ‘sites’ folder with the new domain name as folder name. Then, copy the sites/default/default.settings.php file to the new folder. Run the install.php script from the browser afterwards.

� By adding the new site domain name as a key in the ‘$db_url’ associative array in the settings.php file.

� A single Drupal code base cannot be used to host multiple sites


26.) How can a new element that was created be validated, if hook_form_alter was used, and a new field was added to an existing form?

Answers:

� Using hook_validate

� Adding $form[‘#validate’][] and writing the validation function

� Using hook_check

� Such elements cannot be validated

27.) When sending email from Drupal, how can the default "From" address be changed?

Answers:

� By changing the Drupal admin settings’ Site Information page

� By changing it in the php.ini file

� By installing the SMTP module.

� By changing super user account’s email address (user/1); the super user’s email address will be used as the site-wide email authoring address.

28.) Having a taxonomy associated with a node type. Using which function would it be possible to load/get the vocabulary information in the code?

Answers:

� taxonomy_get_vocabularies

� taxonomy_vocabulary_load

� taxonomy_load_vocabularies

� taxonomy_vocabulary_get


29.) function special_registration_form_alter(&$form, $form_state, $form_id) 
 
  if ($form_id == 'user_register' && 'user' == arg(0) && 'register' == arg(1)) 
    // snipped alteration code
  


Which of the following statements about code above are true?

Answers:

� The code will alter the registration form for specific user types.

� The code alter the registration form for all instances of the user_register form.

� The code alter the registration form, but only when the user_register form appears on the ‘register/user’ page.

� The code will alter the registration form, but only when the user_register form appears on the ‘user/register’ page.

30.) What is the order in which template files (.tpl) will be displayed in a "view"?

Answers:

� Fields, Row style output, Style output, Display output

� Display output, Fields, Style output, Row style output

� Fields ,Row style output, Row style output, Display output

� Display output, Style output, Row style output, Fields


31.) Which of the following is the correct function to get the current theme of a Drupal site?

Answers:

� path_to_theme()

� drupal_get_path

� global $theme_path

� All of above

32.) How can a module's data be exposed to the Views 2 module using its API?

Answers:

� by using hook_views_data() & hook_views_api()

� by using the filefield_stats module

� by using the viewsmodule_stats module

� by using a built-in feature of the Views module, “expose filter”

33.) With the faceted search module it is possible to?

Answers:

� Use the meta data associated with node type to search the nodes

� Taxonomy terms can be used to filter the search result

� Build the search query on the fly by selecting different and multple meta data

� All of above

34.) What is the naming convention for a preprocessor function for the CCK fields in Drupal if the template called content-field-field_transmission_make_model.tpl?

Answers:

� yourThemeName_preprocess_content_field_value(&$variables)

� yourThemeName_preprocess_content_field(&$variables)

� yourThemeName_preprocess_content_field_field_tramission_make_model(&$variables)

� yourThemeName_preprocess_content_field_field_tramission_make_model()

35.) Which of the following is the correct way to include CSS and JavaScript files to a particular node in Drupal 6?

Answers:CLICK FOR FREE BTC👉


� By using the node preprocess function and adding the CSS and JavaScript files in the function

� By using the direct drupal function to add the CSS and JavaScript in the body section itself

� By using the drupal_get_css(); and drupal_get_js(); functions

� By creating particular page for that node and using CSS and JavaScript in that page only


36.) Which of the following is the correct way to get the page URL of a page in Drupal?

Answers:

� drupal_get_destination() is used to get the path.

� $link = url($path, array(‘absolute’ => TRUE));

� global $base_root; $base_root . request_uri();

� $current_url=”http://” .$_SERVER[‘HTTP_HOST’] .$_SERVER[‘REQUEST_URI’];

37.) Drupal.behaviors should be used instead of jQuery.ready. Which of the following statements are not a good reason for this recommendation?

Answers:

� Drupal.behaviors can be fired multiple times during page execution .

� Modules could override or extend existing Drupal.behaviors.

� Drupal.behaviors can be run whenever new DOM elements are inserted into the document.

� Drupal.behaviors increase jQuery performence.

38.) How can a Drupal user's password be reset using Drush from the command line in Drupal 6.x?

Answers:

� drush sqlq “update users set pass=md5(‘new_password_here’) where uid=1”

� drush user-password someuser –password=”new_password_here”

� Both A & B

� Cannot reset a user’s password using Drush from the command-line

39.) What is the best way to set up development for Drupal-based websites so that many developers can work on their own copy and before updating the master/central copy?

Answers:

� By using the Install Profile module

� By using the Features and Strongarm Module

� By using the svn:externals property

� By using the CCK and Views module

40.) How can an absolute date (as opposed to a relative date, or the current date) be set as the default value for a CCK datetime field in Drupal?

Answers:

� There is no option to set an absolute date as the default value in a CCK date field

� By using strtotime() in date field with exact date

� By using the date picker to select exact date

� By going to the configuration page of the CCK datetime module



Upwork Drupal Test Answers August 2022 | Drupal Test Answers earnwithfs ( Q No 41 to Q No 50 ) 


41.) Which of the following statements are true for the code below?
function custom_module_menu_alter(&$items) 
  $items['xyx/abc']['page callback'] = 'custom_module_showcontent';

Answers:

� The code adds a function which will be called upon requesting path xyx/abc.

� The code adds a function which will be called with function callback queue upon requesting xyx/abc.

� The code is adding a variable to menu path xyx/abc.

� The code is adding a variable to the variable queue of path xyx/abc.

42.) Which one of following makes use of the Features module in Drupal?

Answers:

� Migrating content from one Drupal website to another

� Exporting modules’ functionality in a single feature module

� Exporting website settings

� Backing up of website and database

43.) How can a Drupal site be brought out of maintenance mode?

Answers:

� By changing the $maintance_mode variable in the settings.php file to FALSE.

� By changing the “Site status” configuration in admin settings to “online”.

� By removing the maintenance-lock.php file from the root of the Drupal installation folder.

� By granting “access site” permissions to anonymous users.

44.) What is the best practice when adding a div with some text at the end of a page?

Answers:

� Use function drupal_add_js

� Use function drupal_add_html

� Modify your theme’s page.tpl file

� Modify your theme’s footer.php file

45.) Which of the following condition(s) is/are not suited for using custom Drupal nodes?

Answers:

� When implicit ‘ownership’ via author tracking is needed

� When categorization via taxonomy is needed

� When implicit tracking of creation/modification time is needed

� When high data integrity is needed



46.) How can custom CSS rules be added to a Drupal page (content) without using themes?

Answers:

� By using the drupal_add_css() function

� Using the <link> HTML tag

� Using the <style> HTML tag

� You cannot add custom CSS rules to Drupal pages

47.) Which of the following are ways to display SQL queries executed by a Drupal view?

Answers:

� By using the devel module

� By using the view_query_export module

� By using $view->build_info[‘query’]

� By using the views_get_current_view() function

48.) Which of the following is the best way to pass arguments to the drupal_get_form() function?

Answers:

� drupal_get_form(???custom1_default_form???,$arg1,$arg2)

� drupal_get_form(???custom1_default_form???, array(???arg1???=>???value???,???arg2???=>???value???))

� drupal_get_form(???custom1_default_form???,$arg1.$arg2)

� we cannot pass arguments to drupal_get_form core function

49.) Which of the following is the correct way to add a user's first and last name in Drupal?

Answers:

� By enabling Profile module. This module allows for fields to be added to users like first-name and last-name.

� Must enable the User Details module.

� Can not do this for Drupal users.

� A and B

50.) Each menu item has a key corresponding to a Drupal path being registered in hook_menu. Which of following is 
 not a key used to register a path in hook_menu()?

Answers:

� file

� file path

� tab_root

� rule




You have to wait 15 seconds.
Generating Code...

Post a Comment

Previous Post Next Post