--- loncom/homework/inputtags.pm 2006/12/14 04:31:32 1.211 +++ loncom/homework/inputtags.pm 2007/02/27 19:43:16 1.216 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.211 2006/12/14 04:31:32 albertel Exp $ +# $Id: inputtags.pm,v 1.216 2007/02/27 19:43:16 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -292,7 +292,9 @@ sub start_textline { my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval); my $maxlength; if ($size eq '') { $size=20; } else { - if ($size < 20) { $maxlength=$size; } + if ($size < 20) { + $maxlength = ' maxlength="'.$size.'"'; + } } my $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; &Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse)); @@ -320,8 +322,8 @@ sub start_textline { if ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') { $name = "none"; } - $result.= ''; + $result.= ''; } if ($Apache::lonhomework::type eq 'exam' && &needs_exam_box($tagstack)) { @@ -621,9 +623,11 @@ sub decideoutput { $message.= $computer; } $added_computer_text=1; - unless ($env{'course.'. + my ($symb) = &Apache::lonnet::whichuser(); + if ((!$env{'course.'. $env{'request.course.id'}. - '.disable_receipt_display'} eq 'yes') { + '.disable_receipt_display'} eq 'yes')&& + $symb) { $message.=(($target eq 'web')?'
':' '). &mt('Your receipt is').' '.&Apache::lonnet::receipt($Apache::inputtags::part). (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); @@ -701,10 +705,8 @@ sub decideoutput { $button=1; } elsif ($award eq 'SIG_FAIL') { my ($used,$min,$max)=split(':',$awardmsg); - my $word; - if ($used < $min) { $word=&mt('more'); } - if ($used > $max) { $word=&mt('fewer'); } - $message = &mt("Submission not graded. Use [_2] digits.",$used,$word); + my $word = ($used < $min) ? 'more' : 'fewer'; + $message = &mt("Submission not graded. Use $word digits.",$used); $bgcolor=$possiblecolors{'not_charged_try'}; $button=1; } elsif ($award eq 'UNIT_INVALID_INSTRUCTOR') { @@ -1065,7 +1067,7 @@ sub gradestatus { if ( $status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {$showbutton = 0;} if ( $showbutton ) { if ($target ne 'tex') { - $button = ''; + $button = ''; } } if ($Apache::lonhomework::history{"resource.$id.afterduedate"}) {