Diff for /loncom/homework/response.pm between versions 1.133 and 1.139

version 1.133, 2005/12/06 10:00:08 version 1.139, 2006/06/19 16:15:53
Line 32  use Apache::lonlocal; Line 32  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse','customresponse'));      &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse','customresponse','mathresponse'));
 }  }
   
 sub start_response {  sub start_response {
     my ($parstack,$safeeval)=@_;      my ($parstack,$safeeval)=@_;
     my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);      my $id = &Apache::lonxml::get_id($parstack,$safeeval);
     if ($id eq '') { $id = $Apache::lonxml::curdepth; }  
     if ($#Apache::inputtags::import > -1) {      if ($#Apache::inputtags::import > -1) {
  &Apache::lonxml::debug("Turning :$id: into");   &Apache::lonxml::debug("Turning :$id: into");
  $id = join('_',@Apache::inputtags::import).'_'.$id;   $id = join('_',@Apache::inputtags::import).'_'.$id;
Line 69  sub end_response { Line 68  sub end_response {
   
 sub start_hintresponse {  sub start_hintresponse {
     my ($parstack,$safeeval)=@_;      my ($parstack,$safeeval)=@_;
     my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);      my $id = &Apache::lonxml::get_id($parstack,$safeeval);
     if ($id eq '') { $id = $Apache::lonxml::curdepth; }  
     push (@Apache::inputtags::hint,$id);      push (@Apache::inputtags::hint,$id);
     push (@Apache::inputtags::hintlist,$id);      push (@Apache::inputtags::hintlist,$id);
     push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]);      push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]);
Line 436  sub end_customresponse { Line 434  sub end_customresponse {
     return $result;      return $result;
 }  }
   
   sub start_mathresponse {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
       my $result;
       if ($target eq 'meta') {
           &Apache::response::start_response($parstack,$safeeval);
           $result=&Apache::response::meta_package_write('mathresponse');
           &Apache::response::end_response();
       } else {
   #       $result.=&start_numericalresponse(@_);
       }
       return $result;
   }
   
   sub end_mathresponse {
   #    return end_numericalresponse(@_);
   }
   
 sub start_answer {  sub start_answer {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result;      my $result;
Line 611  sub answer_header { Line 626  sub answer_header {
     } else {      } else {
  $result  = '<table border="1"><tr>';   $result  = '<table border="1"><tr>';
  if ($Apache::lonhomework::type eq 'exam') {   if ($Apache::lonhomework::type eq 'exam') {
     $result .= '<td>'.$Apache::lonxml::counter. ')</td>';      $result .= '<td>'.($Apache::lonxml::counter+$increment). ')</td>';
  } else {   } else {
     $result .= '<td>Answer for Part:'.$Apache::inputtags::part.'</td>';      $result .= '<td>Answer for Part:'.$Apache::inputtags::part.'</td>';
  }   }
Line 646  sub answer_footer { Line 661  sub answer_footer {
     my $result;      my $result;
     if ($env{'form.answer_output_mode'} eq 'tex') {      if ($env{'form.answer_output_mode'} eq 'tex') {
  my $columns = scalar(@answer_bits);   my $columns = scalar(@answer_bits);
  $result  = ' \vskip 0 mm \begin{tabular}{|'.'c|'x$columns.'}\hline ';   $result  = ' \vskip 0 mm \noindent \begin{tabular}{|'.'c|'x$columns.'}\hline ';
  $result .= join(' & ',@answer_bits);   $result .= join(' & ',@answer_bits);
  $result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm ';   $result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm ';
     } else {      } else {
Line 884  sub add_to_gradingqueue { Line 899  sub add_to_gradingqueue {
     my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();      my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
     if (   $courseid eq ''      if (   $courseid eq ''
  || $symb eq ''   || $symb eq ''
  || $env{'request.state'} eq 'construct') {   || $env{'request.state'} eq 'construct'
    || $Apache::lonhomework::type ne 'problem') {
  return;   return;
     }      }
   

Removed from v.1.133  
changed lines
  Added in v.1.139


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