File:  [LON-CAPA] / loncom / homework / caparesponse / caparesponse.pm
Revision 1.74: download - view: text, annotated - select for diffs
Wed Nov 27 16:50:09 2002 UTC (21 years, 6 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- need to always check if default_homework is loaded.
-fixes BUG#997

    1: # The LearningOnline Network with CAPA
    2: # caparesponse definition
    3: #
    4: # $Id: caparesponse.pm,v 1.74 2002/11/27 16:50:09 albertel Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: 
   29: package Apache::caparesponse;
   30: use strict;
   31: use capa;
   32: 
   33: BEGIN {
   34:   &Apache::lonxml::register('Apache::caparesponse',('caparesponse','numericalresponse','stringresponse','formularesponse'));
   35: }
   36: 
   37: sub start_caparesponse {
   38:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   39:   my $id = &Apache::response::start_response($parstack,$safeeval);
   40:   return '';
   41: }
   42: 
   43: sub end_caparesponse {
   44:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   45:   my $result = '';
   46:   if ( $target eq 'grade' ) {
   47:     if ( defined $ENV{'form.submitted'}) {
   48:       $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
   49:       my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
   50:       if ( $response =~ /[^\s]/) {
   51: 	my $id = $Apache::inputtags::response['-1'];
   52: 	my $previous= &Apache::response::check_for_previous($response,$id,$response);
   53: 	if ( $previous ) { 
   54: 	  $result = 'PREVIOUSLY_USED';
   55: 	} else {
   56: 	  $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$response;
   57: 	  &Apache::lonxml::debug("submitted a $response<br>\n");
   58: 	  &Apache::lonxml::debug($$parstack[$#$parstack] . "\n<br>");
   59: 	  my $expression="&caparesponse_check('".$response."','".
   60: 	    $$parstack[$#$parstack].
   61: 	      ';my $tol="'.$Apache::inputtags::params{'tol'}.'"'.
   62: 		';my $sig="'.$Apache::inputtags::params{'sig'}.'"'.
   63: 		  "');";
   64: 	  $result = &Apache::run::run($expression,$safeeval);
   65: 	  my ($ad) = split /:/ , $result;
   66: 	  $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}=$ad;
   67: 	  &Apache::lonxml::debug("$expression");
   68: 	  &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
   69: 	}
   70:       }
   71:     }
   72:   } elsif ($target eq 'web') {
   73:     #$result .= "The correct answer is ".&Apache::run::run("{$$parstack['-1'];".'return $answer}',$safeeval)."\n";
   74:   }
   75:   #Apache::lonxml::debug("\n<br>\nreal end caparesponse<br>\n");
   76:   &Apache::response::end_response;
   77:   return '';
   78: }
   79: 
   80: sub start_numericalresponse {
   81:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   82:   my $id = &Apache::response::start_response($parstack,$safeeval);
   83:   my $result;
   84:   if ($target eq 'edit') {
   85:     $result.=&Apache::edit::tag_start($target,$token);
   86:     $result.=&Apache::edit::text_arg('Answer:','answer',$token);
   87:     if ($token->[1] eq 'numericalresponse') {
   88:       $result.=&Apache::edit::text_arg('Unit:','unit',$token,5);
   89:       $result.=&Apache::edit::text_arg('Format:','format',$token,4);
   90:     } elsif ($token->[1] eq 'stringresponse') {
   91:       $result.=&Apache::edit::select_arg('Type:','type',
   92: 		 [['cs','Case Sensitive'],['ci','Case Insensitive'],
   93: 		  ['mc','Case Insensitive, Any Order']],$token);
   94:     } elsif ($token->[1] eq 'formularesponse') {
   95:       $result.=&Apache::edit::text_arg('Sample Points:','samples',$token,40);
   96:     }
   97:     $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
   98:   } elsif ($target eq 'modified') {
   99:     my $constructtag;
  100:     if ($token->[1] eq 'numericalresponse') {
  101:       $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
  102: 						'answer','unit','format');
  103:     } elsif ($token->[1] eq 'stringresponse') {
  104:       $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
  105: 						'answer','type');
  106:     } elsif ($token->[1] eq 'formularesponse') {
  107:       $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
  108: 						'answer','samples');
  109:     }
  110:     if ($constructtag) {
  111:       $result = &Apache::edit::rebuild_tag($token);
  112:       $result.=&Apache::edit::handle_insert();
  113:     }
  114:   } elsif ($target eq 'meta') {
  115:     $result=&Apache::response::meta_package_write('numericalresponse');
  116:   } elsif ($target eq 'answer' || $target eq 'grade') {
  117:       &Apache::response::reset_params();
  118:   }
  119:   return $result;
  120: }
  121: 
  122: sub end_numericalresponse {
  123:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  124:   my $result = '';
  125:   if (!$Apache::lonxml::default_homework_loaded) {
  126:       &Apache::lonxml::default_homework_load($safeeval);
  127:   }
  128:   if ( $target eq 'grade' ) {
  129:     if ( defined $ENV{'form.submitted'}) {
  130:       &Apache::response::setup_params($$tagstack[-1]);
  131:       $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
  132:       my $partid = $Apache::inputtags::part;
  133:       my $id = $Apache::inputtags::response['-1'];
  134:       my $response = $ENV{'form.HWVAL'.$id};
  135:       if ( $response =~ /[^\s]/) {
  136: 	my %previous = &Apache::response::check_for_previous($response,$partid,$id);
  137: 	$Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
  138: 	&Apache::lonxml::debug("submitted a $response<br>\n");
  139: 	&Apache::lonxml::debug($$parstack[$#$parstack] . "\n<br>");
  140: 	$response =~ s/\\/\\\\/g;
  141: 	$response =~ s/\'/\\\'/g;
  142: 	&Apache::lonxml::debug("current $response");
  143: 	my $expression="&caparesponse_check_list('".$response."','".
  144: 	  $$parstack[$#$parstack];
  145: 	foreach my $key (keys(%Apache::inputtags::params)) {
  146: 	  $expression.= ';my $'. #'
  147: 	    $key.'="'.$Apache::inputtags::params{$key}.'"';
  148: 	}
  149: 	if ($$tagstack[-1] eq 'formularesponse') {
  150: 	  $expression.=';my $type="fml";';
  151: 	} elsif ($$tagstack[-1] eq 'numericalresponse') {
  152: 	  $expression.=';my $type="float";';
  153: 	}
  154: 	$expression.="');";
  155: 	$result = &Apache::run::run($expression,$safeeval);
  156: 	my ($awards) = split /:/ , $result;
  157: 	my ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards);
  158: 	&Apache::response::handle_previous(\%previous,$ad);
  159: 	$Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
  160: 	&Apache::lonxml::debug("$expression");
  161: 	&Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
  162: 	$result='';
  163:       }
  164:     }
  165:   } elsif ($target eq 'web' || $target eq 'tex') {
  166:       my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
  167:       my $status = $Apache::inputtags::status['-1'];
  168:       if ($award =~ /^correct/ || $status eq "SHOW_ANSWER" ) {
  169: 	my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,
  170: 						     $safeeval);
  171: 	my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,
  172: 						     $safeeval);
  173: 	my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
  174: 	
  175: 	if ($target eq 'web') {
  176: 	  $result="<br />The correct answer is ";
  177:         } elsif ($target eq 'tex') {
  178: 	  $result='\vskip 0 mm The correct answer is \\texttt{';
  179:         }
  180: 	for (my $i=0; $i <= $#answers; $i++) {
  181: 	   my $answer=$answers[$i];
  182: 	   my $format;
  183: 	   if ($#formats > 0) {
  184: 	     $format=$formats[$i];
  185: 	   } else {
  186: 	     $format=$formats[0];
  187: 	   }
  188: 	   my $formatted;
  189: 	   if ((defined($format)) && ($format ne '')) {
  190: 	     &Apache::lonxml::debug("formatting with :$format: answer :$answer:");
  191: 	     $formatted=sprintf('%.'.$format,$answer).',';
  192: 	   } else {
  193: 	     &Apache::lonxml::debug("no format answer :$answer:");
  194: 	     $formatted="$answer,";
  195: 	   }
  196: 	   if ($target eq 'tex') {$formatted=&Apache::lonxml::latex_special_symbols($formatted);}
  197: 	     $result.=$formatted;
  198:            }
  199: 	   chop $result;
  200: 	   if ($target eq 'web') {
  201: 	     $result.=" $unit.<br />";
  202: 	   } elsif ($target eq 'tex') {
  203: 	     $result.=&Apache::lonxml::latex_special_symbols($unit);
  204: 	     $result.="}. \\vskip 0 mm ";
  205: 	   }
  206:        }
  207:       if ($Apache::lonhomework::type eq 'exam') {
  208:       	my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);
  209: 	my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);
  210: 	my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
  211: 	my $number_of_bubbles = 8; #default values for number of bubbles
  212: 	my @bubbles_values = (); 
  213: 	my @factors = (1.13,1.17,1.25,1.33,1.45); #default values of factors
  214: 	my @powers = (1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0); #default values for powers
  215: 	my $factors_number = 5; #default values for number of factors
  216: 	my $powers_number = 8; #default values for number of powers
  217: 	my $symb;
  218: 	if ($ENV{'form.symb'}=~/___\d+___/) {$symb=$ENV{'form.symb'};} else {$symb=$ENV{'request.symb'};}
  219: 	my $randomseed = srand(&Apache::lonnet::rndseed($symb,$ENV{'request.course.id'},
  220:                                                               $ENV{'user.domain'},$ENV{'user.name'}));
  221: 	my $ind=1+int(rand()*($factors_number-1));
  222: 	my $factor = $factors[$ind];
  223: 	$ind=1+int(rand()*($powers_number-1));
  224: 	my $power = $powers[$ind];
  225: 	for ($ind=0;$ind<$number_of_bubbles;$ind++) {
  226: 	    $bubbles_values[$ind] = $answers[0]*$factor**($power-$powers[$powers_number-$ind-1]);
  227: 	}	    
  228: 	my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
  229: 			'Q','R','S','T','U','V','W','X','Y','Z');
  230:         if ($target eq 'web') {
  231: 	    my $id=$Apache::inputtags::response[-1];
  232: 	    $result.= '<table border="1"><tr>';
  233: 	    for ($ind=0;$ind<$number_of_bubbles;$ind++) {
  234: 		my $ans;
  235: 		if ($formats[0] ne '') {
  236: 		    $ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]);
  237: 		} else {
  238: 		    my $badans = $bubbles_values[$ind];
  239: 		    my $format = ''; 
  240:                     #What is the number? (integer,decimal,floating point)
  241:                     if ($badans=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
  242: 			$format = 'e'.$2;
  243: 		    } elsif ($badans=~/^(\d*)\.(\d*)$/) {
  244: 			$format = '4f';
  245: 		    } elsif ($badans=~/^(\d*)$/) {
  246: 			$format = 'd';
  247: 		    }
  248: 		    $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
  249: 		}
  250: 		    $result.='<td><input type="radio" name="HWVAL'.$id.'" value="'.$ans.'"><b>'.$alphabet[$ind].'</b>: '.$ans.'</td>';
  251: 	    }
  252: 	    $result.='</tr></table>';
  253: 	} elsif ($target eq 'tex') {
  254: 	    my $max_val = 0;
  255: 	    if ($formats[0]=~m/^(\d+)E([^\d]*)(\d*)$/) {
  256: 		$max_val=$1+$2+4;
  257: 	    } else {
  258: 		$max_val=4;
  259: 	    }
  260: 	    $max_val = int(0.9*$ENV{'form.textwidth'}/(($max_val+6)*2));
  261:             my $celllength = 0.9*$ENV{'form.textwidth'}/$max_val-10;
  262: 	    my @table_range = ();
  263: 	    my $number_of_tables = int($number_of_bubbles/$max_val);
  264: 	    for (my $i=0;$i<$number_of_tables;$i++) {push @table_range,$max_val;}
  265: 	    if ($number_of_bubbles % $max_val != 0) {
  266: 		$number_of_tables++;
  267: 		push @table_range,($number_of_bubbles % $max_val);
  268: 	    }
  269: 	    my $j=0;
  270: 	    my $cou=0;
  271: 	    $result.='\vskip -1 mm \noindent \begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]';
  272: 	    for (my $i=0;$i<$number_of_tables;$i++) {
  273: 		$result.='\vskip -1 mm \noindent \begin{tabular}{';
  274: 		for ($ind=0;$ind<$table_range[$j];$ind++) {
  275: 		    $result.='lp{'.$celllength.' mm}';
  276: 		}
  277: 		$result.='}';
  278: 		for ($ind=$cou;$ind<$cou+$table_range[$j];$ind++) {
  279: 		    my $ans;
  280: 		    if ($formats[0] ne '') {
  281: 			$ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]);
  282: 			if ($ans =~ m/([0-9\.\-\+]+)E([0-9\-\+]+)/ ) {
  283: 			    my $number = $1;
  284: 			    my $power = $2;
  285: 			    $power=~s/^\+//;
  286: 			    $power=~s/^(-?)0+(\d+)//;
  287: 			    $ans=$number.'$\times 10^{'.$1.$2.'}$'; #'stupidemacs
  288: 			} 
  289: 		    } else {
  290: 			my $badans = $bubbles_values[$ind];
  291: 			my $format = ''; 
  292: 			#What is the number? (integer,decimal,floating point)
  293: 			if ($badans=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
  294: 			    $format = 'e'.$2;
  295: 			} elsif ($badans=~/^(\d*)\.(\d*)$/) {
  296: 			    $format = '4f';
  297: 			} elsif ($badans=~/^(\d*)$/) {
  298: 			    $format = 'd';
  299: 			}
  300: 			$ans = sprintf('%.'.$format,$bubbles_values[$ind]);			
  301: 			if ($ans =~ m/([0-9\.\-\+]+)E([0-9\-\+]+)/ ) {
  302: 			    my $number = $1;
  303: 			    my $power = $2;
  304: 			    $power=~s/^\+//;
  305: 			    $power=~s/^(-?)0+(\d+)//;
  306: 			    $ans=$number.'$\times 10^{'.$1.$2.'}$'; #'stupidemacs
  307: 			} 
  308: 		    }
  309: 		    $result.='\hskip -3 mm {\small \textbf{'.$alphabet[$ind].'}}$\bigcirc$\hskip -2 mm & {\small '.$ans.'} ';
  310: 		    if ($ind != $cou+$table_range[$j]-1) {$result.=' & ';}
  311: 		}
  312: 		$cou += $table_range[$j];
  313: 		$j++;
  314: 		$result.='\\\\\end{tabular}\vskip 0 mm ';    
  315: 	    }
  316: 	    $result.='\end{enumerate}';
  317: 	    &Apache::lonxml::increment_counter();
  318: 	}
  319:     }
  320:   } elsif ($target eq 'edit') {
  321:     $result.='</td></tr>'.&Apache::edit::end_table;
  322:   } elsif ($target eq 'answer' || $target eq 'analyze') {
  323: 
  324:       my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
  325:       if ($target eq 'analyze') {
  326: 	  push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id);
  327: 	  $Apache::lonhomework::analyze{"$part_id.type"} = $$tagstack[-1];
  328:       }
  329:       &Apache::response::setup_params($$tagstack[-1]);
  330:       my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);
  331:       my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);
  332:       my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
  333:       my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval);
  334: 
  335:       if ($target eq 'answer') {
  336: 	  $result.=&Apache::response::answer_header($$tagstack[-1]);
  337:       }
  338:       for(my $i=0;$i<=$#answers;$i++) {
  339: 	  my $ans=$answers[$i];
  340: 	  my $fmt;
  341: 	  if (@formats) {
  342: 	      if ($#formats) {
  343: 		  $fmt=$formats[$i];
  344: 	      } else {
  345: 		  $fmt=$formats[0];
  346: 	      }
  347: 	  }
  348: 	  my ($high,$low);
  349: 	  if ($Apache::inputtags::params{'tol'}) {
  350: 	      ($high,$low)=&get_tolrange($ans,$Apache::inputtags::params{'tol'});
  351: 	  }
  352: 	  my ($sighigh,$siglow);
  353: 	  if ($Apache::inputtags::params{'sig'}) {
  354: 	      ($sighigh,$siglow)=&get_sigrange($Apache::inputtags::params{'sig'});
  355: 	  }
  356: 	  if ($fmt) {
  357: 	      $ans = sprintf('%.'.$fmt,$ans);
  358: 	      if ($high) {
  359: 		  $high = sprintf('%.'.$fmt,$high); $low = sprintf('%.'.$fmt,$low);
  360: 	      }
  361: 	  }
  362: 	  if ($target eq 'answer') {
  363: 	      if ($high) { $ans.=' ['.$low.','.$high.']'; }
  364: 	      if ($sighigh) { $ans.= " Sig <i>$siglow - $sighigh</i>"; }
  365: 	      $result.=&Apache::response::answer_part($$tagstack[-1],$ans);
  366: 	  } elsif ($target eq 'analyze') {
  367: 	      push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} },
  368: 		    $ans);
  369: 	      if ($high) {
  370: 		  push (@{ $Apache::lonhomework::analyze{"$part_id.ans_high"} }, $high);
  371: 		  push (@{ $Apache::lonhomework::analyze{"$part_id.ans_low"} }, $low);
  372: 	      }
  373: 	  }
  374:       }
  375:       if ($unit) {
  376: 	  if ($target eq 'answer') {
  377: 	      $result.=&Apache::response::answer_part($$tagstack[-1],
  378: 						      "Unit: <b>$unit</b>");
  379: 	  } elsif ($target eq 'analyze') {
  380: 	      push (@{ $Apache::lonhomework::analyze{"$part_id.unit"} },
  381: 		    $unit);
  382: 	  }
  383:       }
  384:       if ($type || $token->[1] eq 'stringresponse') {
  385: 	  my $string='Case Insensitive';
  386: 	  if ($type eq 'mc') {
  387: 	      $string='Multiple Choice';
  388: 	  } elsif ($type eq 'cs') {
  389: 	      $string='Case Sensitive';
  390: 	  } elsif ($type eq 'ci') {
  391: 	      $string='Case Insensitive';
  392: 	  } elsif ($type eq 'fml') {
  393: 	      $string='Formula';
  394: 	  }
  395: 	  if ($target eq 'answer') {
  396: 	      $result.=&Apache::response::answer_part($$tagstack[-1],
  397: 						      '<b>'.$string.'</b>');
  398: 	  } elsif ($target eq 'analyze') {
  399: 	      push (@{ $Apache::lonhomework::analyze{"$part_id.type"} },
  400: 		    $type);
  401: 	  }
  402:       }
  403:       if ($$tagstack[-1] eq 'formularesponse' && $target eq 'answer') {
  404: 	  my $samples=&Apache::lonxml::get_param('samples',$parstack,$safeeval);
  405: 	  $result.=&Apache::response::answer_part($$tagstack[-1],$samples);
  406:       }
  407:       if ($target eq 'answer') {
  408: 	  $result.=&Apache::response::answer_footer($$tagstack[-1]);
  409:       }
  410:   }
  411:   &Apache::response::end_response;
  412:   return $result;
  413: }
  414: 
  415: sub get_tolrange {
  416:   my ($ans,$tol)=@_;
  417:   my ($high,$low);
  418:   if ($tol =~ /%$/) {
  419:     chop($tol);
  420:     my $change=$ans*($tol/100.0);
  421:     $high=$ans+$change;
  422:     $low=$ans-$change;
  423:   } else {
  424:     $high=$ans+$tol;
  425:     $low=$ans-$tol;
  426:   }
  427:   return ($high,$low);
  428: }
  429: 
  430: sub get_sigrange {
  431:   my ($sig)=@_;
  432:   &Apache::lonxml::debug("Got a sig of :$sig:");
  433:   my $sig_lbound;
  434:   my $sig_ubound;
  435:   if ($sig eq '') {
  436:     $sig_lbound = 0; #SIG_LB_DEFAULT
  437:     $sig_ubound =15; #SIG_UB_DEFAULT
  438:   } else {
  439:     ($sig_lbound,$sig_ubound) = split(/,/,$sig);
  440:     if (!$sig_lbound) {
  441:       $sig_lbound = 0; #SIG_LB_DEFAULT
  442:       $sig_ubound =15; #SIG_UB_DEFAULT
  443:     }
  444:     if (!$sig_ubound) { $sig_ubound=$sig_lbound; }
  445:   }
  446:   return ($sig_ubound,$sig_lbound);
  447: }
  448: 
  449: sub start_stringresponse {
  450:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  451:   my $result;
  452:   if ($target eq 'meta') {
  453:     $result=&Apache::response::meta_package_write('stringresponse');
  454:   } else {
  455:     $result.=&start_numericalresponse(@_);
  456:   }
  457:   return $result;
  458: }
  459: 
  460: sub end_stringresponse {
  461:   return end_numericalresponse(@_);
  462: }
  463: 
  464: sub start_formularesponse {
  465:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  466:   my $result;
  467:   if ($target eq 'meta') {
  468:     $result=&Apache::response::meta_package_write('formularesponse');
  469:   } else {
  470:     $result.=&start_numericalresponse(@_);
  471:   }
  472:   return $result;
  473: }
  474: 
  475: sub end_formularesponse {
  476:   return end_numericalresponse(@_);
  477: }
  478: 
  479: 1;
  480: __END__
  481:  

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