From free format with random list members resorted into correct brands

Hi all ... this is what I'm trying to do:

Brand list containing ~ 100 brands. Each person see 40 (randomly selected). These 40 are shown using a free format question with radio buttons (so Q1_r1 will have a label [%listvalue(Q1Ask,1)%] and will have an answer from 1 to 4, but the label could be any one of the 100 brands in the list. Obviously, analysing this is painful and knowing how many times (on the fly) each brand has been shown is not possible.

So this was my solution (not pretty, but it does work):
I set up 100 constructed lists (Brand1 to Brand100) and used perl to determine which row (if any) within the free format question held data for that brand and recorded the value the respondent gave it. I then set up another free format question to "call" each of these lists (so that they would set correctly). As I say, this works - it means that if the label for Q1_r1 is showing brand48, the result from Q1_r1 is stored in the list Brand48. It means I just export the second free format question and all is well. And I can tell through the admin module how many times Brand48 has been shown.

My problem is that there is so much perl that the survey appears to freeze as it works it all out. Can take a minute or so - far too long. I have the perl for each list in a loop, so in terms of lines it's not very long but there's still too much to do, obviously.

Can anyone enlighten me with a more elegant/less resource hungry way of achieving the same thing?

Resolved
16 replies