Subject: Re: [LON-CAPA-dev] lonparmset.pm

From: "Robert McQueen" <[email-masked]>
Date: Sat, 23 Feb 2002 23:28:44 -0500

Gerd,

>From: Gerd Kortemeyer <[email-masked]>
>Reply-To: [email-masked]
>To: [email-masked]
>Subject: Re: [LON-CAPA-dev] lonparmset.pm
>Date: Sat, 23 Feb 2002 21:00:31 -0500
>
>Robert,
>
>Gerd Kortemeyer wrote:
>
> > Robert McQueen wrote:
> >
> > >
> > >
> > >    By "multipe inputs" I mean in the HTML sense where you either have 
>a
> >
> > > <select name=pscat multiple>
> >
> > Your problems does not have anything to do with LON-CAPA in particular.
> >
> > Your fields will come in in a different form than before when you use 
>"multiple"
> > - don't have the specs here at home, but to find out, you could simply 
>print all
> > $ENV{'form.(something)}
> >
> > foreach $item (keys %ENV) {
> >    if ($item=~/^form/) { print $item.' - '.$ENV{$item}.'<br>'; }
> > }
> >
> > to see what you all get for different submissions. Then go from there.
>
I did that.  That's how I knew that the multiple selections were not being 
sent to the module.  ;)

>Actually, we could have a problem if the parameters for something like 
>pscat come in
>like
>
>pscat=duedate&pscat=answerdate&pscat=opendate
>

I don't mind having to deal with parsing issues.  However, my point is that 
the above version of the pscat never gets read into the ENV hash.

>See http://www.webclass.ru/show.php3?tip=16 ... hmm ...

That's php-based.  We're dealing with Perl, right?  However, I tried using 
the pscat[] notation and then the script received NO input whatsoever.  So 
I'm confused.

>
>In that case only the last occurance of that name value pair would 
>currently come over.

WHY? [That's my original question.] :)

>We can change this, but would need a convention, like
>
>$ENV{'form.pscat.1'}='duedate'
>$ENV{'form.pscat.2'}='answerdate'
>
>or $ENV{'form.pscat'}='duedate,answerdate,opendate'
>
>For now it would be great if we could solve the multiple-part selector 
>problem as a
>first step.
>
>- Gerd.
><< korte.vcf >>

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

---

From: Gerd Kortemeyer <[email-masked]>
Date: Mon, 25 Feb 2002 08:15:59 -0500

Robert,

> >pscat=duedate&pscat=answerdate&pscat=opendate

That is apparently how it indeed does come in. We never dealt with <select
multiple> before ... the above looks like one of those early-days-of-the-web
ideosyncrazies. The LON-CAPA code that deals with processing the form
submissions (adapted from standard-CGI-code-libs) does not deal with this.

> WHY? [That's my original question.] :)

Now I got it. Sorry, I am slow.

The posted parameters get separated at the "&" into name-value pairs, and then
a loop runs over all of them and does

$ENV{'form.'.$name}=$value;

Thus, only the last occurance of $name gets stored. I will modify that some
time today. Check out lonacc.pm later today.

- Gerd.