--- loncom/homework/inputtags.pm 2011/10/08 19:19:58 1.295 +++ loncom/homework/inputtags.pm 2011/11/29 13:24:38 1.296 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.295 2011/10/08 19:19:58 raeburn Exp $ +# $Id: inputtags.pm,v 1.296 2011/11/29 13:24:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -843,6 +843,26 @@ sub finalizeawards { } } +sub grading_is_nonlenient { + my ($part) = @_; +# Web mode: we are non-lenient unless told otherwise + my $defaultparm = 'off'; + my $nonlenient = 0; +# Grading a bubblesheet exam: we are grading lenient unless told otherwise + if ($Apache::lonhomework::scantronmode) { + $defaultparm = 'on'; + $nonlenient = 1; + } + my $lenientparm = + &Apache::response::get_response_param($part,'lenient',$defaultparm); + if ($lenientparm=~/^0|off|no$/i) { + $nonlenient = 1; + } elsif ($lenientparm=~/^1|on|yes$/i) { + $nonlenient = 0; + } + return $nonlenient; +} + sub decideoutput { my ($award,$awarded,$awardmsg,$solved,$previous,$target,$nocorrect)=@_; @@ -911,7 +931,13 @@ sub decideoutput { } } } - if ($awarded==1) { $button=0; } else { $button=1; } + if (&grading_is_nonlenient($part)) { + $button=0; + } elsif ($awarded==1) { + $button=0; + } else { + $button=1; + } $previousmsg=''; } elsif ($solved =~ /^excused/) { if ($target eq 'tex') {