- Posts: 10113
- Thank you received: 3595
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Just show one question from randomized group, hide the others
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
12 years 1 week ago #78922
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 Just show one question from randomized group, hide the others
The firing of checkconditions() was always required for dynamic conditions on a page.
Tom, are you saying that if checkconditions() is not called, the value of an input field that was modified by JavaScript will not be detected when the form submits (the "Next" button is clicked) for use in conditions on subsequent pages?
Tom, are you saying that if checkconditions() is not called, the value of an input field that was modified by JavaScript will not be detected when the form submits (the "Next" button is clicked) for use in conditions on subsequent pages?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- TMSWhite
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 44
- Thank you received: 15
12 years 1 week ago #78924
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Just show one question from randomized group, hide the others
As long as the proper javascript variable has its value set, the value will be submitted when the user clicks "next". In the example below, the user set the $('#answerSGQA") variable, which is the widget that lets the user see the value, but it is the $('#javaSGQA') variable that is typically the one submitted. checkconditions() not only triggers the conditional logic, but also tends to populate the $('#javaSGQA') variable if passed the value from the $('#answerSGQA') value.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
12 years 1 week ago #78928
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 Just show one question from randomized group, hide the others
Hmm, I don't see any $('#javaSGQA') element for text inputs.
Regardless, in my opinion, if a visible form element (text input, radio, checkbox, ...) is modified by JavaScript it should be detected on submit as it was in the past.
There may be many people running surveys with custom scripts expecting this behaviour.
Regardless, in my opinion, if a visible form element (text input, radio, checkbox, ...) is modified by JavaScript it should be detected on submit as it was in the past.
There may be many people running surveys with custom scripts expecting this behaviour.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- TMSWhite
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 44
- Thank you received: 15
12 years 1 week ago #78949
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Just show one question from randomized group, hide the others
Tony-
I just checked all of the question types. The name="SGQA" attribute is always associated with the visual input element (which is usually an id="answerSGQA" code). So, the example in this thread (which changes $('#answerSGQA')) WILL submit the value.
However, EM uses the hidden $('#javaSGQA') variable to process conditions. So, if people change an $('#answerSGQA') value but don't call checkconditions(), the downstream conditions processing won't happen.
So, people's JavaScript should continue to work as expected.
I just checked all of the question types. The name="SGQA" attribute is always associated with the visual input element (which is usually an id="answerSGQA" code). So, the example in this thread (which changes $('#answerSGQA')) WILL submit the value.
However, EM uses the hidden $('#javaSGQA') variable to process conditions. So, if people change an $('#answerSGQA') value but don't call checkconditions(), the downstream conditions processing won't happen.
So, people's JavaScript should continue to work as expected.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
The topic has been locked.
- javimontano
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
10 years 2 months ago - 10 years 2 months ago #105323
by javimontano
Replied by javimontano on topic Just show one question from randomized group, hide the others
Awesome solutions!
Now I'm wondering: Let's say, I want to recycle my questions?
Let's say I want to use a pool of questions 2 times, in two different groups of questions (Q1, and Q2), I have the same ask# questions in each group.
I want to get different ones each time, I think I would have to check that the random generation of numbers, so I don't use the same number in my ask1, and ask2 questions in my poll. Up to them, I was find, but I've tried many times with the if function, but I can't get the work done
Can any one help me?
Thanks in advance
Now I'm wondering: Let's say, I want to recycle my questions?
Let's say I want to use a pool of questions 2 times, in two different groups of questions (Q1, and Q2), I have the same ask# questions in each group.
I want to get different ones each time, I think I would have to check that the random generation of numbers, so I don't use the same number in my ask1, and ask2 questions in my poll. Up to them, I was find, but I've tried many times with the if function, but I can't get the work done
Can any one help me?
Thanks in advance
Last edit: 10 years 2 months ago by javimontano. Reason: Did not explain my issue well :(
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13667
- Thank you received: 2496
10 years 2 months ago #105341
by DenisChenu
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 Just show one question from randomized group, hide the others
Hi,
No, if you want user see 2 question, you need 2 question in your survey.
Here you can have this:
- First question : Équation : {RAND(1,2)}
- Q1+Q1b : Relevance equation: RAND==1
- Q2+Q2b : Relevance equation: RAND==2
Denis
No, if you want user see 2 question, you need 2 question in your survey.
Here you can have this:
- First question : Équation : {RAND(1,2)}
- Q1+Q1b : Relevance equation: RAND==1
- Q2+Q2b : Relevance equation: RAND==2
Denis
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.