Diff for /loncom/interface/lonnavmaps.pm between versions 1.289 and 1.290

version 1.289, 2004/09/14 18:05:30 version 1.290, 2004/09/15 21:10:11
Line 3905  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 3951  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;

Removed from v.1.289  
changed lines
  Added in v.1.290


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>