- Posts: 13
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Add subquestions with remote control
- lakfel
- Topic Author
- Offline
- New Member
Less
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?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11645
- Thank you received: 2739
2 years 5 months ago #221976
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
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.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
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?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11645
- Thank you received: 2739
2 years 5 months ago #221980
by holch
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.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
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
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 966
- Thank you received: 219
2 years 5 months ago #222012
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
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!
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
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!
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.