Diff for /loncom/homework/inputtags.pm between versions 1.192 and 1.198

version 1.192, 2006/05/30 12:45:37 version 1.198, 2006/06/30 00:32:25
Line 283  sub start_textline { Line 283  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 298  sub start_textline { Line 300  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='';
  }   }
  $result.= '<input type="text" '.$readonly.' name="HWVAL_'.$id.'" value="'.   my $name = 'HWVAL_'.$id;
    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.'" />';
     }      }
     if ($Apache::lonhomework::type eq 'exam'      if ($Apache::lonhomework::type eq 'exam'
Line 441  sub file_selector { Line 448  sub file_selector {
  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)) {   if (! &Apache::lonnet::stat_file($url)) {
       &Apache::lonnet::logthis("bad file is $url");
     push(@bad_file_list,'<a href="'.$url.'"><img src="'.$icon.      push(@bad_file_list,'<a href="'.$url.'"><img src="'.$icon.
  '" border="0" />'.$file.'</a>');   '" 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) {      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.='<br />'.&mt('<span class="LC_error">These file(s) don\'t exist:</span> <span class="LC_filename">[_1]</span>',join(', ',@bad_file_list));
     }      }
  }   }
     }      }
Line 542  sub decideoutput { Line 550  sub decideoutput {
   
     if ($previous) { $previousmsg=&mt('You have entered that answer before'); }      if ($previous) { $previousmsg=&mt('You have entered that answer before'); }
           
     if      ($solved =~ /^correct/) {      if ($solved =~ /^correct/) {
  $bgcolor=$possiblecolors{'correct'};          $bgcolor=$possiblecolors{'correct'};
  $message=&mt('You are correct.');   $message=&mt('You are correct.');
  if ($awarded < 1 && $awarded > 0) {   if ($awarded < 1 && $awarded > 0) {
     $message=&mt('You are partially correct.');      $message=&mt('You are partially correct.');
Line 710  sub decideoutput { Line 718  sub decideoutput {
  $message = &mt("Unknown message").": $award";   $message = &mt("Unknown message").": $award";
  $button=1;   $button=1;
     }      }
       my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
       foreach my $resid(@Apache::inputtags::response){
           if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
       $message.='<br />';
       my @files = split(/\s*,\s*/,
         $Apache::lonhomework::history{"resource.$part.$resid.handback"});
       my $file_msg;
       foreach my $file (@files) {
    $file_msg.= '<br /><a href="/uploaded/'."$domain/$user".'/'.$file.'">'.$file.'</a>';
       }
       $message .= &mt('Returned file(s): [_1]',$file_msg);
    }
       }
   
     if (lc($Apache::lonhomework::problemstatus) eq 'no'  &&       if (lc($Apache::lonhomework::problemstatus) eq 'no'  && 
  $Apache::inputtags::status[-1] ne 'SHOW_ANSWER') {   $Apache::inputtags::status[-1] ne 'SHOW_ANSWER') {
  $message = &mt("Answer Submitted: Your final submission will be graded after the due date.");   $message = &mt("Answer Submitted: Your final submission will be graded after the due date.");

Removed from v.1.192  
changed lines
  Added in v.1.198


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