again MATRIX session problems

"Luca Notari" <[email protected]> Sun, 3 Feb 2008 23:28:16 +0100
Newsgroups gmane.comp.apache.mod-survey.general
Message-ID <000001c866b4$11ffc3a0$0500a8c0@asus01>
This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C866BC.73C42BA0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

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? 


------=_NextPart_000_0001_01C866BC.73C42BA0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Messaggio</TITLE>

<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>Hi=20
all,</FONT></SPAN></DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial =
size=3D2>regarding the=20
problem with MATRIX and MULTI option (but I've experienced the same =
problem=20
using html code &lt;input type=3Dcheckbox&gt; in a CUSTOM tag) I can't =
solve the=20
problem to</FONT></SPAN></DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>reset =
the session=20
value if I come back in a multipage survey and un-check a previous =
checked box.=20
The result is that the related session value keep the value if the box =
is=20
checked, but ignores if this has been un-checked</FONT></SPAN></DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>Here =
below what Joel=20
says few time ago (november 21 2007)</FONT></SPAN></DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2>....</FONT></SPAN></DIV>
<DIV><SPAN class=3D593110522-03022008>
<P><FONT size=3D2>adding a perl </FONT></P>
<P><FONT size=3D2>snippet in the page after the matrix and clear values =
from the=20
session if </FONT></P>
<P><FONT size=3D2>they are not in the argument string.</FONT></P>
<P><FONT size=3D2></FONT>&nbsp;</P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>I've =
tried a lot, with=20
2 pages test survey, with this instructions:</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>first=20
page:</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial =
size=3D2>&lt;MATRIX NAME=3D"Q1"=20
CAPTION=3D"choose"&nbsp;=20
MULTI=3D"yes"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
&lt;MATRIXCOLUMN CAPTION=3D" " VALUE=3D"1"=20
/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;MATRIXROW=20
CAPTION=3D"first" VALUE=3D"1"=20
/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;MATRIXROW=20
CAPTION=3D"second" VALUE=3D"2"=20
/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;MATRIXROW=20
CAPTION=3D"third" VALUE=3D"3" /&gt;<BR>&nbsp; =
&lt;/MATRIX&gt;</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial=20
size=3D2>{&amp;<BR>$q101=3D$argument-&gt;ArgByName("Q101") ||=20
"novalue";<BR>$q102=3D$argument-&gt;ArgByName("Q102") ||=20
"novalue";<BR>$q103=3D$argument-&gt;ArgByName("Q103") || =
"novalue";<BR>if($q101 eq=20
"novalue"){$session-&gt;setValue("SUBMITTED_Q101",-1);}<BR>if($q102 eq=20
"novalue"){$session-&gt;setValue("SUBMITTED_Q102",-1);}<BR>if($q103 eq=20
"novalue"){$session-&gt;setValue("SUBMITTED_Q103",-1);}<BR>&amp;}</FONT><=
/SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>and also =

with:</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>if=20
(!$argument-&gt;ArgByName("Q101")=20
){$session-&gt;setValue("SUBMITTED_Q101",-1);}<BR>if=20
(!$argument-&gt;ArgByName("Q102")=20
){$session-&gt;setValue("SUBMITTED_Q102",-1);}<BR>if=20
(!$argument-&gt;ArgByName("Q103")=20
){$session-&gt;setValue("SUBMITTED_Q103",-1);}<BR>and a route to a =
second page=20
in which I've tried to print session values,</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>but with =
no results;=20
</FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>I can't =
understand=20
closely the survey logic, even if I print =
$argument-&gt;ArgByName("Q101"), with=20
the relative box un-checked, but previously checked, the results is that =
it is=20
checked! </FONT></SPAN></P>
<P><SPAN class=3D593110522-03022008><FONT face=3DArial size=3D2>How can =
I use the=20
checkbox instructions? </P></FONT></SPAN></SPAN></DIV></BODY></HTML>

------=_NextPart_000_0001_01C866BC.73C42BA0--

Skickat av "Luca Notari" <[email protected]>
till survey-discussion