[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Thu, 20 Feb 2003 14:28:25 -0000
matthew Thu Feb 20 09:28:25 2003 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
&get_sequence_assessment_data() now additionally returns array refs holding
the sequences and assessments which appear in the course.
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.48 loncom/interface/loncoursedata.pm:1.49
--- loncom/interface/loncoursedata.pm:1.48 Fri Feb 14 16:45:19 2003
+++ loncom/interface/loncoursedata.pm Thu Feb 20 09:28:25 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: loncoursedata.pm,v 1.48 2003/02/14 21:45:19 matthew Exp $
+# $Id: loncoursedata.pm,v 1.49 2003/02/20 14:28:25 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -283,6 +283,9 @@
response_ids => [12,14,16] # only for assessment
}
+Also returned are array references to the symbs and assessments contained
+in the sequence.
+
$hash->{'contents'} is a reference to an array of hashes of the same structure.
=cut
@@ -312,12 +315,15 @@
my $symb = $curRes->symb();
my $src = $curRes->src();
#
+ my @Sequences;
+ my @Assessments;
my @Nested_Sequences = (); # Stack of sequences, keeps track of depth
my $top = { title => $title,
symb => $symb,
type => 'container',
num_assess => 0,
contents => [], };
+ push (@Sequences,$top);
push (@Nested_Sequences, $top);
#
# We need to keep track of which sequences contain homework problems
@@ -339,6 +345,7 @@
contents => [],
};
push (@{$currentmap->{'contents'}},$newmap); # this is permanent
+ push (@Sequences,$newmap);
push (@Nested_Sequences, $newmap); # this is a stack
next;
}
@@ -358,10 +365,11 @@
symb => $symb,
type => 'assessment',
};
+ push(@Assessments,$assessment);
push(@{$currentmap->{'contents'}},$assessment);
$currentmap->{'num_assess'}++;
}
- return $top;
+ return ($top,\@Sequences,\@Assessments);
}
=pod