Diff for /loncom/homework/inputtags.pm between versions 1.94 and 1.98

version 1.94, 2003/04/22 20:43:40 version 1.98, 2003/05/06 15:31:45
Line 33  use strict; Line 33  use strict;
 use Apache::loncommon;  use Apache::loncommon;
   
 BEGIN {  BEGIN {
   &Apache::lonxml::register('Apache::inputtags',('textfield','textline'));    &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline'));
 }  }
   
   
Line 188  sub start_textline { Line 188  sub start_textline {
   } elsif ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {    } elsif ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
       my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);        my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
       if ($size != 0) {$size=$size*2; $size.=' mm';} else {$size='40 mm';}        if ($size != 0) {$size=$size*2; $size.=' mm';} else {$size='40 mm';}
       $result='\framebox['.$size.'][s]{\tiny\strut}\vskip 2 mm';        $result='\framebox['.$size.'][s]{\tiny\strut}';
   }    }
   return $result;    return $result;
 }  }
Line 200  sub end_textline { Line 200  sub end_textline {
   return "";    return "";
 }  }
   
   sub start_hiddenline {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
       my $result = "";
       if ($target eq 'web') {
    $Apache::lonxml::evaluate--;
    if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
       my $partid=$Apache::inputtags::part;
       my $id=$Apache::inputtags::response[-1];
       my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"});
       if ($Apache::lonhomework::type ne 'exam') {
    $result= '<input type="hidden" name="HWVAL_'.$id.'" value="'.
       $oldresponse.'" />';
       }
    }
       } 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 {  sub finalizeawards {
   my $result='';    my $result='';
   my $award;    my $award;
Line 350  sub decideoutput { Line 378  sub decideoutput {
   } else {    } else {
       $message = "Unknown message: $award";        $message = "Unknown message: $award";
       $button=1;        $button=1;
   }     }
   if (lc($Apache::lonhomework::problemstatus) ne 'yes') {    if (lc($Apache::lonhomework::problemstatus) eq 'no') {
       $message = "Answer Submitted";        $message = "Answer Submitted";
       $button=1;        $button=1;
   }    }
Line 530  sub gradestatus { Line 558  sub gradestatus {
     if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; }       if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } 
     if ( $showbutton ) {      if ( $showbutton ) {
       if ($target eq 'tex') {        if ($target eq 'tex') {
   if ($ENV{'request.state'} ne "construct") {    if ($ENV{'request.state'} ne "construct" && $Apache::lonhomework::type ne 'exam') {
       $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 0 mm ';        $trystr = ' {\vskip 1 mm \small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 2 mm ';
   } else {    } else {
       $trystr = '\vskip 0 mm ';        $trystr = '\vskip 0 mm ';
   }    }

Removed from v.1.94  
changed lines
  Added in v.1.98


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>