--- loncom/homework/response.pm 2003/04/18 07:12:13 1.71 +++ loncom/homework/response.pm 2003/04/21 20:59:02 1.72 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.71 2003/04/18 07:12:13 albertel Exp $ +# $Id: response.pm,v 1.72 2003/04/21 20:59:02 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -439,6 +439,22 @@ sub repetition { return $repetition; } +sub scored_response { + my ($part,$id)=@_; + my $repetition=&repetition(); + my $score=0; + for (my $i=0;$i<$repetition;$i++) { + my $increase=&Apache::response::getresponse($i+1); + if ($increase ne '') { $score+=$increase+1; } + } + my $weight = &Apache::lonnet::EXT("resource.$part.weight"); + my $pcr=$score/$weight; + $Apache::lonhomework::results{"resource.$part.$id.awarded"}=$pcr; + $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}= + 'ASSIGNED_SCORE'; + return $repetition; +} + 1; __END__