[LON-CAPA-users] spreadsheet question

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Thu, 27 Jan 2005 17:45:43 -0500 (EST)


> I am trying to use the &EXT function in the assessment spreadsheet.  I am
> trying to access whether a problem is still open, and I found this
> function call
> 
> &EXT($external::part)
> 
> in a list of &EXT calls.

That exact syntax actually won't work anywhere.

In a homework problem (and only in a homework problem) $external::part
will have the value of the 'current' part.

Playing around with this, it looks like it is nigh on impossible for
one to get a list of parts for the current resources. 

What should work is
&EXT('resource.partorder'); but due to a bug in the spreadsheet code
that doesn't work.

Actually I think what should happen is we should introduce another
level to the spreadsheet, make the current 'resource' level sheet
exist for each 'part', since each part really should be able to have a
different sheet, and would make this whol multipart problem easier to
deal with.


However with that said there is this cell code:

 [&EXPANDSUM(PART;(parameter_PART_duedate < &EXT('system.time') ?1:0))]

If the result is 0, all parts are past due.

If the result is greater than 0 then that many parts are still open.

This will work for single and multi part problems.

And if you want to get the array of duedates this cell works:

 my @parts;
 [&EXPANDSUM(PART;(push(@parts,parameter_PART_duedate)?0:1))];
 # the @parts array now has all of the individual duedates in it
 return(join(',',@parts));

-- 
guy@albertelli.com  LON-CAPA Developer  0-7-3-2-