--- loncom/homework/response.pm 2004/12/23 22:53:41 1.112 +++ loncom/homework/response.pm 2005/03/28 11:57:48 1.115 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.112 2004/12/23 22:53:41 albertel Exp $ +# $Id: response.pm,v 1.115 2005/03/28 11:57:48 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -431,13 +431,11 @@ sub end_responseparam { } sub start_parameter { - my $result = &start_responseparam(@_); - return $result; + return &start_responseparam(@_); } sub end_parameter { - my $result = &end_responseparam(@_); - return $result; + return &end_responseparam(@_); } sub reset_params { @@ -515,7 +513,8 @@ sub showallfoils { if (defined($ENV{'form.showallfoils'})) { my ($symb)=&Apache::lonxml::whichuser(); if ($ENV{'request.state'} eq 'construct' || - ($ENV{'user.adv'} && $symb eq '')) { + ($ENV{'user.adv'} && $symb eq '') || + ($ENV{'print.showallfoils'}) ) { return 1; } } @@ -715,6 +714,19 @@ sub get_response_param { return $parameter; } +sub submitted { + my ($who)=@_; + + # when scatron grading any submission is a submission + if ($ENV{'form.submitted'} eq 'scantron') { return 1; } + # if the caller only cared if this was a scantron submission + if ($who eq 'scantron') { return 0; } + # if the Submit Answer button for this particular part was pressed + my $partid=$Apache::inputtags::part; + if (defined($ENV{'form.submit_'.$partid})) { return 1; } + # otherwise no submission occured + return 0; +} 1; __END__