--- loncom/homework/inputtags.pm 2007/10/17 00:22:51 1.233 +++ loncom/homework/inputtags.pm 2008/01/14 14:32:14 1.236 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.233 2007/10/17 00:22:51 albertel Exp $ +# $Id: inputtags.pm,v 1.236 2008/01/14 14:32:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -636,8 +636,8 @@ sub decideoutput { ); my $part = $Apache::inputtags::part; - my $handgrade = - ('yes' eq lc(&Apache::lonnet::EXT("resource.$part.handgrade"))); + my $tohandgrade = &Apache::lonnet::EXT("resource.$part.handgrade"); + my $handgrade = ('yes' eq lc($tohandgrade)); my $computer = ($handgrade)? '' : " ".&mt("Computer's answer now shown above."); @@ -667,14 +667,17 @@ sub decideoutput { $message.= $computer; } $added_computer_text=1; - my ($symb) = &Apache::lonnet::whichuser(); - if (($symb ne '') - && - ($env{'course.'.$env{'request.course.id'}. - '.disable_receipt_display'} ne 'yes')) { - $message.=(($target eq 'web')?'
':' '). - &mt('Your receipt is').' '.&Apache::lonnet::receipt($Apache::inputtags::part). - (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); + if ($awarded > 0) { + my ($symb) = &Apache::lonnet::whichuser(); + if (($symb ne '') + && + ($env{'course.'.$env{'request.course.id'}. + '.disable_receipt_display'} ne 'yes')) { + $message.=(($target eq 'web')?'
':' '). + &mt('Your receipt is [_1]', + (&Apache::lonnet::receipt($Apache::inputtags::part). + (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''))); + } } } $button=0; @@ -701,12 +704,14 @@ sub decideoutput { $message.= $computer; } $added_computer_text=1; - unless ($env{'course.'. + if ($awarded > 0 + && $env{'course.'. $env{'request.course.id'}. - '.disable_receipt_display'} eq 'yes') { + '.disable_receipt_display'} ne 'yes') { $message.=(($target eq 'web')?'
':' '). - 'Your receipt is '.&Apache::lonnet::receipt($Apache::inputtags::part). - (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); + &mt('Your receipt is [_1]', + (&Apache::lonnet::receipt($Apache::inputtags::part). + (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''))); } $css_class=$possible_class{'correct'}; $button=0; @@ -1299,7 +1304,7 @@ sub previous_tries { my $prefix = $env{'form.request.prefix'}; $prefix =~ tr{.}{_}; my $function_name = "LONCAPA_previous_tries_".$prefix. - $Apache::lonxml::curdepth; + $Apache::lonxml::curdepth.'_'.$env{'form.counter'}; my $result ="