--- loncom/homework/optionresponse.pm 2018/03/01 13:11:47 1.195.2.3 +++ loncom/homework/optionresponse.pm 2015/01/19 15:35:53 1.196 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.195.2.3 2018/03/01 13:11:47 raeburn Exp $ +# $Id: optionresponse.pm,v 1.196 2015/01/19 15:35:53 goltermann Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,7 +128,7 @@ sub start_foilgroup { maxcheck => 'Enter maximum number students may check (e.g., 3)', mincheck => 'Enter minimum number students need to check (e.g., 1)', ); - $result.= sprintf(<%s $lt{'sel'} $lt{'add'} @@ -376,8 +376,8 @@ sub end_foilgroup { } } my $part=$Apache::inputtags::part; - my $id = $Apache::inputtags::response['-1']; - my $nonlenient=&grading_is_nonlenient($part,$id); + my $nonlenient=&grading_is_nonlenient($part); + my $id = $Apache::inputtags::response['-1']; my $responsestr=&Apache::lonnet::hash2str(%responsehash); my $gradestr =&Apache::lonnet::hash2str(%grade); my %previous=&Apache::response::check_for_previous($responsestr, @@ -492,33 +492,22 @@ sub end_foilgroup { } sub grading_is_nonlenient { - my ($part,$id) = @_; + my ($part) = @_; # Web mode: we are non-lenient unless told otherwise my $defaultparm = 'off'; - my $nonlenient = 1; + my $nonlenient = 0; # Grading a bubblesheet exam: we are grading lenient unless told otherwise if ($Apache::lonhomework::scantronmode) { $defaultparm = 'on'; - $nonlenient = 0; + $nonlenient = 1; } my $lenientparm = &Apache::response::get_response_param($part,'lenient',$defaultparm); - if ($lenientparm eq 'default') { - $lenientparm = $defaultparm; - } - $lenientparm = - &Apache::response::get_response_param($part.'_'.$id,'lenient',$lenientparm); - if ($lenientparm eq 'default') { - $lenientparm = $defaultparm; - } if ($lenientparm=~/^0|off|no$/i) { $nonlenient = 1; } elsif ($lenientparm=~/^1|on|yes$/i) { $nonlenient = 0; } - if (!$nonlenient) { - $Apache::inputtags::leniency=1; - } return $nonlenient; } @@ -760,7 +749,7 @@ sub displayfoils { # fieldname is this input field's name after HWVAL_ $optionlist=''. '\n"; + $fieldname.'\'].checked) { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$esccheckboxopt.'\'; } else { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$escaltopt.'\'; };setSubmittedPart(\''.$part.'\');"'.($defopt eq $checkboxopt?' checked="checked"':'')." />\n"; } else { # classic selection list $optionlist='