Check out the LimeSurvey source code on GitHub!

Iterate some questions

More
5 years 11 months ago #57811 by rafaom
I need to apply a questionnaire about families with several members. I'll ask questions to the members but some data will be asked about the family too. So, I have to ask those questions about the family just once, but then ask the ones about the members one by one. How can I repeat just some questions of the questionnaire and keep the answers of the other questions?

Please Log in to join the conversation.

More
5 years 11 months ago #57823 by tpartner
Create several groups off the member questions. Ask how many family members the respondent has and then use conditions to show the appropriate number of member groups.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 11 months ago #57845 by rafaom

tpartner wrote: Create several groups off the member questions. Ask how many family members the respondent has and then use conditions to show the appropriate number of member groups.


Sorry, I didn't understand. conditions only work for hiding/showing individual questions (or am I wrong?), but I don't know how to use them to show/hide question groups. Could you be more specific, please? Thanks for yor answer.

Please Log in to join the conversation.

More
5 years 11 months ago #57846 by tpartner
If all questions in a group are hidden by conditions, the group will be hidden.

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: rafaom, jonsen

Please Log in to join the conversation.

More
5 years 11 months ago #57848 by rafaom
Ok, I understand. But I think this is not actually what I need. I mean, I need not only hide some questions, but keep some answers (v.gr. address, phone number, etc.) that are common to all family members, and repeat a group of questions as much as family members there are (name, age, sex, etc).

Please Log in to join the conversation.

More
5 years 11 months ago #57852 by tpartner
Like this:

GROUP 1
- address
- phone number
- email
- other family specific question
- number of family members

GROUP 2
- relationship
- name
- age
- gender
- other family member specific question

GROUP 3
- relationship
- name
- age
- gender
- other family member specific question

GROUP 4
- relationship
- name
- age
- gender
- other family member specific question

GROUP 5...

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: rafaom, jonsen

Please Log in to join the conversation.

More
5 years 11 months ago #57857 by rafaom
Thanks a lot! This is the answer I was looking for.

Please Log in to join the conversation.

More
5 years 10 months ago - 5 years 10 months ago #59558 by jonsen
I also thank you for this!

I have two questions extending rafaom's:

1) There can be up to a hundred people in my example (a single person reporting about a larger group of people). Is there a way to automise this? Otherwise I would just copy the groups in XML (btw: is there a better way to make a hundred identic groups?), but that would be just ugly.

2) To identify each individual, their name shall show up in the question. To do that, I would like to have a variable in the id of a replacement field. For example: If the current person is person 36, can I show {INSERTANS:92731X2016X14971name_first36}? The names are all entered in one question in the group before.

I do know quite a bit of php, and I would also like to contribute to LimeSurvey. So if it takes some programming to accomplish this, I would be happy to do so (if I am able).

Greets
jonsen

[EDIT] regarding question 2: Could I replace the question div (<div id="questionXYZ">) empty and just fill it with javascript?

[EDIT 2] 3) As the number of people can be as low as _one_, can I only ask for one name in this case, and for 17 if there are 17?

Example:
Question 1: How many doctoral candidates do you have in your department?
Question 2: What are the names of the candidates?
Question 3: Has {person_XYZ_name_first} published any article in a journal regarding the field of physics?


I AM WILLING TO MOVE ANY OF THESE QUESTIONS TO A NEW TOPIC, please tell me if you think that's neccessary.
Last Edit: 5 years 10 months ago by jonsen. Reason: adding queries

Please Log in to join the conversation.

More
5 years 10 months ago #59608 by jonsen
Sorry if I extended this topic a bit too far. I would be very glad to have a solution to ANY of the three questions, or JUST A HINT of where to look. I have been browsing through the forum and related sites, but could not find what I needed...

Nevertheless: Thanks everyone, this forum is great!!

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form