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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 1 week ago #78922 by tpartner
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?

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
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 1 week ago #78924 by TMSWhite
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 1 week ago #78928 by tpartner
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.

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
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 1 week ago #78949 by TMSWhite
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.
The topic has been locked.
More
10 years 2 months ago - 10 years 2 months ago #105323 by javimontano
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
Last edit: 10 years 2 months ago by javimontano. Reason: Did not explain my issue well :(
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #105341 by DenisChenu
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

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.

Lime-years ahead

Online-surveys for every purse and purpose