--- loncom/homework/response.pm 2007/02/24 01:44:14 1.159 +++ loncom/homework/response.pm 2007/04/07 00:42:29 1.161 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.159 2007/02/24 01:44:14 albertel Exp $ +# $Id: response.pm,v 1.161 2007/04/07 00:42:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -265,11 +265,14 @@ sub meta_response_order { } sub check_for_previous { - my ($curresponse,$partid,$id) = @_; + my ($curresponse,$partid,$id,$last) = @_; my %previous; $previous{'used'} = 0; foreach my $key (sort(keys(%Apache::lonhomework::history))) { if ($key =~ /resource\.$partid\.$id\.submission$/) { + if ( $last && $key =~ /^(\d+):/ ) { + next if ($1 >= $last); + } &Apache::lonxml::debug("Trying $key"); my $pastresponse=$Apache::lonhomework::history{$key}; if ($pastresponse eq $curresponse) { @@ -694,7 +697,7 @@ sub setup_params { if ($env{'request.state'} eq 'construct') { return; } my %paramlist=(); foreach my $key (keys(%Apache::lonnet::packagetab)) { - if ($key =~ /^$tag/) { + if ($key =~ /^\Q$tag\E/) { my ($package,$name) = split(/&/,$key); $paramlist{$name}=1; }