Diff for /loncom/homework/inputtags.pm between versions 1.196 and 1.203

version 1.196, 2006/06/12 22:03:44 version 1.203, 2006/07/19 20:54:19
Line 284  sub start_textline { Line 284  sub start_textline {
  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' &&      || lc($Apache::lonhomework::problemstatus) eq 'no'
  $Apache::lonhomework::history{"resource.$partid.solved"} !~ /^correct/ )) {      || ($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 440  sub file_selector { Line 441  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,@bad_file_list);      my (@file_list,@bad_file_list);
     foreach my $file (split(',',&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {      foreach my $file (split(/\s*,\s*/,&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(@file_list,'<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");      &Apache::lonnet::logthis("bad file is $url");
Line 453  sub file_selector { Line 454  sub file_selector {
  '" border="0" />'.$file.'</a>');   '" border="0" />'.$file.'</a>');
  }   }
     }      }
     $result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist));      my $files = '<span class="LC_filename">'.
    join('</span>, <span class="LC_filename">',@file_list).
    '</span>';
       $result.=&mt("Portfolio files previously selected: [_1]",$files);
     if (@bad_file_list) {      if (@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));   my $bad_files = '<span class="LC_filename">'.
       join('</span>, <span class="LC_filename">',@bad_file_list).
       '</span>';
    $result.='<br />'.&mt('<span class="LC_error">These file(s) don\'t exist:</span> [_1]',$bad_files);
     }      }
  }   }
     }      }
Line 534  sub decideoutput { Line 541  sub decideoutput {
     my $bgcolor='orange';      my $bgcolor='orange';
     my $added_computer_text=0;      my $added_computer_text=0;
     my %possiblecolors =      my %possiblecolors =
  ( 'correct' => '#aaffaa',   ( 'correct'         => '#aaffaa',
   'charged_try' => '#ffaaaa',    'charged_try'     => '#ffaaaa',
   'not_charged_try' => '#ffffaa',    'not_charged_try' => '#ffffaa',
   'no_message' => '#fffff',    'no_grade'        => '#ffffaa',
     'no_message'      => '#ffffff',
   );    );
   
     my $part = $Apache::inputtags::part;      my $part = $Apache::inputtags::part;
Line 696  sub decideoutput { Line 704  sub decideoutput {
  $button=1;   $button=1;
     } elsif ($award eq 'SUBMITTED') {      } elsif ($award eq 'SUBMITTED') {
  $message = &mt("Your submission has been recorded.");   $message = &mt("Your submission has been recorded.");
  $bgcolor=$possiblecolors{'correct'};   $bgcolor=$possiblecolors{'no_grade'};
  $button=1;   $button=1;
     } elsif ($award eq 'DRAFT') {      } elsif ($award eq 'DRAFT') {
  $message = &mt("A draft copy has been saved.");   $message = &mt("A draft copy has been saved.");
Line 720  sub decideoutput { Line 728  sub decideoutput {
     }      }
     my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();      my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
     foreach my $resid(@Apache::inputtags::response){      foreach my $resid(@Apache::inputtags::response){
         &Apache::lonnet::logthis("handback is ".$Apache::lonhomework::history{"resource.$part.$resid.handback"});  
         if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {          if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
             $message.= '<br /><a href="/uploaded/'."$domain/$user".'/portfolio/'.$Apache::lonhomework::history{"resource.$part.$resid.handback"}.'">Returned File</a>';      $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.");
  $bgcolor=$possiblecolors{'correct'};   $bgcolor=$possiblecolors{'no_grade'};
  $button=1;   $button=1;
     }      }
     if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' &&       if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' && 

Removed from v.1.196  
changed lines
  Added in v.1.203


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