--- loncom/homework/response.pm 2010/06/20 12:42:44 1.218 +++ loncom/homework/response.pm 2010/10/14 19:54:56 1.219 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.218 2010/06/20 12:42:44 raeburn Exp $ +# $Id: response.pm,v 1.219 2010/10/14 19:54:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -280,7 +280,7 @@ sub meta_response_order { } sub check_for_previous { - my ($curresponse,$partid,$id,$last) = @_; + my ($curresponse,$partid,$id,$last,$type) = @_; my %previous; $previous{'used'} = 0; foreach my $key (sort(keys(%Apache::lonhomework::history))) { @@ -305,7 +305,15 @@ sub check_for_previous { if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } if ($previous{'award'} eq 'INTERNAL_ERROR') { $previous{'used'}=0; } &Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); - } + } elsif ($type eq 'ci') { + if (lc($pastresponse) eq lc($curresponse)) { + if ($key =~ /^(\d+):/) { + push (@{$previous{'versionci'}},$1); + $previous{'awardci'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"}; + $previous{'usedci'} = 1; + } + } + } } } &Apache::lonhomework::showhash(%previous);