--- loncom/homework/response.pm 2008/12/23 18:09:36 1.210 +++ loncom/homework/response.pm 2009/03/13 00:34:20 1.212 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.210 2008/12/23 18:09:36 raeburn Exp $ +# $Id: response.pm,v 1.212 2009/03/13 00:34:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -283,7 +283,7 @@ sub check_for_previous { my %previous; $previous{'used'} = 0; foreach my $key (sort(keys(%Apache::lonhomework::history))) { - if ($key =~ /resource\.$partid\.$id\.submission$/) { + if ($key =~ /resource\.\Q$partid\E\.\Q$id\E\.submission$/) { if ( $last && $key =~ /^(\d+):/ ) { next if ($1 >= $last); } @@ -948,13 +948,17 @@ sub getresponse { my $id = $Apache::inputtags::response[-1]; my $line; + my $startline = $env{'form.scantron_questnum_start.'.$part.'.'.$id}; + if (!$startline) { + $startline = $Apache::lonxml::counter; + } for ($line = 0; $line < $lines; $line++) { - my $theline = $Apache::lonxml::counter+$offset-1+$line; + my $theline = $startline+$offset-1+$line; $response = $env{"scantron.$theline.answer"}; if ((defined($response)) && ($response ne "") && ($response ne " ")) { last; } - + } # save bubbled letter for later