Diff for /loncom/homework/inputtags.pm between versions 1.207 and 1.210

version 1.207, 2006/09/29 23:04:37 version 1.210, 2006/11/01 23:24:52
Line 283  sub needs_exam_box { Line 283  sub needs_exam_box {
 sub start_textline {  sub start_textline {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result = "";      my $result = "";
       my $input_id = &start_input($parstack,$safeeval);
     if ($target eq 'web') {      if ($target eq 'web') {
  $Apache::lonxml::evaluate--;   $Apache::lonxml::evaluate--;
  my $partid=$Apache::inputtags::part;   my $partid=$Apache::inputtags::part;
Line 293  sub start_textline { Line 294  sub start_textline {
     if ($size eq '') { $size=20; } else {      if ($size eq '') { $size=20; } else {
  if ($size < 20) { $maxlength=$size; }   if ($size < 20) { $maxlength=$size; }
     }      }
     my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"},'<>&"');      my $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"};
       &Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse));
   
       if (ref($oldresponse) eq 'ARRAY') {
    $oldresponse = $oldresponse->[$#Apache::inputtags::inputlist];
       }
       $oldresponse = &HTML::Entities::encode($oldresponse,'<>&"');
   
     if ($Apache::lonhomework::type ne 'exam') {      if ($Apache::lonhomework::type ne 'exam') {
  my $addchars=&Apache::lonxml::get_param('addchars',$parstack,$safeeval);   my $addchars=&Apache::lonxml::get_param('addchars',$parstack,$safeeval);
  $result='';   $result='';
Line 321  sub start_textline { Line 329  sub start_textline {
     }      }
  } 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='<b>'.$Apache::inputtags::answertxt{$id}.'</b>';      my $count = scalar(@Apache::inputtags::inputlist)-1;
       $result='<b>'.$Apache::inputtags::answertxt{$id}[$count].'</b>';
     #$result='';      #$result='';
  }   }
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
Line 356  sub end_textline { Line 365  sub end_textline {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     if    ($target eq 'web') { $Apache::lonxml::evaluate++; }      if    ($target eq 'web') { $Apache::lonxml::evaluate++; }
     elsif ($target eq 'edit') { return ('','no'); }      elsif ($target eq 'edit') { return ('','no'); }
       &end_input();
     return "";      return "";
 }  }
   
Line 459  sub show_past_portfile_submission { Line 469  sub show_past_portfile_submission {
     }      }
     my (@file_list,@bad_file_list);      my (@file_list,@bad_file_list);
     foreach my $file (split(/\s*,\s*/,&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::lonnet::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(@file_list,'<a href="'.$url.'"><img src="'.$icon.   push(@file_list,'<a href="'.$url.'"><img src="'.$icon.
Line 514  sub valid_award { Line 524  sub valid_award {
     my %fwd_awards = map { ($_,$i++) } @awards;      my %fwd_awards = map { ($_,$i++) } @awards;
     my $max=scalar(@awards);      my $max=scalar(@awards);
     @awards=reverse(@awards);      @awards=reverse(@awards);
     my $i=0;      $i=0;
     my %rev_awards = map { ($_,$i++) } @awards;      my %rev_awards = map { ($_,$i++) } @awards;
   
 sub finalizeawards {  sub finalizeawards {
Line 750  sub decideoutput { Line 760  sub decideoutput {
  $message = &mt("Unknown message").": $award";   $message = &mt("Unknown message").": $award";
  $button=1;   $button=1;
     }      }
     my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();      my (undef,undef,$domain,$user)=&Apache::lonnet::whichuser();
     foreach my $resid(@Apache::inputtags::response){      foreach my $resid(@Apache::inputtags::response){
         if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {          if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
     $message.='<br />';      $message.='<br />';

Removed from v.1.207  
changed lines
  Added in v.1.210


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