--- loncom/homework/response.pm 2005/04/07 06:56:22 1.120 +++ loncom/homework/response.pm 2005/08/02 18:05:25 1.123 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.120 2005/04/07 06:56:22 albertel Exp $ +# $Id: response.pm,v 1.123 2005/08/02 18:05:25 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -71,14 +71,14 @@ sub start_hintresponse { my ($parstack,$safeeval)=@_; my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); if ($id eq '') { $id = $Apache::lonxml::curdepth; } - push (@Apache::inputtags::response,$id); - push (@Apache::inputtags::responselist,$id); + push (@Apache::inputtags::hint,$id); + push (@Apache::inputtags::hintlist,$id); push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); return $id; } sub end_hintresponse { - pop @Apache::inputtags::response; + pop @Apache::inputtags::hint; if (defined($Apache::inputtags::paramstack[-1])) { %Apache::inputtags::params= @{ pop(@Apache::inputtags::paramstack) }; @@ -573,6 +573,7 @@ sub getresponse { sub repetition { my $id = $Apache::inputtags::part; my $weight = &Apache::lonnet::EXT("resource.$id.weight"); + if (!defined($weight) || ($weight eq '')) { $weight=1; } my $repetition = int $weight/9; if ($weight % 9 != 0) {$repetition++;} return $repetition; @@ -738,6 +739,8 @@ sub submitted { # if the Submit Answer button for this particular part was pressed my $partid=$Apache::inputtags::part; if (defined($env{'form.submit_'.$partid})) { return 1; } + # Submit All button on a .page was pressed + if (defined($env{'form.all_submit'})) { return 1; } # otherwise no submission occured return 0; }