[LON-CAPA-users] spreadsheet access folder name?

Jon Hall lon-capa-users@mail.lon-capa.org
Tue, 10 Jan 2006 23:05:22 -0500


Guy,

i installed the Spreadsheet.pm (ver 1.61) and lonnet.pm (ver 1.693)  
and the new features work like a charm.  very sweet!

here is the code i wrote to for my new default spreadsheet, just in  
case this might be useful to someone:

<field col=A row=0>
	my @parts;
	[&EXPANDSUM(PART;(push(@parts,parameter_PART_duedate)?0:1))];
	# the @parts array now has all of the individual duedates in it
	$last_element= pop(@parts);

	if (&EXT('system.time') > $last_element)
		{
			if (&EXT('resource.title',&EXT('resource.map'))=~Homework)
				{
					'Homework';
				}
			else
				{
					'Ungraded';
				}
		}
	else
		{
			'Not Yet Due';
		}
</field>

<field col=C row=0>
	if (&EXT('system.time') > $last_element and &EXT 
('resource.title',&EXT('resource.map'))=~Homework)
		{
			'Score:'
		}
</field>

<field col=D row=0>
	if (&EXT('system.time') > $last_element and &EXT 
('resource.title',&EXT('resource.map'))=~Homework)
		{
			if ("[stores_0_solved]" eq 'excused')
				{
					0
				} else {
		    		[&EXPANDSUM(PART;parameter_PART_weight*stores_PART_awarded)]
				}
		}
</field>

<field col=E row=0>
	if (&EXT('system.time') > $last_element and &EXT 
('resource.title',&EXT('resource.map'))=~Homework)
		{
			'/'
		}
</field>

<field col=F row=0>
	if (&EXT('system.time') > $last_element and &EXT 
('resource.title',&EXT('resource.map'))=~Homework)
		{
			if ("[stores_0_solved]" eq 'excused')
				{
					0
				} else {
		    		[&EXPANDSUM(PART;parameter_PART_weight*(stores_PART_solved ! 
~ /^\W?excused\W?$/ ? 1 : 0))];
				}
		}
</field>

<field col=I row=0>
	'Date:'
</field>

<field col=J row=0>
	localtime($last_element)
</field>


thanks again!!!







On Jan 10, 2006, at 11:43 AM, Guy Albertelli II wrote:

> Hi Jon,
>
>> if i have a bunch of problems in located in folders named:
>>
>> Homework 14A
>> Lab: Centripetal Motion
>> Lab: Simple Pendulum
>> Homework 14B
>> Quiz 14.1
>>
>> how can i reference that information in the assessment-level
>> spreadsheet?
>>
>> i.e. how do i code
>>
>> if (folder name contains 'Homework')
>> {
>> calculation 1;
>> }
>> else
>> {
>> calculation 2;
>> }
>
> You can however set what assessment level spreadsheet is used on a per
> resource basis.
>
> So you could create 2 assement level sheets and use one for all the
> Homeworks and a different one for the labs, quizzes, etc.
>
> But for the next version one should be able to do
>
> &EXT('resource.title') to get the current resource's title
> &EXT('resource.map') to get the internal name of current resource
>                      folder (or sequence or page)
> and combine them:
> &EXT('resource.title',&EXT('resource.map'))
>
> To get the title of the current resources folder.
>
> (If you are want to try testing these changes out, you'll need to
> patch in:
> Spreadsheet.pm 1.61
> http://install.loncapa.org/cgi-bin/cvsweb.cgi/loncom/interface/ 
> spreadsheet/Spreadsheet.pm.diff?r1=1.60;r2=1.61
>
> and
>
> lonnet.pm 1.693
> http://install.loncapa.org/cgi-bin/cvsweb.cgi/loncom/lonnet/perl/ 
> lonnet.pm.diff?r1=1.692;r2=1.693
> )
>
> -- 
> guy@albertelli.com   0-7-1-8-27,137
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users