Diff for /loncom/homework/inputtags.pm between versions 1.68 and 1.74

version 1.68, 2002/10/24 19:20:17 version 1.74, 2002/11/19 14:59:35
Line 146  sub start_textline { Line 146  sub start_textline {
     $Apache::lonxml::evaluate--;      $Apache::lonxml::evaluate--;
     if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {      if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
       my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);        my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
       if ($size eq '') { $size=20; }        my $maxlength;
         if ($size eq '') { $size=20; } else {
    if ($size < 20) { $maxlength=$size; }
         }
       my $partid=$Apache::inputtags::part;        my $partid=$Apache::inputtags::part;
       my $id=$Apache::inputtags::response[-1];        my $id=$Apache::inputtags::response[-1];
       my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"});        my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"});
       $result= '<input type="text" name="HWVAL'.$id.'" value="'.        if ($Apache::lonhomework::type ne 'exam') {
  $oldresponse.'" size="'.$size.'" />';          $result= '<input type="text" name="HWVAL'.$id.'" value="'.
       $oldresponse.'" size="'.$size.'" maxlength="'.$maxlength.'" />';
         }
     } else {      } else {
       #right or wrong don't show what was last typed in.        #right or wrong don't show what was last typed in.
       #$result='<i>'.$oldresponse.'</i>';        #$result='<i>'.$oldresponse.'</i>';
Line 164  sub start_textline { Line 169  sub start_textline {
   } elsif ($target eq 'modified') {    } elsif ($target eq 'modified') {
     my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size');      my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size');
     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }      if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
     } elsif ($target eq 'tex') {
         $result='\framebox[1cm][s]{\hfill}';
   }    }
   return $result;    return $result;
 }  }
Line 308  sub decideoutput { Line 315  sub decideoutput {
 sub setgradedata {  sub setgradedata {
   my ($award,$id,$previously_used) = @_;    my ($award,$id,$previously_used) = @_;
   # if the student already has it correct, don't modify the status    # 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;      $Apache::lonhomework::results{"resource.$id.afterduedate"}=$award;
     return '';      return '';
   } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~    } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~
Line 431  sub gradestatus { Line 439  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 ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {    if ($ENV{'request.state'} ne "construct") {
       $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} ';        $trystr = ' {\small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 0 mm ';
   }    }
       } else {        } else {
          $trystr = "<td>Tries $tries/$maxtries</td>";           $trystr = "<td>Tries $tries/$maxtries</td>";

Removed from v.1.68  
changed lines
  Added in v.1.74


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