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