- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can I get Question ID in my returned responses object ?
- Bromatello
- Topic Author
- Offline
- New Member
Less
More
4 years 4 months ago #190875
by Bromatello
Can I get Question ID in my returned responses object ? was created by Bromatello
Hi there,
I'm using the ExportResponsesPopulated Method and populate an ExportResponsesFull object to get all the responses from a particular survey.
The finest grain of this object is "Question" and "Answer".
The Question is the "Code" field from the Survey Question object.
Do you know if there is any way to get the Question ID itself from the response object ?
One of our surveys was set up incorrectly and has the same Code for 2 questions.
e.g.
Question ID : 4031
Code : Big Black Bag
Group : Q24
Question ID : 18809
Code: Big Black Bag
Group : Q20
The problem comes when we try to link the Answer object
Question : Big Black Bag
Answer : Yes
We can't distinguish between the 2 possible questions it could be the answer to.
Is there any way you can think of to overcome this ? The data is already live and captured.
Thanks in advance !
I'm using the ExportResponsesPopulated Method and populate an ExportResponsesFull object to get all the responses from a particular survey.
The finest grain of this object is "Question" and "Answer".
The Question is the "Code" field from the Survey Question object.
Do you know if there is any way to get the Question ID itself from the response object ?
One of our surveys was set up incorrectly and has the same Code for 2 questions.
e.g.
Question ID : 4031
Code : Big Black Bag
Group : Q24
Question ID : 18809
Code: Big Black Bag
Group : Q20
The problem comes when we try to link the Answer object
Question : Big Black Bag
Answer : Yes
We can't distinguish between the 2 possible questions it could be the answer to.
Is there any way you can think of to overcome this ? The data is already live and captured.
Thanks in advance !
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
4 years 4 months ago #190887
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 Can I get Question ID in my returned responses object ?
The code for a question can never be "Big Black Bag", because there are no spaces allowed in the question code, also Limesurvey will not allow two questions with the same question code. So there is something really strange going on in your survey, if you really have the question code "Big Black Bag" twice.
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.
- Bromatello
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
4 years 4 months ago #190888
by Bromatello
Replied by Bromatello on topic Can I get Question ID in my returned responses object ?
Sorry, I was just using that as an example.
The actual code is Audi.
And it is in there twice. I didn’t think it was possible either, as it auto generates a code usually.
So the question still remains, can I get the question id?
Any idea ?
Thanks
The actual code is Audi.
And it is in there twice. I didn’t think it was possible either, as it auto generates a code usually.
So the question still remains, can I get the question id?
Any idea ?
Thanks
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
4 years 4 months ago #190889
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 Can I get Question ID in my returned responses object ?
As I said, there IS NO WAY Limesurvey will allow you to have the same question code twice. Also, the question code is NEVER autogenerated. So I fear we are talking about different things here.
Could you show a screenshot of one of these questions? Whenever I make the mistake to give a question the same code, it will give me an error message. So my guess is, you are not talking about the question code, but something else...
Could you show a screenshot of one of these questions? Whenever I make the mistake to give a question the same code, it will give me an error message. So my guess is, you are not talking about the question code, but something else...
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
4 years 4 months ago #190903
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Can I get Question ID in my returned responses object ?
Where did you find the "ExportResponsesPopulated" method? I don't see that anywhere.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 4 months ago #190937
by DenisChenu
Seems you use your own code , not published … then …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Can I get Question ID in my returned responses object ?
+1tpartner wrote: Where did you find the "ExportResponsesPopulated" method? I don't see that anywhere.
Seems you use your own code , not published … then …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- Bromatello
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
4 years 4 months ago #190957
by Bromatello
Replied by Bromatello on topic Can I get Question ID in my returned responses object ?
Hi ,
Thanks for all your replies so far, it's very kind of you to look for me.
Here's two screenshots attached. One is the Question codes in the lime survey application, and one is the responses returned from the API.
Basically, for several questions groups, the Code was "Audi". I've manually changed some to be Audi2, Audi3 etc, and the system has auto generated codes ( "r170q1", "r173q0", etc ) for questions that have the same name. This is when you import a file to add the options for a question.
As you can see, there are 2 codes called "Audi".
Now, this would be okay if I could retrieve the Question ID when I call the API.
But as you can see from the second image I uploaded, the API only returns the question code and the answer.
What I'd like to see is the Question ID, so I can tie it back to the original Question.
Does that make sense ?
Thanks in advance !
Thanks for all your replies so far, it's very kind of you to look for me.
Here's two screenshots attached. One is the Question codes in the lime survey application, and one is the responses returned from the API.
Basically, for several questions groups, the Code was "Audi". I've manually changed some to be Audi2, Audi3 etc, and the system has auto generated codes ( "r170q1", "r173q0", etc ) for questions that have the same name. This is when you import a file to add the options for a question.
As you can see, there are 2 codes called "Audi".
Now, this would be okay if I could retrieve the Question ID when I call the API.
But as you can see from the second image I uploaded, the API only returns the question code and the answer.
What I'd like to see is the Question ID, so I can tie it back to the original Question.
Does that make sense ?
Thanks in advance !
Attachments:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
4 years 4 months ago #190960
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 Can I get Question ID in my returned responses object ?
How on earth did he get two identical question codes into one survey??
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.
- Bromatello
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
4 years 4 months ago #190961
by Bromatello
Replied by Bromatello on topic Can I get Question ID in my returned responses object ?
"How on earth did he get two identical question codes into one survey??"
I know !?!
I didn't set the survey up, I'm building an API to process the data pulled back from the LS API.
But that code is there and Live, so it can't be undone.
I can see the Question ID in the Lime Survey Application Database, but I'd prefer to get it from a proper API call.
thanks again !
I know !?!
I didn't set the survey up, I'm building an API to process the data pulled back from the LS API.
But that code is there and Live, so it can't be undone.
I can see the Question ID in the Lime Survey Application Database, but I'd prefer to get it from a proper API call.
thanks again !
The topic has been locked.