Add subquestions with remote control

More
2 months 1 week ago - 2 months 1 week ago #221951 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 months 1 week ago by lakfel.

Please Log in to join the conversation.

More
2 months 6 days ago #221976 by holch
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.

Please Log in to join the conversation.

More
2 months 6 days ago #221979 by lakfel
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?

Please Log in to join the conversation.

More
2 months 6 days ago #221980 by holch

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.

Please Log in to join the conversation.

More
2 months 6 days ago #221981 by lakfel
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.

Please Log in to join the conversation.

  • tammo
  • tammo's Avatar
  • Away
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
  • User support
More
2 months 5 days ago #222012 by tammo
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

Please Log in to join the conversation.

More
2 months 3 days ago #222045 by lakfel
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!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now