Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LS5 - Set all new questions to mandatory

  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #233787 by marcgold
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.4.10
Own server or LimeSurvey hosting: Own Server
Survey theme/template: Fruity
==================
We used to do this in LS3*  easily by modifying the questions.php file so that all questions on creation were mandatory.   
Having looked through the code in LS5 this seems very different.   I have found i now have the ability to bulk change this in the questions list - nice!

But on the basis 99.9% of all the questions we add are mandatory,  it would be nice to be able to change this to the default even if i have to reapply each time there is an update / overwrite

Can anyone point me in the direction of which file/s need to be amended to make default 'mandatory' == 'Y'   or is there a way I can set this in the config.php  

Thanks in advance

Marc

Please Log in to join the conversation.

More
2 years 2 months ago #233799 by jelo
Replied by jelo on topic LS5 - Set all new questions to mandatory
I recommend to open a feature request as well.
Or do you modify the code after every update or stopped updating LS?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #233811 by marcgold
Replied by marcgold on topic LS5 - Set all new questions to mandatory
Thank you, I have added the feature request. I think this could be useful for others too.

Yes, we edited the coded everytime we saw that file was overwritten. It was pretty simple as it was only in one file and a very minor change.
Doesn't seem to be the same way in LS5, I would happily run the same process if I could only find it

Please Log in to join the conversation.

  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #233989 by marcgold
Replied by marcgold on topic LS5 - Set all new questions to mandatory
Found the answer / location of where and what to change.

To Set the default for all new questions to Mandatory = Y

Edit the Following file:
/application/models/QuestionCreate.php

Around line 43 Change: 
Code:
 'mandatory' => 'N',
TO:
Code:
 'mandatory' => 'Y',

Or to S if you wish to set them as Soft.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose