When building a form I need an extra field so I can put an extra value such as a response rating for the question (not to do with weight or ordering of the questions) its that some questions carry different importance and in the backed the values are used in calculations

I not referring to question ordering/weight nor the users response to the question but an extra field were the admin can place a value against the question

I'm assuming it will be a hook_something()

Thanks

Comments

quicksketch’s picture

You can use hook_form_alter() on the 'webform_component_edit_form' form. Also take a look through webform.api.php, and the hook_webform_component_presave() hook in particular.

Custom coding requests are generally outside the realm of support in the Webform issue queue, so further questions around development probably won't be answered here.

vernond’s picture

You can add an extra component and tick the box at Private on component edit page. Components marked as Private are only displayed to users with Results access.

chaloum’s picture

thanks quicksketch

@Vernond the value isn't seen by user

vernond’s picture

@chaloum - You can mark the field as private and disabled (won't be seen by form user and is not changeable by folks with only results access), then populate it from your calculations during hook_webform_submission_presave(). I thought that may be easier than messing with form alter. If form alter works better for you, then go for it.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity.