--- loncom/homework/inputtags.pm 2002/10/24 19:13:53 1.67 +++ loncom/homework/inputtags.pm 2002/10/29 06:12:32 1.71 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.67 2002/10/24 19:13:53 sakharuk Exp $ +# $Id: inputtags.pm,v 1.71 2002/10/29 06:12:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -234,7 +234,7 @@ sub finalizeawards { } sub decideoutput { - my ($award,$solved,$previous)=@_; + my ($award,$solved,$previous,$target)=@_; my $message=''; my $button=0; my $previousmsg; @@ -242,8 +242,13 @@ sub decideoutput { if ($previous) { $previousmsg='You have entered that answer before'; } if ($solved =~ /^correct/) { - $message = "You are correct. Your receipt is ". + if ($target eq 'tex') { + $message = '\textbf{You are correct}. Your receipt is '. &Apache::lonnet::receipt; + } else { + $message = "You are correct. Your receipt is ". + &Apache::lonnet::receipt; + } $button=0; $previousmsg=''; } elsif ($solved =~ /^excused/) { @@ -303,7 +308,8 @@ sub decideoutput { sub setgradedata { my ($award,$id,$previously_used) = @_; # if the student already has it correct, don't modify the status - if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER') { + if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' && + $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') { $Apache::lonhomework::results{"resource.$id.afterduedate"}=$award; return ''; } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~ @@ -408,7 +414,7 @@ sub gradestatus { if ( $award ne '' ) { &Apache::lonxml::debug('Getting message'); ($showbutton,$message,$previousmsg) = - &decideoutput($award,$solved,$previous); + &decideoutput($award,$solved,$previous,$target); if ($target eq 'tex') { $message=' '.$message.' '; } else { @@ -426,8 +432,8 @@ sub gradestatus { if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } if ( $showbutton ) { if ($target eq 'tex') { - if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) { - $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} '; + if ($ENV{'request.state'} ne "construct") { + $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 0 mm '; } } else { $trystr = "Tries $tries/$maxtries";