Diff for /loncom/homework/inputtags.pm between versions 1.186.2.1 and 1.187

version 1.186.2.1, 2006/06/09 16:31:00 version 1.187, 2006/02/21 22:41:29
Line 229  sub start_textline { Line 229  sub start_textline {
  $Apache::lonxml::evaluate--;   $Apache::lonxml::evaluate--;
  my $partid=$Apache::inputtags::part;   my $partid=$Apache::inputtags::part;
  my $id=$Apache::inputtags::response[-1];   my $id=$Apache::inputtags::response[-1];
  if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER'   if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
     || ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER' &&  
  $Apache::lonhomework::history{"resource.$partid.solved"} !~ /^correct/ )) {  
     my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);      my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
     my $maxlength;      my $maxlength;
     if ($size eq '') { $size=20; } else {      if ($size eq '') { $size=20; } else {
Line 246  sub start_textline { Line 244  sub start_textline {
  }   }
  my $readonly=&Apache::lonxml::get_param('readonly',$parstack,   my $readonly=&Apache::lonxml::get_param('readonly',$parstack,
  $safeeval);   $safeeval);
  if (lc($readonly) eq 'yes'    if (lc($readonly) eq 'yes') {
     || $Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') {  
     $readonly=' readonly="readonly" ';      $readonly=' readonly="readonly" ';
  } else {   } else {
     $readonly='';      $readonly='';
  }   }
  my $name = 'HWVAL_'.$id;   $result.= '<input type="text" '.$readonly.' name="HWVAL_'.$id.'" value="'.
  if ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') {  
     $name = "none";  
  }  
  $result.= '<input type="text" '.$readonly.' name="'.$name.'" value="'.  
     $oldresponse.'" size="'.$size.'" maxlength="'.$maxlength.'" />';      $oldresponse.'" size="'.$size.'" maxlength="'.$maxlength.'" />';
     }      }
  } else {   } else {
Line 370  sub file_selector { Line 363  sub file_selector {
     '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.      '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.
     '<br />';      '<br />';
  if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){   if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){
     my @filelist;      my (@filelist,@bad_file_list);
     foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {      foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
  my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();   my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
  my $url="/uploaded/$domain/$user/portfolio$file";   my $url="/uploaded/$domain/$user/portfolio$file";
  my $icon=&Apache::loncommon::icon($url);   my $icon=&Apache::loncommon::icon($url);
  push(@filelist,'<a href="'.$url.'"><img src="'.$icon.   push(@filelist,'<a href="'.$url.'"><img src="'.$icon.
      '" border="0" />'.$file.'</a>');       '" border="0" />'.$file.'</a>');
    if (! &Apache::lonnet::stat_file($url)) {
       push(@bad_file_list,'<a href="'.$url.'"><img src="'.$icon.
    '" border="0" />'.$file.'</a>');
    }
     }      }
     $result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist));      $result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist));
       if (@bad_file_list) {
    $result.='<br />'.&mt('<font color="red">These file(s) don\'t exist:</font> <strong>[_1]</strong>',join(', ',@bad_file_list));
       }
  }   }
     }      }
     $result.='</td></tr>';       $result.='</td></tr>'; 

Removed from v.1.186.2.1  
changed lines
  Added in v.1.187


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