Annotation of loncom/homework/caparesponse/caparesponse.pm, revision 1.77
1.3 albertel 1: # The LearningOnline Network with CAPA
2: # caparesponse definition
1.47 albertel 3: #
1.77 ! www 4: # $Id: caparesponse.pm,v 1.76 2003/01/13 21:22:00 sakharuk Exp $
1.47 albertel 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: #
1.3 albertel 28:
29: package Apache::caparesponse;
30: use strict;
1.4 albertel 31: use capa;
1.3 albertel 32:
1.50 harris41 33: BEGIN {
1.44 albertel 34: &Apache::lonxml::register('Apache::caparesponse',('caparesponse','numericalresponse','stringresponse','formularesponse'));
1.3 albertel 35: }
36:
37: sub start_caparesponse {
1.31 albertel 38: my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
1.19 albertel 39: my $id = &Apache::response::start_response($parstack,$safeeval);
1.13 albertel 40: return '';
1.3 albertel 41: }
42:
43: sub end_caparesponse {
1.31 albertel 44: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.12 albertel 45: my $result = '';
1.16 albertel 46: if ( $target eq 'grade' ) {
1.27 albertel 47: if ( defined $ENV{'form.submitted'}) {
1.16 albertel 48: $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
1.19 albertel 49: my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
1.18 albertel 50: if ( $response =~ /[^\s]/) {
1.23 albertel 51: my $id = $Apache::inputtags::response['-1'];
52: my $previous= &Apache::response::check_for_previous($response,$id,$response);
1.22 albertel 53: if ( $previous ) {
54: $result = 'PREVIOUSLY_USED';
55: } else {
1.26 albertel 56: $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$response;
1.22 albertel 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;
1.26 albertel 66: $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}=$ad;
1.22 albertel 67: &Apache::lonxml::debug("$expression");
68: &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
69: }
1.18 albertel 70: }
1.16 albertel 71: }
1.30 albertel 72: } elsif ($target eq 'web') {
1.17 albertel 73: #$result .= "The correct answer is ".&Apache::run::run("{$$parstack['-1'];".'return $answer}',$safeeval)."\n";
1.7 albertel 74: }
75: #Apache::lonxml::debug("\n<br>\nreal end caparesponse<br>\n");
1.19 albertel 76: &Apache::response::end_response;
1.24 albertel 77: return '';
1.21 albertel 78: }
79:
80: sub start_numericalresponse {
1.31 albertel 81: my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
1.22 albertel 82: my $id = &Apache::response::start_response($parstack,$safeeval);
1.32 albertel 83: my $result;
84: if ($target eq 'edit') {
1.49 matthew 85: $result.=&Apache::edit::tag_start($target,$token);
1.34 albertel 86: $result.=&Apache::edit::text_arg('Answer:','answer',$token);
87: if ($token->[1] eq 'numericalresponse') {
1.77 ! www 88: $result.=&Apache::edit::text_arg('Unit:','unit',$token,5).
! 89: &Apache::loncommon::help_open_topic('Physical_Units');
! 90: $result.=&Apache::edit::text_arg('Format:','format',$token,4).
! 91: &Apache::loncommon::help_open_topic('Numerical_Response_Format');
1.44 albertel 92: } elsif ($token->[1] eq 'stringresponse') {
1.35 albertel 93: $result.=&Apache::edit::select_arg('Type:','type',
1.70 albertel 94: [['cs','Case Sensitive'],['ci','Case Insensitive'],
95: ['mc','Case Insensitive, Any Order']],$token);
1.44 albertel 96: } elsif ($token->[1] eq 'formularesponse') {
1.45 albertel 97: $result.=&Apache::edit::text_arg('Sample Points:','samples',$token,40);
1.34 albertel 98: }
1.49 matthew 99: $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
1.32 albertel 100: } elsif ($target eq 'modified') {
1.34 albertel 101: my $constructtag;
102: if ($token->[1] eq 'numericalresponse') {
103: $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
1.36 albertel 104: 'answer','unit','format');
1.44 albertel 105: } elsif ($token->[1] eq 'stringresponse') {
1.34 albertel 106: $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
107: 'answer','type');
1.44 albertel 108: } elsif ($token->[1] eq 'formularesponse') {
109: $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
1.45 albertel 110: 'answer','samples');
1.34 albertel 111: }
1.33 albertel 112: if ($constructtag) {
113: $result = &Apache::edit::rebuild_tag($token);
114: $result.=&Apache::edit::handle_insert();
115: }
1.39 albertel 116: } elsif ($target eq 'meta') {
1.40 albertel 117: $result=&Apache::response::meta_package_write('numericalresponse');
1.73 albertel 118: } elsif ($target eq 'answer' || $target eq 'grade') {
119: &Apache::response::reset_params();
1.32 albertel 120: }
121: return $result;
1.21 albertel 122: }
123:
124: sub end_numericalresponse {
1.31 albertel 125: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.22 albertel 126: my $result = '';
1.74 albertel 127: if (!$Apache::lonxml::default_homework_loaded) {
128: &Apache::lonxml::default_homework_load($safeeval);
129: }
1.22 albertel 130: if ( $target eq 'grade' ) {
1.27 albertel 131: if ( defined $ENV{'form.submitted'}) {
1.45 albertel 132: &Apache::response::setup_params($$tagstack[-1]);
1.22 albertel 133: $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
1.38 albertel 134: my $partid = $Apache::inputtags::part;
135: my $id = $Apache::inputtags::response['-1'];
136: my $response = $ENV{'form.HWVAL'.$id};
1.22 albertel 137: if ( $response =~ /[^\s]/) {
1.38 albertel 138: my %previous = &Apache::response::check_for_previous($response,$partid,$id);
139: $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
140: &Apache::lonxml::debug("submitted a $response<br>\n");
141: &Apache::lonxml::debug($$parstack[$#$parstack] . "\n<br>");
142: $response =~ s/\\/\\\\/g;
143: $response =~ s/\'/\\\'/g;
144: &Apache::lonxml::debug("current $response");
145: my $expression="&caparesponse_check_list('".$response."','".
1.41 albertel 146: $$parstack[$#$parstack];
147: foreach my $key (keys(%Apache::inputtags::params)) {
148: $expression.= ';my $'. #'
149: $key.'="'.$Apache::inputtags::params{$key}.'"';
150: }
1.45 albertel 151: if ($$tagstack[-1] eq 'formularesponse') {
1.46 albertel 152: $expression.=';my $type="fml";';
153: } elsif ($$tagstack[-1] eq 'numericalresponse') {
154: $expression.=';my $type="float";';
1.45 albertel 155: }
1.41 albertel 156: $expression.="');";
1.38 albertel 157: $result = &Apache::run::run($expression,$safeeval);
158: my ($awards) = split /:/ , $result;
159: my ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards);
1.48 albertel 160: &Apache::response::handle_previous(\%previous,$ad);
1.38 albertel 161: $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
162: &Apache::lonxml::debug("$expression");
163: &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
164: $result='';
1.22 albertel 165: }
1.24 albertel 166: }
1.53 sakharuk 167: } elsif ($target eq 'web' || $target eq 'tex') {
1.58 sakharuk 168: my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
169: my $status = $Apache::inputtags::status['-1'];
170: if ($award =~ /^correct/ || $status eq "SHOW_ANSWER" ) {
171: my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,
172: $safeeval);
173: my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,
174: $safeeval);
175: my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
176:
177: if ($target eq 'web') {
1.64 albertel 178: $result="<br />The correct answer is ";
1.58 sakharuk 179: } elsif ($target eq 'tex') {
1.75 albertel 180: #$result='\vskip 0 mm The correct answer is \\texttt{';
1.58 sakharuk 181: }
182: for (my $i=0; $i <= $#answers; $i++) {
183: my $answer=$answers[$i];
184: my $format;
185: if ($#formats > 0) {
186: $format=$formats[$i];
187: } else {
188: $format=$formats[0];
189: }
190: my $formatted;
191: if ((defined($format)) && ($format ne '')) {
192: &Apache::lonxml::debug("formatting with :$format: answer :$answer:");
193: $formatted=sprintf('%.'.$format,$answer).',';
194: } else {
195: &Apache::lonxml::debug("no format answer :$answer:");
196: $formatted="$answer,";
197: }
1.76 sakharuk 198:
1.75 albertel 199: if ($target eq 'tex') {
200: $formatted='';
201: #$formatted=&Apache::lonxml::latex_special_symbols($formatted);
202: }
203: $result.=$formatted;
204: }
1.58 sakharuk 205: chop $result;
206: if ($target eq 'web') {
207: $result.=" $unit.<br />";
208: } elsif ($target eq 'tex') {
1.75 albertel 209: #$result.=&Apache::lonxml::latex_special_symbols($unit);
210: #$result.="}. \\vskip 0 mm ";
1.58 sakharuk 211: }
212: }
1.69 sakharuk 213: if ($Apache::lonhomework::type eq 'exam') {
1.58 sakharuk 214: my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);
215: my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);
216: my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
217: my $number_of_bubbles = 8; #default values for number of bubbles
218: my @bubbles_values = ();
219: my @factors = (1.13,1.17,1.25,1.33,1.45); #default values of factors
220: my @powers = (1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0); #default values for powers
221: my $factors_number = 5; #default values for number of factors
222: my $powers_number = 8; #default values for number of powers
223: my $symb;
224: if ($ENV{'form.symb'}=~/___\d+___/) {$symb=$ENV{'form.symb'};} else {$symb=$ENV{'request.symb'};}
225: my $randomseed = srand(&Apache::lonnet::rndseed($symb,$ENV{'request.course.id'},
226: $ENV{'user.domain'},$ENV{'user.name'}));
227: my $ind=1+int(rand()*($factors_number-1));
228: my $factor = $factors[$ind];
229: $ind=1+int(rand()*($powers_number-1));
230: my $power = $powers[$ind];
231: for ($ind=0;$ind<$number_of_bubbles;$ind++) {
232: $bubbles_values[$ind] = $answers[0]*$factor**($power-$powers[$powers_number-$ind-1]);
233: }
1.60 sakharuk 234: my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
235: 'Q','R','S','T','U','V','W','X','Y','Z');
1.58 sakharuk 236: if ($target eq 'web') {
1.76 sakharuk 237: if ($$tagstack[-1] eq 'numericalresponse') {
1.71 sakharuk 238: my $id=$Apache::inputtags::response[-1];
1.58 sakharuk 239: $result.= '<table border="1"><tr>';
240: for ($ind=0;$ind<$number_of_bubbles;$ind++) {
1.62 sakharuk 241: my $ans;
1.61 sakharuk 242: if ($formats[0] ne '') {
1.62 sakharuk 243: $ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]);
1.60 sakharuk 244: } else {
1.62 sakharuk 245: my $badans = $bubbles_values[$ind];
246: my $format = '';
247: #What is the number? (integer,decimal,floating point)
248: if ($badans=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
249: $format = 'e'.$2;
250: } elsif ($badans=~/^(\d*)\.(\d*)$/) {
251: $format = '4f';
252: } elsif ($badans=~/^(\d*)$/) {
253: $format = 'd';
254: }
255: $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
256: }
1.71 sakharuk 257: $result.='<td><input type="radio" name="HWVAL'.$id.'" value="'.$ans.'"><b>'.$alphabet[$ind].'</b>: '.$ans.'</td>';
1.60 sakharuk 258: }
1.58 sakharuk 259: $result.='</tr></table>';
1.76 sakharuk 260: } elsif ($$tagstack[-1] eq 'formularesponse') {
261: $result.= '<br /><br /><font color="red"> Formula have to be entered here! </font><br /><br />';
262: }
1.58 sakharuk 263: } elsif ($target eq 'tex') {
1.76 sakharuk 264: if ($$tagstack[-1] eq 'numericalresponse') {
265: my $max_val = 0;
266: if ($formats[0]=~m/^(\d+)E([^\d]*)(\d*)$/) {
267: $max_val=$1+$2+4;
268: } else {
269: $max_val=4;
270: }
271: $max_val = int(0.9*$ENV{'form.textwidth'}/(($max_val+6)*2));
272: my $celllength = 0.9*$ENV{'form.textwidth'}/$max_val-10;
273: my @table_range = ();
274: my $number_of_tables = int($number_of_bubbles/$max_val);
275: for (my $i=0;$i<$number_of_tables;$i++) {push @table_range,$max_val;}
276: if ($number_of_bubbles % $max_val != 0) {
277: $number_of_tables++;
278: push @table_range,($number_of_bubbles % $max_val);
1.58 sakharuk 279: }
1.76 sakharuk 280: my $j=0;
281: my $cou=0;
282: $result.='\vskip -1 mm \noindent \begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]';
283: for (my $i=0;$i<$number_of_tables;$i++) {
284: $result.='\vskip -1 mm \noindent \begin{tabular}{';
285: for ($ind=0;$ind<$table_range[$j];$ind++) {
286: $result.='lp{'.$celllength.' mm}';
287: }
288: $result.='}';
289: for ($ind=$cou;$ind<$cou+$table_range[$j];$ind++) {
290: my $ans;
291: if ($formats[0] ne '') {
292: $ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]);
293: if ($ans =~ m/([0-9\.\-\+]+)E([0-9\-\+]+)/ ) {
294: my $number = $1;
295: my $power = $2;
296: $power=~s/^\+//;
297: $power=~s/^(-?)0+(\d+)//;
298: $ans=$number.'$\times 10^{'.$1.$2.'}$'; #'stupidemacs
299: }
300: } else {
301: my $badans = $bubbles_values[$ind];
302: my $format = '';
303: #What is the number? (integer,decimal,floating point)
304: if ($badans=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
305: $format = 'e'.$2;
306: } elsif ($badans=~/^(\d*)\.(\d*)$/) {
307: $format = '4f';
308: } elsif ($badans=~/^(\d*)$/) {
309: $format = 'd';
310: }
311: $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
312: if ($ans =~ m/([0-9\.\-\+]+)E([0-9\-\+]+)/ ) {
313: my $number = $1;
314: my $power = $2;
315: $power=~s/^\+//;
316: $power=~s/^(-?)0+(\d+)//;
317: $ans=$number.'$\times 10^{'.$1.$2.'}$'; #'stupidemacs
318: }
319: }
320: $result.='\hskip -3 mm {\small \textbf{'.$alphabet[$ind].'}}$\bigcirc$\hskip -2 mm & {\small '.$ans.'} ';
321: if ($ind != $cou+$table_range[$j]-1) {$result.=' & ';}
322: }
323: $cou += $table_range[$j];
324: $j++;
325: $result.='\\\\\end{tabular}\vskip 0 mm ';
326: }
327: $result.='\end{enumerate}';
328: &Apache::lonxml::increment_counter();
329: } else {
330: $result.='\fbox{\fbox{\parbox{\textwidth-5mm}{\strut\\\\\strut\\\\\strut\\\\\strut\\\\\strut\\\\\strut\\\\}}}';
331: $result.= '\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Live blank on scoring form}\vskip 0 mm \end{enumerate}';
332: &Apache::lonxml::increment_counter();
333: }
1.36 albertel 334: }
1.69 sakharuk 335: }
1.32 albertel 336: } elsif ($target eq 'edit') {
337: $result.='</td></tr>'.&Apache::edit::end_table;
1.65 albertel 338: } elsif ($target eq 'answer' || $target eq 'analyze') {
1.44 albertel 339:
1.65 albertel 340: my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
341: if ($target eq 'analyze') {
342: push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id);
343: $Apache::lonhomework::analyze{"$part_id.type"} = $$tagstack[-1];
344: }
345: &Apache::response::setup_params($$tagstack[-1]);
346: my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);
347: my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);
348: my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
349: my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval);
1.44 albertel 350:
1.65 albertel 351: if ($target eq 'answer') {
352: $result.=&Apache::response::answer_header($$tagstack[-1]);
353: }
354: for(my $i=0;$i<=$#answers;$i++) {
355: my $ans=$answers[$i];
356: my $fmt;
357: if (@formats) {
358: if ($#formats) {
359: $fmt=$formats[$i];
360: } else {
361: $fmt=$formats[0];
362: }
363: }
364: my ($high,$low);
365: if ($Apache::inputtags::params{'tol'}) {
366: ($high,$low)=&get_tolrange($ans,$Apache::inputtags::params{'tol'});
367: }
368: my ($sighigh,$siglow);
369: if ($Apache::inputtags::params{'sig'}) {
370: ($sighigh,$siglow)=&get_sigrange($Apache::inputtags::params{'sig'});
371: }
372: if ($fmt) {
373: $ans = sprintf('%.'.$fmt,$ans);
374: if ($high) {
375: $high = sprintf('%.'.$fmt,$high); $low = sprintf('%.'.$fmt,$low);
376: }
377: }
378: if ($target eq 'answer') {
1.73 albertel 379: if ($high) { $ans.=' ['.$low.','.$high.']'; }
380: if ($sighigh) { $ans.= " Sig <i>$siglow - $sighigh</i>"; }
1.65 albertel 381: $result.=&Apache::response::answer_part($$tagstack[-1],$ans);
382: } elsif ($target eq 'analyze') {
383: push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} },
384: $ans);
385: if ($high) {
386: push (@{ $Apache::lonhomework::analyze{"$part_id.ans_high"} }, $high);
387: push (@{ $Apache::lonhomework::analyze{"$part_id.ans_low"} }, $low);
388: }
389: }
390: }
391: if ($unit) {
392: if ($target eq 'answer') {
393: $result.=&Apache::response::answer_part($$tagstack[-1],
394: "Unit: <b>$unit</b>");
395: } elsif ($target eq 'analyze') {
396: push (@{ $Apache::lonhomework::analyze{"$part_id.unit"} },
397: $unit);
398: }
1.44 albertel 399: }
1.65 albertel 400: if ($type || $token->[1] eq 'stringresponse') {
401: my $string='Case Insensitive';
402: if ($type eq 'mc') {
403: $string='Multiple Choice';
404: } elsif ($type eq 'cs') {
405: $string='Case Sensitive';
406: } elsif ($type eq 'ci') {
407: $string='Case Insensitive';
408: } elsif ($type eq 'fml') {
409: $string='Formula';
410: }
411: if ($target eq 'answer') {
412: $result.=&Apache::response::answer_part($$tagstack[-1],
413: '<b>'.$string.'</b>');
414: } elsif ($target eq 'analyze') {
415: push (@{ $Apache::lonhomework::analyze{"$part_id.type"} },
416: $type);
417: }
1.52 albertel 418: }
1.65 albertel 419: if ($$tagstack[-1] eq 'formularesponse' && $target eq 'answer') {
420: my $samples=&Apache::lonxml::get_param('samples',$parstack,$safeeval);
421: $result.=&Apache::response::answer_part($$tagstack[-1],$samples);
1.51 albertel 422: }
1.65 albertel 423: if ($target eq 'answer') {
424: $result.=&Apache::response::answer_footer($$tagstack[-1]);
1.44 albertel 425: }
1.22 albertel 426: }
1.59 albertel 427: &Apache::response::end_response;
1.22 albertel 428: return $result;
1.51 albertel 429: }
430:
431: sub get_tolrange {
432: my ($ans,$tol)=@_;
433: my ($high,$low);
434: if ($tol =~ /%$/) {
435: chop($tol);
436: my $change=$ans*($tol/100.0);
437: $high=$ans+$change;
438: $low=$ans-$change;
439: } else {
440: $high=$ans+$tol;
441: $low=$ans-$tol;
442: }
443: return ($high,$low);
1.52 albertel 444: }
445:
446: sub get_sigrange {
447: my ($sig)=@_;
448: &Apache::lonxml::debug("Got a sig of :$sig:");
449: my $sig_lbound;
450: my $sig_ubound;
451: if ($sig eq '') {
452: $sig_lbound = 0; #SIG_LB_DEFAULT
453: $sig_ubound =15; #SIG_UB_DEFAULT
454: } else {
455: ($sig_lbound,$sig_ubound) = split(/,/,$sig);
456: if (!$sig_lbound) {
457: $sig_lbound = 0; #SIG_LB_DEFAULT
458: $sig_ubound =15; #SIG_UB_DEFAULT
459: }
460: if (!$sig_ubound) { $sig_ubound=$sig_lbound; }
461: }
462: return ($sig_ubound,$sig_lbound);
1.34 albertel 463: }
464:
465: sub start_stringresponse {
1.42 albertel 466: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
467: my $result;
468: if ($target eq 'meta') {
469: $result=&Apache::response::meta_package_write('stringresponse');
470: } else {
471: $result.=&start_numericalresponse(@_);
472: }
473: return $result;
1.34 albertel 474: }
475:
476: sub end_stringresponse {
1.44 albertel 477: return end_numericalresponse(@_);
478: }
479:
480: sub start_formularesponse {
481: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
482: my $result;
483: if ($target eq 'meta') {
484: $result=&Apache::response::meta_package_write('formularesponse');
485: } else {
486: $result.=&start_numericalresponse(@_);
487: }
488: return $result;
489: }
490:
491: sub end_formularesponse {
1.34 albertel 492: return end_numericalresponse(@_);
1.3 albertel 493: }
494:
1.1 albertel 495: 1;
1.3 albertel 496: __END__
497:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>