projects / org / ezproject2010 / ezsurvey_ezp4 / forum / general / single/multiple choice alwa...
Find the Exponential Software extensions you want
You need to be logged in to post messages in the forums. New users may register here.
Member since: Posts: 10 |
Tuesday 14 July 2009 10:38:55 am I don't see an option to set the "mandatory" status of a single/multiple choice survey question - it seems to be always set to mandatory = 1. Is there a way to set this in the admin?
Also, the logic in the view template for a single/multiple choice question is using the "num" attribute of the $question object to determine whether or not to display an asterisk next to the question - shouldn't it be using the mandatory attribute? Thank you. Technical Project Manager & Content Management Expert |
|
Member since: Posts: 35 |
Wednesday 15 July 2009 6:43:29 am Hi,
I think this is because of historic reasons for how single/multiple choice was working in the first version as well. The question is required if you add a choice with radio buttons. Then you need to select one of the choices. For the checkboxes you can either choose none, all of them or some, so in this case it will not be mandatory. For a select-list, you'll allways have a choice. The type of question is stored in the num attribute, which is why the asterix is controlled by this value. Cheers, Bjørn |
|
Member since: Posts: 10 |
Thursday 16 July 2009 9:03:04 am Thanks, Bjorn.
If people are curious, I updated the code on my installation to allow the user to make single/multiple choice questions mandatory. In extension/ezsurvey/design/standard/templates/survey/view/multiplechoice.tpl: I replaced {switch match=$question.num}{case match=1}<strong class="required">*</strong>{/case}{case match=2}*{/case}{/switch} with {section show=$question.mandatory}<strong class="required">*</strong>{/section} In extension/ezsurvey/design/standard/templates/survey/edit/multiplechoice.tpl: I added <div class="block">if ( !$http->hasPostVariable( $postSurveyAnswer ) andif ( !$http->hasPostVariable( $postSurveyAnswer ) and Technical Project Manager & Content Management Expert |
You need to be logged in to post messages in the forums. New users may register here.