Welcome, Guest
Username: Password: Remember me

TOPIC: Randomisation devices: Differences and suitability

Randomisation devices: Differences and suitability 1 year 10 months ago #86327

  • borja
  • borja's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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
The administrator has disabled public write access.

Re: Randomisation devices: Differences and suitability 1 year 10 months ago #86331

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Randomisation devices: Differences and suitability 1 year 10 months ago #86351

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
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))
The administrator has disabled public write access.

Re: Randomisation devices: Differences and suitability 1 year 10 months ago #86393

  • borja
  • borja's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Thanks very much for your reply TMSWhite, and Mazi for pointing out the issue.
Last Edit: 1 year 10 months ago by borja.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.238 seconds
Donation Image