[LON-CAPA-users] (no subject)

lon-capa-users@mail.lon-capa.org lon-capa-users@mail.lon-capa.org
Mon, 22 Jan 2007 16:35:03 -0500


Outstanding!

I have been going nuts trying various combinations of quotes, brackets,
backslashes,... Good to know that I am not (totally) crazy.

I like your use of the array as well; much cleaner than the multiple
comparisons.

Thanks,
brew
-----lon-capa-users-admin@mail.lon-capa.org wrote: -----

To: lon-capa-users@mail.lon-capa.org
From: Guy Albertelli II <guy@albertelli.com>
Sent by: lon-capa-users-admin@mail.lon-capa.org
Date: 01/22/2007 03:40PM
Subject: Re: [LON-CAPA-users] (no subject)

Hi Brew,

> Oops, I didn't realize I was doing C style comparison operators.
>
> OK, I changed that. It now looks like
>
>
[&EXPANDSUM(PART;stores_PART_tries==1?6:(stores_PART_tries==2?2:(stores_PART_tries==3?-4:-12)))]

>
>
> and still gives the traditional undefined value.

Bluh it's a bug in lon-capa.

Got a fix though it'll be on educog later today.

(The bug is that it's doing something stupid when you say
stores_PART_tries several times in the expression.)

For instance this work around works right now:

    %a = ( '1' => 6,
           '2' => 2,
           '3' => -4,
           '4' => -12,
           '5' => -12,
           '6' => -12,
           '7' => -12);
    [&EXPANDSUM(PART;$a{stores_PART_tries})];

>
> It seems like whenever I try and access "tries" things mess up.
> Does the EXPANDSUM look at part 0 (stores_0_tries)? Since this is blank,
I
> am wondering if that messes up the construct.
>
> Or, maybe the negative signs are a problem?
>
> Thanks,
> brew
> -----lon-capa-users-admin@mail.lon-capa.org wrote: -----
>
> To: lon-capa-users@mail.lon-capa.org
> From: Guy Albertelli II <guy@albertelli.com>
> Sent by: lon-capa-users-admin@mail.lon-capa.org
> Date: 01/22/2007 01:57AM
> Subject: Re: [LON-CAPA-users] (no subject)
>
> Hi Brew,
>
> > I am playing with my scoring mechanism in the spreadsheet again, and
> tried
> > the line below.
> > It of course gives the standard "undefined value" response.
> >
> > Anyone know what the error is?
> >
> > The stores_0_tries value is blank or empty; all the rest of them have
> > numbers in them.
> >
> >
>
[&EXPANDSUM(PART;stores_PART_tries=1?6:(stores_PART_tries=2?2:(stores_PART_tries=3?0:-2)))]

>
> >
>
> Try this:
>
[&EXPANDSUM(PART;stores_PART_tries==1?6:(stores_PART_tries==2?2:(stores_PART_tries==3?0:-2)))]

>
> ( '=' is assignment, '==' is numerical comparison, 'eq' is text
comparison
> )
>
> --
> guy@albertelli.com   0-7-1-6-27,137
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>

--
guy@albertelli.com   0-7-1-6-27,137
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users