Re: again MATRIX session problems
Joel Palmius <[email protected]> Mon, 4 Feb 2008 14:19:20 +0100 (CET)
| Newsgroups | gmane.comp.apache.mod-survey.general |
|---|---|
| Message-ID | <[email protected]> |
Yeah, you're right. There's something fishy in the MATRIX code. I've run
into problems with it myself when writing a survey the last week.
I'm sitting with it now and trying to figure out what's wrong. Hope to
have a new -pre release out the next few days.
// Joel
On Sun, 3 Feb 2008, Luca Notari wrote:
> Hi all,
>
> regarding the problem with MATRIX and MULTI option (but I've experienced
> the same problem using html code <input type=checkbox> in a CUSTOM tag)
> I can't solve the problem to
> reset the session value if I come back in a multipage survey and
> un-check a previous checked box. The result is that the related session
> value keep the value if the box is checked, but ignores if this has been
> un-checked
>
>
> Here below what Joel says few time ago (november 21 2007)
>
> ....
> adding a perl
>
> snippet in the page after the matrix and clear values from the session
> if
>
> they are not in the argument string.
>
>
>
> I've tried a lot, with 2 pages test survey, with this instructions:
>
> first page:
>
> <MATRIX NAME="Q1" CAPTION="choose" MULTI="yes">
> <MATRIXCOLUMN CAPTION=" " VALUE="1" />
> <MATRIXROW CAPTION="first" VALUE="1" />
> <MATRIXROW CAPTION="second" VALUE="2" />
> <MATRIXROW CAPTION="third" VALUE="3" />
> </MATRIX>
>
> {&
> $q101=$argument->ArgByName("Q101") || "novalue";
> $q102=$argument->ArgByName("Q102") || "novalue";
> $q103=$argument->ArgByName("Q103") || "novalue";
> if($q101 eq "novalue"){$session->setValue("SUBMITTED_Q101",-1);}
> if($q102 eq "novalue"){$session->setValue("SUBMITTED_Q102",-1);}
> if($q103 eq "novalue"){$session->setValue("SUBMITTED_Q103",-1);}
> &}
>
> and also with:
>
> if (!$argument->ArgByName("Q101")
> ){$session->setValue("SUBMITTED_Q101",-1);}
> if (!$argument->ArgByName("Q102")
> ){$session->setValue("SUBMITTED_Q102",-1);}
> if (!$argument->ArgByName("Q103")
> ){$session->setValue("SUBMITTED_Q103",-1);}
> and a route to a second page in which I've tried to print session
> values,
>
> but with no results;
>
> I can't understand closely the survey logic, even if I print
> $argument->ArgByName("Q101"), with the relative box un-checked, but
> previously checked, the results is that it is checked!
>
> How can I use the checkbox instructions?
>
>
Skickat av Joel Palmius <[email protected]>
till survey-discussion