Diff for /loncom/homework/inputtags.pm between versions 1.271.2.6 and 1.271.2.7

version 1.271.2.6, 2011/03/05 23:01:35 version 1.271.2.7, 2011/05/16 01:02:57
Line 60  use LONCAPA; Line 60  use LONCAPA;
     
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline'));      &Apache::lonxml::register('Apache::inputtags',('hiddensubmission','hiddenline','textfield','textline'));
 }  }
   
 =pod  =pod
Line 475  sub end_hiddenline { Line 475  sub end_hiddenline {
     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 "";
   }
   
   sub start_hiddensubmission {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
       my $result = "";
       my $input_id = &start_input($parstack,$safeeval);
       if ($target eq 'web') {
           $Apache::lonxml::evaluate--;
           if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
               my $partid=$Apache::inputtags::part;
               my $id=$Apache::inputtags::response[-1];
               if ($Apache::lonhomework::type ne 'exam') {
                   my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
                   $value = &HTML::Entities::encode($value,'<>&"');
                   $result= '<input type="hidden" name="HWVAL_'.$id.'" value="'.$value.'" />';
               }
           }
       } elsif ($target eq 'edit') {
           $result=&Apache::edit::tag_start($target,$token);
           $result.=&Apache::edit::text_arg('Value:','value',$token,'15');
           $result.=&Apache::edit::end_row();
           $result.=&Apache::edit::end_table();
       } elsif ($target eq 'modified') {
           my $constructtag=&Apache::edit::get_new_args($token,$parstack,
                                                        $safeeval,'value');
           if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
       }
   
       if ( ($target eq 'web' || $target eq 'tex')
            && $Apache::lonhomework::type eq 'exam'
            && &needs_exam_box($tagstack)) {
           $result.=&exam_box($target);
       }
       return $result;
   }
   
   sub end_hiddensubmission {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
       if    ($target eq 'web') { $Apache::lonxml::evaluate++; }
       elsif ($target eq 'edit') { return ('','no'); }
     &end_input();      &end_input();
     return "";      return "";
 }  }

Removed from v.1.271.2.6  
changed lines
  Added in v.1.271.2.7


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