Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Random Question

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago - 8 years 4 months ago #129331 by DenisChenu
Replied by DenisChenu on topic Random Question

holch wrote: ...
Denis suggested that an alternative would be to put the rand() question in a different group on a different page and this doesn't work (only if you use is_empty, etc., but as I said, when using this you don't need a different group or different page).

Are you sure ?

It's a system i use before. If it don't work with actual version : it's a regression.

Equation are filled only when :
- Before Shown (before show the page)
- During shown (javascript update in the page)
- After Shown (when subliut the page)

If it's in a previous group (for example : only this hidden question in this group : it luts have a fixed var "After shown"

Denis
PS: Seems to work:
- demonstration.sondages.pro/912442
- But LS core have an issue with : 1st group 'hidden' + hide welcome page + Show previous. Difficult to manage here, but can have a solution

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.
Last edit: 8 years 4 months ago by DenisChenu. Reason: Seems to work
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129342 by holch
Replied by holch on topic Random Question
Hmmm, strange. For me it did not work yesterday. Will have a look at it again so we can leave "clean" recommendations here.

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129344 by holch
Replied by holch on topic Random Question
I am experimenting and the difference seems to be in using "questioncode.NOAK" or just "questioncode", but I haven't found out exactly how.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129349 by DenisChenu
Replied by DenisChenu on topic Random Question
Hi Holch,

Strange, because in the test survey i use RANDOM==1 directly for relevance.

RANDOM is always shown, then no issue.

I add some information forNAOK on manual : manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
But this surely can be improved.

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129350 by holch
Replied by holch on topic Random Question
By the way: I also don't understand how your code generates the final output shown in the question either. I need a little bit more time to test and check.

What I had done:

Group 1: one question "Q1" with {rand(1,5)} in it.
Group 2: One text display with {Q1} in it. Somehow the numbers shown in both questions can differ.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129352 by DenisChenu
Replied by DenisChenu on topic Random Question
Group 1 : one question RANDOM: equation question : equation set to {rand(1,5)}

Group 2+3+4 : 4 question near same expet for the code:
Q1: condition RANDOM==1
Q2: condition RANDOM==2
Q3: condition RANDOM==3
Q4: condition RANDOM==4

Look at the logic file ;)

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129353 by holch
Replied by holch on topic Random Question
Ohhhh man! I thought the "Random==1" code was generated by a code, but it is basically hardcoded.

I will have a closer look at this when I have a little more time.

I think the problem is that I display the result of question Q1 with {Q1} in the question text. That seems to force the random function to be triggered again. But I will investigate a little further.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129355 by DenisChenu
Replied by DenisChenu on topic Random Question
Maybe because i added it in Group description ?

Random number his : {RANDOM}


?

Must give a try ading it in all question text (but still sure it worked before).

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