Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.211 and 1.212

version 1.211, 2007/04/16 23:25:12 version 1.212, 2007/04/17 23:25:24
Line 601  sub end_numericalresponse { Line 601  sub end_numericalresponse {
  }   }
     }      }
  }   }
  &setup_prior_tries_hash();   &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical);
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
  $result.='</td></tr>'.&Apache::edit::end_table;   $result.='</td></tr>'.&Apache::edit::end_table;
     } elsif ($target eq 'answer' || $target eq 'analyze') {      } elsif ($target eq 'answer' || $target eq 'analyze') {
Line 792  sub end_numericalresponse { Line 792  sub end_numericalresponse {
     return $result;      return $result;
 }  }
   
 sub setup_prior_tries_hash {  sub format_prior_response_numerical {
     #FIXME support multi answer numericals/formula      my ($mode,$answer) = @_;
     my $part=$Apache::inputtags::part;      #FIXME needs to support multianswer modes
     my $id=$Apache::inputtags::response[-1];      return '<span class="LC_prior_numerical">'.
     foreach my $i (1..$Apache::lonhomework::history{'version'}) {      &HTML::Entities::encode($answer,'"<>&').'</span>';
  my $key = "$i:resource.$part.$id.submission";  
  next if (!exists($Apache::lonhomework::history{"$key"}));  
  $Apache::inputtags::submission_display{$key} =  
     '<span class="LC_prior_numerical">'.  
     &HTML::Entities::encode($Apache::lonhomework::history{$key},  
     '"<>&').'</span>';  
     }  
 }  }
   
 sub check_for_answer_errors {  sub check_for_answer_errors {
Line 1025  sub get_sigrange { Line 1019  sub get_sigrange {
     return ($sig_ubound,$sig_lbound);      return ($sig_ubound,$sig_lbound);
 }  }
   
 sub setup_prior_tries_hash_string {  sub format_prior_response_string {
     my $part=$Apache::inputtags::part;      my ($mode,$answer) =@_;
     my $id=$Apache::inputtags::response[-1];      return '<span class="LC_prior_string">'.
     foreach my $i (1..$Apache::lonhomework::history{'version'}) {      &HTML::Entities::encode($answer,'"<>&').'</span>';
  my $key = "$i:resource.$part.$id.submission";  
  next if (!exists($Apache::lonhomework::history{"$key"}));  
  $Apache::inputtags::submission_display{$key} =  
     '<span class="LC_prior_string">'.  
     &HTML::Entities::encode($Apache::lonhomework::history{$key},  
     '"<>&').'</span>';  
     }  
 }  }
   
 sub start_stringresponse {  sub start_stringresponse {
Line 1216  sub end_stringresponse { Line 1203  sub end_stringresponse {
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
  $result.='</td></tr>'.&Apache::edit::end_table;   $result.='</td></tr>'.&Apache::edit::end_table;
     } elsif ($target eq 'web' || $target eq 'tex') {      } elsif ($target eq 'web' || $target eq 'tex') {
  &setup_prior_tries_hash_string();   &Apache::response::setup_prior_tries_hash(\&format_prior_response_string);
     }      }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
  $target eq 'tex' || $target eq 'analyze') {   $target eq 'tex' || $target eq 'analyze') {

Removed from v.1.211  
changed lines
  Added in v.1.212


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