question about perl functions

"Luca Notari" <[email protected]> Wed, 15 Mar 2006 12:05:32 +0100
Newsgroups gmane.comp.apache.mod-survey.general
Organization The Marketing Lab
Message-ID <[email protected]>
Hi all,
 
I have to do a particular randomized survey, multipage, in which each page
must contain only 1 question (with images, and with a particular layout);
 
I must randomize a block of 20 questions, and then continue the survey. All
these questions must be answered.
 
So, I think that instructions as RANDOMROUTE, RANDOM(survey tag),
SUBSET(survey tag) are not useful because:
 
RANDOMROUTE: I suppose that I cant control which page i come from, and count
the index of my page to learn if I finished my 20 question block or not;
RANDOM: This (I think) works only if I split for example the 20 questions
with 5 questions per page: but this is not my goal;
 
So, following an example by Joel (Interesting use of snippets, 2006/3/2),
I've tried to use perl snippet.
I've created an array with 20 elements, with the idea of using <ROUTE
CONTINUE={&... perl snippet 
in which I want to assign an array index element to tell where to go :
 
<ROUTE CONTINUE="{& print ("page".$myarray[0].".survey")&}"/>
 
Obiouvsly, I have to randomize such array.......
 
And this is my problem: using shuffle or rand() I experienced this message:

Document error

Security exception: 'rand' trapped by operation mask at (eval 83) line 7,
line 16. 

How can I solve problem?
 
 
thanks all,
Luca Notari
Le informazioni contenute in questa e-mail sono riservate e destinate
esclusivamente alla/e persona/e o all’ente/i sopra indicati. È vietato a
soggetti diversi da destinatari qualsiasi uso, copia, diffusione di quanto
in esso contenuto sia ai sensi dell’art.616 c.p., sia ai sensi della legge
196/03. Se questa comunicazione vi è pervenuta per errore, Vi preghiamo di
rinviarla al mittente e successivamente di cancellarla dal vostro sistema.

This e-mail (and any attachment/s) contains confidential and/or privileged
information. If you are not the intended recipient (or have received this
e-mail in error) please notify the sender immediately and destroy this
e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.