Welcome to the LimeSurvey Community Forum

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

Default mandatory question

  • wilmslow3
  • wilmslow3's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 2 months ago #116083 by wilmslow3
Default mandatory question was created by wilmslow3
Is there a way to make every question in a survey Mandatory by default. It is rare that we will conduct a survey with any of the questiosn non-mandatory...

I presume there is some settings in a config file hidden away during the install?
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 2 months ago #116089 by Mazi
Replied by Mazi on topic Default mandatory question
Unfortunately such a setting doesn't exist. The easiest way would be to add all questions and then run a DB update to set the appropriate flag for all questions of survey XYZ.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: wilmslow3
The topic has been locked.
  • wilmslow3
  • wilmslow3's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 2 months ago #116147 by wilmslow3
Replied by wilmslow3 on topic Default mandatory question
Thanks Mazi, I may try to see if I can run some PHP when the the question is created that updates the flag at the time you create the question.
The topic has been locked.
More
9 years 2 months ago #116148 by Ben_V
Replied by Ben_V on topic Default mandatory question
Have a look to:
/application/controllers/admin/question.php

Search (around line #770):
Code:
$eqrow['mandatory'] = 'N';

and switch 'N' to 'Y'

Obviously this change may be overwritten by any LS major update...

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: wilmslow3
The topic has been locked.
  • wilmslow3
  • wilmslow3's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 2 months ago #116149 by wilmslow3
Replied by wilmslow3 on topic Default mandatory question
Thanks Ben, thats exactly the kind of hack I was after :-)
The topic has been locked.
More
9 years 2 months ago #116150 by Ben_V
Replied by Ben_V on topic Default mandatory question

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 2 months ago #116151 by Mazi
Replied by Mazi on topic Default mandatory question

wilmslow3 wrote: Thanks Mazi, I may try to see if I can run some PHP when the the question is created that updates the flag at the time you create the question.

You may even be able to automate this without additional coding by creating a trigger at the DB.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
5 years 1 month ago #179963 by marcgold
Replied by marcgold on topic Default mandatory question
This Hack has been extremely useful until Release 3.15.8. It would seem that the code for this is now at line 1280 in the /applications/controllers/admin/questions.php.

Although when you start a new question on screen the mandatory switch is set to "Yes", when you save the question it saves as Mandatory = "No"

Anybody have an idea how to change this.

Marc
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose