Re: Strange survey input

"George Clark" <[email protected]> Wed, 5 Apr 2006 23:18:44 -0400
Newsgroups gmane.comp.apache.mod-survey.general
Message-ID <[email protected]>
** Reply to message from Joel Palmius <[email protected]> on Wed, 5 Apr 2006
12:25:47 +0200 (CEST)


Hi Joel,

> The 999 thing is probably a session timeout. 

Thanks, that must explain what I've been seeing.

> The CUSTOM mustanswer thing.. Currently, I don't see any way to modify 
> that error message. 

I did a bit of hacking on the Custom.pm.  It was pretty simple to add a new
parameter MUSTMSG.  In the must answer processing, I test if MUSTMSG exists and
if it does, I supply it instead of the generic error.   It was only a couple of
lines to change.  It all seems to work, but I may have missed something.  
Would something like this be in line with your plans for mod_survey?

mod_survey # diff /usr/lib/mod_survey/Survey/Component/Custom.pm ~gac/Custom.pm
39c39
<       ("ESCAPED", "VARIABLES", "NUMERICAL", "MUSTANSWER", "MUSTMSG",
"ILLEGALVAL",);
---
>       ("ESCAPED", "VARIABLES", "NUMERICAL", "MUSTANSWER", "ILLEGALVAL",);
54d53
<     $self->{"CUSTOM_MUSTMSG"}    = "";
264,274c263,264
<           my ($mmsg) = $doc->GetTagParam($tagno, "MUSTMSG");
<           if ($mmsg ne "")
<           {
<                $sub->{ERROR}     = lprint($mmsg);
<                $sub->{ERRORCODE} = 2;
<           }
<           else
<           {
<                $sub->{ERROR}     = lprint("A CUSTOM question must be
answered.");
<                $sub->{ERRORCODE} = 99;
<           }
---
>             $sub->{ERROR}     = lprint("A CUSTOM question must be answered.");
>             $sub->{ERRORCODE} = 99;


Note that the CUSTOM tag does not seem to be fully defined in the dtd file -
survey-v3.0.0.dtd.  However, I don't know much about what is required for a
dtd, so is it significant that the CUSTOM tags are not defined there?

Thanks,
George
Skickat av "George Clark" <[email protected]>
till survey-discussion