--- loncom/homework/inputtags.pm 2015/03/18 12:53:24 1.333 +++ loncom/homework/inputtags.pm 2015/10/05 02:35:40 1.337 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.333 2015/03/18 12:53:24 raeburn Exp $ +# $Id: inputtags.pm,v 1.337 2015/10/05 02:35:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -661,10 +661,12 @@ sub file_selector { $result .= $constraints.'
'; } if ($which eq 'uploadonly' || $which eq 'both') { - $result.=&mt('Submit a file: (only one file per submission)'). - '

'; - } + my $free_space = $maxfilesize * 1048576; + $result .= &mt('Submit a file: (only one file per submission)'). + '

'. + '
' + } if ( $which eq 'both') { $result.='
'.''.&mt('OR:').'
'; } @@ -906,7 +908,7 @@ sub valid_award { { my @awards = ('EXTRA_ANSWER', 'MISSING_ANSWER', 'ERROR', 'NO_RESPONSE', - 'WRONG_NUMCHECKEDBOXES','TOO_LONG', + 'WRONG_NUMBOXESCHECKED','TOO_LONG', 'UNIT_INVALID_INSTRUCTOR', 'UNIT_INVALID_STUDENT', 'UNIT_IRRECONCIBLE', 'UNIT_FAIL', 'NO_UNIT', 'UNIT_NOTNEEDED', 'WANTED_NUMERIC', 'BAD_FORMULA', 'NOT_FUNCTION', @@ -996,6 +998,23 @@ sub finalizeawards { $j++; } + # if at least one response item is set to include lenient grading + # and that item is partially correct then overall award reflects + # that, unless an award for one of the other response items does + # not fall within the basic awards for correct or incorrect. + if ($Apache::inputtags::leniency) { + if (($$awardref[$which] eq 'INCORRECT') + && (grep { $_ eq 'EXACT_ANS' || + $_ eq 'APPROX_ANS' || + $_ eq 'ASSIGNED_SCORE' } (@$awardref)) + && !((grep { $_ ne 'INCORRECT' && + $_ ne 'EXACT_ANS' && + $_ ne 'APPROX_ANS' && + $_ ne 'ASSIGNED_SCORE' } (@$awardref)))) { + return ('ASSIGNED_SCORE'); + } + } + if (defined($which)) { if (ref($nameref)) { return ($$awardref[$which],$$msgref[$which],$$nameref[$which]); @@ -1681,7 +1700,8 @@ sub gradestatus { && $status ne 'NOT_IN_A_SLOT' && $status ne 'RESERVABLE' && $status ne 'RESERVABLE_LATER' - && $status ne 'NOTRESERVABLE') { + && $status ne 'NOTRESERVABLE' + && $status ne 'NEED_DIFFERENT_IP') { if ($status eq 'SHOW_ANSWER') { $showbutton = 0;