Check out the LimeSurvey source code on GitHub!

Randomisation devices: Differences and suitability

More
4 years 3 months ago #86327 by borja
Hello,

Can someone explain to me why in the sample survey "Randomly Ask One Question Per Group" the expression used is floor"(rand(1, X))" instead of simply "rand (1,X)," what is the difference and why the first option is preferable as a device which randomly selects an integer within a range of two integers? (I assume that is preferred because is feautured in this example, which is part of the limesurvey manual)

Thank you very much.

Borja

Please Log in to join the conversation.

More
4 years 3 months ago #86331 by Mazi
I have pointed our Expression Manager expert to this thread, he should be able to help.

Link to the test survey Borja mentioned: docs.limesurvey.org/Expression+Manager+S...e_Question_Per_Group


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
4 years 3 months ago #86351 by TMSWhite
Borja-

That example was created when I expected that rand(x,y) would create a double precision number between x and y. Since rand() in PHP generates and integer, we standardized on that, but never updated the example.

So, the example should read:
if(ask>=1,ask,rand(1,6))

Please Log in to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #86393 by borja
Thanks very much for your reply TMSWhite, and Mazi for pointing out the issue.
Last Edit: 4 years 3 months ago by borja.

Please Log in to join the conversation.

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