--- loncom/homework/inputtags.pm 2003/04/21 20:59:02 1.93 +++ loncom/homework/inputtags.pm 2003/05/06 15:31:45 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.93 2003/04/21 20:59:02 albertel Exp $ +# $Id: inputtags.pm,v 1.98 2003/05/06 15:31:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,7 +33,7 @@ use strict; use Apache::loncommon; BEGIN { - &Apache::lonxml::register('Apache::inputtags',('textfield','textline')); + &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline')); } @@ -124,11 +124,17 @@ sub start_textfield { } $result.=&Apache::edit::modifiedfield(); } elsif ($target eq 'tex') { + my $number_of_lines = &Apache::lonxml::get_param('rows',$parstack,$safeeval); + my $width_of_box = &Apache::lonxml::get_param('cols',$parstack,$safeeval); if ($$tagstack[-2] eq 'essayresponse' and $Apache::lonhomework::type eq 'exam') { - my $number_of_lines= &Apache::lonxml::get_param('rows',$parstack,$safeeval); $result = '\fbox{\fbox{\parbox{\textwidth-5mm}{'; - for (my $i=0;$i'; + } + } + } elsif ($target eq 'edit') { + $result=&Apache::edit::tag_start($target,$token); + $result.=&Apache::edit::end_table; + } + return $result; +} + +sub end_hiddenline { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + if ($target eq 'web') { $Apache::lonxml::evaluate++; } + elsif ($target eq 'edit') { return ('','no'); } + return ""; +} + sub finalizeawards { my $result=''; my $award; @@ -344,8 +378,8 @@ sub decideoutput { } else { $message = "Unknown message: $award"; $button=1; - } - if (lc($Apache::lonhomework::problemstatus) ne 'yes') { + } + if (lc($Apache::lonhomework::problemstatus) eq 'no') { $message = "Answer Submitted"; $button=1; } @@ -524,8 +558,8 @@ sub gradestatus { if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } if ( $showbutton ) { if ($target eq 'tex') { - if ($ENV{'request.state'} ne "construct") { - $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 0 mm '; + if ($ENV{'request.state'} ne "construct" && $Apache::lonhomework::type ne 'exam') { + $trystr = ' {\vskip 1 mm \small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 2 mm '; } else { $trystr = '\vskip 0 mm '; }