--- loncom/homework/response.pm 2006/06/24 01:31:34 1.141 +++ loncom/homework/response.pm 2006/07/18 18:52:57 1.145 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.141 2006/06/24 01:31:34 albertel Exp $ +# $Id: response.pm,v 1.145 2006/07/18 18:52:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -131,8 +131,10 @@ sub setrandomnumber { $id1=&Apache::bridgetask::get_dim_id(); if (!$ignore_id2 && ref($Apache::bridgetask::instance{$id1})) { $id2=$Apache::bridgetask::instance{$id1}[-1]; + $shift_amt=scalar(@{$Apache::bridgetask::instance{$id1}}); + } else { + $shift_amt=0; } - $shift_amt=scalar(@{$Apache::bridgetask::instance{$id1}}); } &Apache::lonxml::debug("id1: $id1, id2: $id2, shift_amt: $shift_amt"); if (!$rand_alg || $rand_alg eq '32bit' || $rand_alg eq '64bit' || @@ -987,7 +989,7 @@ sub add_to_gradingqueue { # a return of 3 means it after the answer date sub check_status { my ($id)=@_; - if (!$id) { $id=$Apache::linputtags::part; } + if (!defined($id)) { $id=$Apache::inputtags::part; } my $curtime=&Apache::lonnet::EXT('system.time'); my $opendate=&Apache::lonnet::EXT("resource.$id.opendate"); my $duedate=&Apache::lonnet::EXT("resource.$id.duedate");