"Random" function in Squiffy ?
Thierry
19 Oct 2015, 18:19When I work with Quest, I often use the "random" function of the text processor, which is really simple. For example :
{random:answer 1:answer 2:answer 3}
How can I get the same thing in Squiffy ? I tried a lot of things, but nothing worked
Thanks for your help !
{random:answer 1:answer 2:answer 3}
How can I get the same thing in Squiffy ? I tried a lot of things, but nothing worked
![Sad :(](/phpbb-smilies/icon_sad.gif)
Thanks for your help !
truestories
28 Oct 2015, 15:29I don't think you can do this natively, but Javascript does the trick:
etc..
var rnd = Math.ceil(Math.random() * 3); // random number between 1 and 3
squiffy.set("rnd",rnd);
{ if rnd=1: answer 1 }
{ if rnd=2: answer 2 }
etc..
Thierry
28 Oct 2015, 17:15Thank you very much !!