version 1.287, 2004/09/09 09:49:50
|
version 1.290, 2004/09/15 21:10:11
|
Line 1685 END
|
Line 1685 END
|
return &$oldFilterFunc($res); |
return &$oldFilterFunc($res); |
}; |
}; |
@resources=$navmap->retrieveResources(undef,$filterFunc); |
@resources=$navmap->retrieveResources(undef,$filterFunc); |
@resources= sort {lc($a->compTitle) cmp lc($b->compTitle)} @resources; |
@resources= sort { |
|
my ($atitle,$btitle) = (lc($a->compTitle),lc($b->compTitle)); |
|
$atitle=~s/^\s*//; |
|
$btitle=~s/^\s*//; |
|
return $atitle cmp $btitle |
|
} @resources; |
} elsif ($args->{'sort'} eq 'duedate') { |
} elsif ($args->{'sort'} eq 'duedate') { |
@resources=$navmap->retrieveResources(undef, |
@resources=$navmap->retrieveResources(undef, |
sub { shift->is_problem(); }); |
sub { shift->is_problem(); }); |
Line 3900 Returns the number of parts of the probl
|
Line 3905 Returns the number of parts of the probl
|
for single part problems, returns 1. For multipart, it returns the |
for single part problems, returns 1. For multipart, it returns the |
number of parts in the problem, not including psuedo-part 0. |
number of parts in the problem, not including psuedo-part 0. |
|
|
|
=item * B<countResponses>(): |
|
|
|
Returns the total number of responses in the problem a student can answer. |
|
|
|
=item * B<responseTypes>(): |
|
|
|
Returns a hash whose keys are the response types. The values are the number |
|
of times each response type is used. This is for the I<entire> problem, not |
|
just a single part. |
|
|
=item * B<multipart>(): |
=item * B<multipart>(): |
|
|
Returns true if the problem is multipart, false otherwise. Use this instead |
Returns true if the problem is multipart, false otherwise. Use this instead |
Line 3946 sub countParts {
|
Line 3961 sub countParts {
|
return scalar(@{$parts}); # + $delta; |
return scalar(@{$parts}); # + $delta; |
} |
} |
|
|
|
sub countResponses { |
|
my $self = shift; |
|
my $count; |
|
foreach my $part ($self->parts()) { |
|
$count+= $self->responseIds($part); |
|
} |
|
return $count; |
|
} |
|
|
|
sub responseTypes { |
|
my $self = shift; |
|
my %Responses; |
|
foreach my $part ($self->parts()) { |
|
foreach my $responsetype ($self->responseType($part)) { |
|
$Responses{$responsetype}++ if (defined($responsetype)); |
|
} |
|
} |
|
return %Responses; |
|
} |
|
|
sub multipart { |
sub multipart { |
my $self = shift; |
my $self = shift; |
return $self->countParts() > 1; |
return $self->countParts() > 1; |
Line 4285 sub getCompletionStatus {
|
Line 4320 sub getCompletionStatus {
|
|
|
# Left as separate if statements in case we ever do more with this |
# Left as separate if statements in case we ever do more with this |
if ($status eq 'correct_by_student') {return $self->CORRECT;} |
if ($status eq 'correct_by_student') {return $self->CORRECT;} |
|
if ($status eq 'correct_by_scantron') {return $self->CORRECT;} |
if ($status eq 'correct_by_override') {return $self->CORRECT_BY_OVERRIDE; } |
if ($status eq 'correct_by_override') {return $self->CORRECT_BY_OVERRIDE; } |
if ($status eq 'incorrect_attempted') {return $self->INCORRECT; } |
if ($status eq 'incorrect_attempted') {return $self->INCORRECT; } |
if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; } |
if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; } |