Welcome to the LimeSurvey Community Forum

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

Add subquestions with remote control

  • lakfel
  • lakfel's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago - 2 years 5 months ago #221951 by lakfel
Add subquestions with remote control was created by lakfel
I saw this in an old post with no real answer nad the post is locked.
I would like to know if there is a way to use the API for adding subquestions from my python or VBA program? I know there is a function to add a whole question but not for subquestions? Or if there is a way to develop and insert the required functions for it in the cloud LimeSurvey platform?
Last edit: 2 years 5 months ago by lakfel.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221976 by holch
Replied by holch on topic Add subquestions with remote control
If you can add whole questions via the API, why not just substitute the whole question with a new one including the new sub question?

Or are you trying to add subquestions while the survey is active? This should not work, because while the survey is active, you can't add/change anything in a survey which will impact the database structure.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • lakfel
  • lakfel's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #221979 by lakfel
Replied by lakfel on topic Add subquestions with remote control
What I see from LimeSurvey RemoteControl 2 website api.limesurvey.org/classes/remotecontrol...thod_import_question is that I can import a question having the lsq file, but I do not see more friendly functions to add a question and its subquestions? Like given the SID and the text of the question + type I provide, create the questions?

Or, there is any manual or instructions of the basic structure of the lsq file so I can create one automatically to use the import method?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221980 by holch
Replied by holch on topic Add subquestions with remote control

Or, there is any manual or instructions of the basic structure of the lsq file so I can create one automatically to use the import method?


I am not aware of a specific page in the manual about LSQ files. But these are simple XML files, exporting one and reverse engineering shouldn't be too difficult.

Let's see if someone with more knowledge about the API has a better idea.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • lakfel
  • lakfel's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #221981 by lakfel
Replied by lakfel on topic Add subquestions with remote control
I took a look to the XML file and it should not be a problem, It would be nice to save time if there is a sort of guideline already done.
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 5 months ago #222012 by tammo
Replied by tammo on topic Add subquestions with remote control
Hi Lakfel, this is an open source project, maintained by users of the software.

Please add the instruction that you hoped to find at: manual.limesurvey.org/RemoteControl_2_API or at a page where you would have hoped to find it. That way you contribute to this community and you save the next user that us searching for this solution some time.

Thanks in advance from the whole community!


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • lakfel
  • lakfel's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #222045 by lakfel
Replied by lakfel on topic Add subquestions with remote control
Hi tammo, thanks for your answer.

I have worked in the past with the on-premise version that allowed me to manipulate directly the DB. Not pretending that here (security issues of course), but having the DB structure in mind It would be nice to be able to automatize as many tasks you do by hand in the platform as possible by having get/set/add/remove functions for the different items in a survey. I mean something like:

For groups
- getAllGroups(sid), getGroup(sid,gid), addGroup(sid, ...params), setGroup(sid,gid, ...params), removeGroup(sid,gid)

For questions and subquestions (in DB they are treated equally)
- getAllQuestions(sid,gid), getQuestion(sid,gid,qid), addQuestion(sid,gid,parent_qid, ...params), setQuestion(sid,gid,qid, ...params), removeQuestion(sid,gid,qid)

For answer options
- getAnswers(sid,gid,qid), addAnswer(sid,gid,qid, ...params), setAnswer(qid,code,...params), removeAnswer(qid,code)

Looking forward to seeing new updates and contributing if possible!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose