--- loncom/homework/inputtags.pm 2002/10/01 21:05:45 1.63 +++ loncom/homework/inputtags.pm 2002/10/24 19:30:39 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.63 2002/10/01 21:05:45 sakharuk Exp $ +# $Id: inputtags.pm,v 1.69 2002/10/24 19:30:39 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,7 +32,7 @@ use HTML::Entities(); use strict; BEGIN { - &Apache::lonxml::register('Apache::inputtags',('textfield','textline','datasubmission')); + &Apache::lonxml::register('Apache::inputtags',('textfield','textline')); } @@ -175,40 +175,6 @@ sub end_textline { return ""; } -sub start_datasubmission { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $id = &Apache::response::start_response($parstack,$safeeval); - my $result; - if ($target eq 'meta') { - $result = &Apache::response::meta_stores_write($token->[2]->{'name'}, - $token->[2]->{'type'}, - $token->[2]->{'display'}); - $result .= &Apache::response::meta_package_write('datasubmission'); - } - return $result; -} - -sub end_datasubmission { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $result; - if ( $target eq 'web' ) { - } elsif ($target eq 'grade' ) { - if ( defined $ENV{'form.submitted'}) { - &Apache::response::setup_params('datasubmission'); - my $partid = $Apache::inputtags::part; - my $id = $Apache::inputtags::response['-1']; - my $response = $ENV{'form.HWVAL'.$id}; - my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); - if ( $response =~ /[^\s]/) { - $Apache::lonhomework::results{"resource.$partid.$id.$name"}= - $response; - } - } - } - &Apache::response::end_response; - return $result; -} - sub finalizeawards { my $result=''; my $award; @@ -268,7 +234,7 @@ sub finalizeawards { } sub decideoutput { - my ($award,$solved,$previous)=@_; + my ($award,$solved,$previous,$target)=@_; my $message=''; my $button=0; my $previousmsg; @@ -276,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/) { @@ -442,7 +413,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 { @@ -460,7 +431,9 @@ sub gradestatus { if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } if ( $showbutton ) { if ($target eq 'tex') { - $trystr = ' '.$tries.'/'.$maxtries.' '; + if ($ENV{'request.state'} ne "construct") { + $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} '; + } } else { $trystr = "Tries $tries/$maxtries"; }