Welcome to the LimeSurvey Community Forum

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

Is it possible to alter the "Always hide this question" attribute via the API?

  • bruce78
  • bruce78's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 9 months ago #156195 by bruce78
I am thinking about exploring the LimeSurvey API. The API use case I have in mind is...
  • to create a copy of a survey
  • to then alter the the "Always hide this question" attribute of 2 or 3 questions on a case by case basis
  • to then activate the survey to collect responses

Is this possible?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 9 months ago - 6 years 9 months ago #156204 by tpartner
I have not tested but I would say "probably". You can use the set_question_properties() method to adjust a question - probably the easiest way to find out what the $aQuestionData requires is to use the get_question_properties() method on an existing question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 9 months ago by tpartner.
The topic has been locked.
  • bruce78
  • bruce78's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 9 months ago #156206 by bruce78
Cool, thanks Tony...

I was also thinking that this could be done by editing the question via the lime_question_attributes table.

Once you know the qid, it seems that you just need to add a 'hidden' entry in the 'attribute' column... does that also sound possible to you as another way to achieve the same outcome?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 9 months ago #156215 by tpartner
Sure, I suppose you could modify the database values directly - that's what the API does for you.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • bruce78
  • bruce78's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 9 months ago #156222 by bruce78
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose