adding grade book view to Survey

This commit is contained in:
Yung Han Khoe 2009-01-26 14:57:01 +00:00
parent d24079f2ca
commit a612b56e92
4 changed files with 99 additions and 17 deletions

View file

@ -975,6 +975,25 @@ sub question {
return $self->{sections}->[ $$address[0] ]->{questions}->[ $$address[1] ];
}
#-------------------------------------------------------------------
=head2 questionCount (){
Return the total number of questions in this survey.
=cut
sub questionCount {
my $self = shift;
my $count;
for ( my $s = 0; $s <= $#{ $self->sections() }; $s++ ) {
$count = $count + scalar @{$self->questions( [$s] )};
}
return $count;
}
#-------------------------------------------------------------------
=head2 answers ($address)
Return a reference to all answers from a particular question.