File:  [LON-CAPA] / loncom / homework / rankresponse.pm
Revision 1.54: download - view: text, annotated - select for diffs
Mon Oct 8 09:22:50 2007 UTC (16 years, 7 months ago) by foxr
Branches: MAIN
CVS tags: HEAD
bz4074 - Use lonxml subs to maintain the number of bubble lines required
for responses to these types of problems.

    1: # The LearningOnline Network with CAPA
    2: # rank style response
    3: #
    4: # $Id: rankresponse.pm,v 1.54 2007/10/08 09:22:50 foxr Exp $
    5: # Copyright Michigan State University Board of Trustees
    6: #
    7: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    8: #
    9: # LON-CAPA is free software; you can redistribute it and/or modify
   10: # it under the terms of the GNU General Public License as published by
   11: # the Free Software Foundation; either version 2 of the License, or
   12: # (at your option) any later version.
   13: #
   14: # LON-CAPA is distributed in the hope that it will be useful,
   15: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   16: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17: # GNU General Public License for more details.
   18: #
   19: # You should have received a copy of the GNU General Public License
   20: # along with LON-CAPA; if not, write to the Free Software
   21: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   22: #
   23: # /home/httpd/html/adm/gpl.txt
   24: #
   25: # http://www.lon-capa.org/
   26: #
   27: 
   28: package Apache::rankresponse;
   29: use strict;
   30: use HTML::Entities();
   31: use Apache::optionresponse();
   32: use Apache::lonlocal;
   33: 
   34: BEGIN {
   35:     &Apache::lonxml::register('Apache::rankresponse',('rankresponse'));
   36: }
   37: 
   38: sub start_rankresponse {
   39:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   40:     my $result;
   41:     #when in a rank response use these
   42:     &Apache::lonxml::register('Apache::rankresponse',
   43: 			      ('foilgroup','foil','conceptgroup'));
   44:     push (@Apache::lonxml::namespace,'rankresponse');
   45:     my $id = &Apache::response::start_response($parstack,$safeeval);
   46:     %Apache::hint::rank=();
   47:     undef(%Apache::response::foilnames);
   48:     if ($target eq 'meta') {
   49: 	$result=&Apache::response::meta_package_write('rankresponse');
   50:     } elsif ($target eq 'edit' ) {
   51: 	$result.=&Apache::edit::start_table($token).
   52: 	    '<tr><td>'.&Apache::lonxml::description($token)."</td><td>Delete:".
   53: 	    &Apache::edit::deletelist($target,$token)
   54: 	    ."</td><td>&nbsp".&Apache::edit::end_row()
   55: 	    .&Apache::edit::start_spanning_row();
   56: 	
   57: 	$result.=
   58: 	    &Apache::edit::text_arg('Max Number Of Shown Foils:','max',$token,'4').
   59: 	    &Apache::edit::select_arg('Randomize Foil Order','randomize',
   60: 				      ['yes','no'],$token).
   61: 	    &Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n";
   62:     } elsif ($target eq 'modified') {
   63: 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
   64: 						     $safeeval,'max',
   65: 						     'randomize');
   66: 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
   67:     } elsif ($target eq 'analyze') {
   68: 	my $part_id="$Apache::inputtags::part.$id";
   69: 	push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id);
   70: 	push (@{ $Apache::lonhomework::analyze{"$part_id.bubble_lines"} }, 1);
   71: 
   72:     }
   73:     return $result;
   74: }
   75: 
   76: sub end_rankresponse {
   77:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   78:     my $result;
   79:     if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
   80:     &Apache::response::end_response;
   81:     pop @Apache::lonxml::namespace;
   82:     &Apache::lonxml::deregister('Apache::rankresponse',
   83: 				('foilgroup','foil','conceptgroup'));
   84:     undef(%Apache::response::foilnames);
   85:     return $result;
   86: }
   87: 
   88: %Apache::response::foilgroup=();
   89: sub start_foilgroup {
   90:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   91:     my $result;
   92:     %Apache::response::foilgroup=();
   93:     $Apache::rankresponse::conceptgroup=0;
   94:     &Apache::response::pushrandomnumber();
   95:     return $result;
   96: }
   97: 
   98: sub end_foilgroup {
   99:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  100:     my $result;
  101:     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
  102: 	$target eq 'tex' || $target eq 'analyze') {
  103: 	my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
  104: 	my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
  105: 						   $safeeval,'-2');
  106: 	my $tol = &Apache::lonxml::get_param('tol',$parstack,$safeeval,'-2');
  107: 	if (!defined($tol)) { $tol=0; }
  108: 	if ($target eq 'web' || $target eq 'tex') {
  109: 	    $result=&displayfoils($target,$max,$randomize,$tol);
  110: 	    $Apache::lonxml::post_evaluate=0;
  111: 	} elsif ($target eq 'answer' ) {
  112: 	    $result=&displayanswers($max,$randomize,$tol);
  113: 	} elsif ( $target eq 'grade') {
  114: 	    &grade_response($max,$randomize,$tol);
  115: 	} elsif ( $target eq 'analyze') {
  116: 	    my @shown = &whichfoils($max,$randomize);
  117: 	    &Apache::response::analyze_store_foilgroup(\@shown,
  118: 						  ['text','value','location']);
  119: 	    my $part_id=
  120: 		"$Apache::inputtags::part.$Apache::inputtags::response[-1]";
  121: 	    $Apache::lonhomework::analyze{"$part_id.tol"}=$tol;
  122: 	}
  123: 	&Apache::lonxml::increment_counter(&getfoilcounts($max),
  124: 					   $Apache::inputtags::part);
  125: 	if ($target eq 'analyze') {
  126: 	    &Apache::lonhomework::set_bubble_lines();
  127: 	}
  128:     } elsif ($target eq 'edit') {
  129: 	$result=&Apache::edit::end_table();
  130:     }
  131:     &Apache::response::poprandomnumber();
  132:     return $result;
  133: }
  134: 
  135: sub get_correct_order {
  136:     my ($tol,@foils) =@_;
  137:     my @correctorder;
  138:     my @value_names;
  139:     foreach my $name (@foils) {
  140: 	my @pair=($Apache::response::foilgroup{$name.'.value'},$name);
  141: 	push(@value_names,\@pair);
  142:     }
  143:     @value_names =
  144: 	sort {
  145: 	    if (abs($a->[0] - $b->[0]) > $tol) {return ($a->[0] <=> $b->[0]);}
  146: 	    return 0;
  147: 	} @value_names;
  148:     my @value_names_tmp=@value_names;
  149:     my $firstpair=shift(@value_names_tmp);
  150:     my $order=1;
  151:     my %order;
  152:     my $count=1;
  153:     my $lastvalue=$firstpair->[0];
  154:     $order{$firstpair->[1]}=$order;
  155:     foreach my $pair (@value_names_tmp) {
  156: 	$count++;
  157: 	if (abs($pair->[0]-$lastvalue) > $tol ) {
  158: 	    $order=$count;
  159: 	}
  160: 	$order{$pair->[1]}=$order;
  161: 	$lastvalue=$pair->[0];
  162:     }
  163:     foreach my $name (@foils) {
  164: 	push(@correctorder,$order{$name});
  165:     }
  166:     &Apache::lonhomework::showhash('b' => \@value_names);
  167:     &Apache::lonhomework::showhash('b' => \@correctorder);
  168:     return @correctorder;
  169: }
  170: 
  171: sub displayanswers {
  172:     my ($max,$randomize,$tol,@opt)=@_;
  173:     if (!defined(@{ $Apache::response::foilgroup{'names'} })) { return; }
  174:     my @names = @{ $Apache::response::foilgroup{'names'} };
  175:     my @whichfoils = &whichfoils($max,$randomize);
  176:     my @correctorder=&get_correct_order($tol,@whichfoils);
  177:     my $result;
  178:     if ($Apache::lonhomework::type eq 'exam') {
  179: 	my @alphabet = ('A'..'Z');
  180: 	my $i=0;
  181: 	foreach my $order (@correctorder) {
  182: 	    $result.=&Apache::response::answer_header('rankresponse',$i++);
  183: 	    $result.=&Apache::response::answer_part('rankresponse',
  184: 						    $alphabet[$order-1]);
  185: 	    $result.=&Apache::response::answer_part('rankresponse',$order);
  186: 	    $result.=&Apache::response::answer_footer('rankresponse');
  187: 	}
  188:     } else {
  189: 	$result=&Apache::response::answer_header('rankresponse');
  190: 	foreach my $order (@correctorder) {
  191: 	    $result.=&Apache::response::answer_part('rankresponse',$order);
  192: 	}
  193: 	$result.=&Apache::response::answer_footer('rankresponse');
  194:     }
  195:     return $result;
  196: }
  197: 
  198: sub check_response_order {
  199:     my (%responsehash)=@_;
  200:     my @order=sort( {$a <=> $b} values(%responsehash));
  201:     my $lastvalue=0;
  202:     my $expected=1;
  203:     my $malformed=0;
  204:     foreach my $current (@order) {
  205: 	&Apache::lonxml::debug("$lastvalue $expected $malformed");
  206: 	if (!($current == $lastvalue || $current == $expected)) {
  207: 	    $malformed=1;
  208: 	}
  209: 	$expected++;
  210: 	$lastvalue=$current;
  211:     }
  212:     return $malformed;
  213: }
  214: 
  215: sub grade_response {
  216:     my ($max,$randomize,$tol)=@_;
  217:     my (@whichfoils)=&whichfoils($max,$randomize);
  218:     if (!&Apache::response::submitted()) { return; }
  219:     my %responsehash;
  220:     my %grade;
  221:     my ($temp,$right,$wrong,$ignored)=(1,0,0,0);
  222:     my @correctorder=&get_correct_order($tol,@whichfoils);
  223:     foreach my $name (@whichfoils) {
  224: 	my $response = &Apache::response::getresponse($temp,'A is 1');
  225: 	my $value=shift(@correctorder);
  226: 	if ( $response =~ /[^\s]/) {
  227: 	    $responsehash{$name}=$response;
  228: 	    &Apache::lonxml::debug("submitted a $response for $value<br />\n");
  229: 	    if ($value eq $response) {
  230: 		$grade{$name}='1'; $right++;
  231: 	    } else {
  232: 		$grade{$name}='0'; $wrong++;
  233: 	    }
  234: 	} else {
  235: 	    $ignored++;
  236: 	}
  237: 	$temp++;
  238:     }
  239:     my $malformed=&check_response_order(%responsehash);
  240:     my $part=$Apache::inputtags::part;
  241:     my $id = $Apache::inputtags::response['-1'];
  242:     my $responsestr=&Apache::lonnet::hash2str(%responsehash);
  243:     my $gradestr   =&Apache::lonnet::hash2str(%grade);
  244:     my %previous=&Apache::response::check_for_previous($responsestr,
  245: 						       $part,$id);
  246:     &Apache::lonxml::debug("Got $right right and $wrong wrong, and $ignored were ignored and was $malformed malformed");
  247:     my $ad;
  248:     if ($malformed) {
  249: 	$ad='MISORDERED_RANK';
  250:     } elsif ($wrong==0 && $ignored==0) {
  251: 	$ad='EXACT_ANS';
  252:     } elsif ($wrong==0 && $right==0) {
  253: 	#nothing submitted
  254:     } else {
  255: 	if ($ignored==0) {
  256: 	    $ad='INCORRECT';
  257: 	} else {
  258: 	    $ad='MISSING_ANSWER';
  259: 	}
  260:     }
  261:     if ($Apache::lonhomework::type eq 'survey' &&
  262: 	($ad eq 'INCORRECT' || $ad eq 'EXACT_ANS') ) {
  263: 	$ad='SUBMITTED';
  264:     } else {
  265: 	$Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr;
  266:     }
  267:     $Apache::lonhomework::results{"resource.$part.$id.submission"}=
  268: 	$responsestr;
  269:     $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
  270:     &Apache::response::handle_previous(\%previous,$ad);
  271: }
  272: 
  273: sub format_prior_answer {
  274:     my ($mode,$answer,$other_data) = @_;
  275:     my %lastresponse=&Apache::lonnet::str2hash($answer);
  276:     my $foil_order  =$other_data->[0];
  277:     my %grading     =&Apache::lonnet::str2hash($other_data->[1]);
  278:     my $output;
  279:     foreach my $name (@{ $foil_order }) {
  280: 	next if (!defined($lastresponse{$name}));
  281: 	$output .= '<tr><td>'.$lastresponse{$name}.'</td></tr>';
  282:     }
  283:     return if (!defined($output));
  284:     $output =
  285: 	'<table class="LC_prior_rank">'.$output.'</table>';
  286:     return $output;
  287: }
  288: 
  289: sub displayfoils {
  290:     my ($target,$max,$randomize,$tol)=@_;
  291:     my $result;
  292:     my @alphabet=('A'..'Z');
  293:     my (@whichfoils)=&whichfoils($max,$randomize);
  294:     my $part=$Apache::inputtags::part;
  295:     my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
  296:     my @whichopt=(1..($#whichfoils+1));
  297:     my @correctorder=&get_correct_order($tol,@whichfoils);
  298:     if ( &Apache::response::show_answer() && ($target ne 'tex')) {
  299: 	foreach my $name (@whichfoils) {
  300: 	    my $text=$Apache::response::foilgroup{$name.'.text'};
  301: 	    my $value=shift(@correctorder);
  302: 	    if ($target eq 'web') {
  303: 		$result.='<br /><b>'.$value.':</b> '.$text;
  304: 	    } else {
  305: 		$result.=' \strut\\\\\strut '.$value.':'.$text;
  306: 	    }
  307: 	}
  308:     } else {
  309: 	my $i = 0;
  310: 	my $temp=1;
  311: 	my $id=$Apache::inputtags::response[-1];
  312: 	my $part=$Apache::inputtags::part;
  313: 	my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
  314: 	my %lastresponse=&Apache::lonnet::str2hash($lastresponse); 
  315: 	my @alp = splice @alphabet, 0, $#whichopt + 1;
  316: 	my $internal_counter=$Apache::lonxml::counter;
  317: 	foreach my $name (@whichfoils) {
  318: 	    my $lastopt=$lastresponse{$name};
  319: 	    my $optionlist='';
  320: 	    if ($target ne 'tex') {$optionlist="<option></option>\n";}
  321: 	    my $option;
  322: 	    foreach $option (@whichopt) {
  323: 		if ($option eq $lastopt) {
  324: 		    if ($target ne 'tex') {$optionlist.="<option selected=\"on\">$option</option>\n";}
  325: 		} else {
  326: 		    if ($target ne 'tex') {$optionlist.="<option>$option</option>\n";}
  327: 		}
  328: 	    }
  329: 	    if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
  330: 		$optionlist='<select onchange="javascript:setSubmittedPart(\''.
  331: 		  $part.'\');" name="HWVAL_'.
  332: 		    $Apache::inputtags::response[-1].':'.$temp.'">'.
  333: 		        $optionlist."</select>\n";
  334: 	    } else {
  335: 		$optionlist=' '.$temp.' '.$optionlist.' ';
  336: 	    }
  337: 	    my $text=$Apache::response::foilgroup{$name.'.text'};
  338: 	    if ($target ne 'tex') {
  339: 		if ($Apache::lonhomework::type ne 'exam') {
  340: 		    $result.='<br />'.$optionlist.$text."\n";
  341: 		} else {
  342: 		    $result.='<br />'.$text."\n";
  343: 		}
  344: 		if ($Apache::lonhomework::type eq 'exam') {
  345: 		    my @values=(1..scalar(@whichopt));
  346: 		    $result.=&Apache::optionresponse::webbubbles(\@values,\@whichopt,$temp,$lastopt);
  347: 		}
  348: 	    } else {
  349: 		if ($Apache::lonhomework::type eq 'exam') {
  350: 		    $result.='\vskip 0 mm   '.$text.' \vskip 0 mm '."\n";
  351: 		    $result.='\vskip -1 mm\noindent\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]'.&Apache::optionresponse::bubbles(\@alp,\@whichopt,'rankresponse').'\end{enumerate} \vskip -8 mm \strut ';
  352: 		    $internal_counter++;
  353: 		} else {
  354: 		    $result.=' \vskip 0mm \framebox[5 mm][s]{\tiny\strut} '.$text."\n";
  355: 		}
  356: 	    }
  357: 	    $temp++;
  358: 	}
  359:     }
  360:     if ($target eq 'web') {
  361: 	&Apache::response::setup_prior_tries_hash(\&format_prior_answer,
  362: 						  [\@whichfoils,
  363: 						   'submissiongrading']);
  364:     }
  365:     if ($target ne 'tex') {$result.="<br />";} else {$result.=' \vskip 0 mm ';}
  366:     return $result;
  367: }
  368: 
  369: sub getfoilcounts {
  370:     my ($max)=@_;
  371:     # +1 since instructors will count from 1
  372:     my $count = $#{ $Apache::response::foilgroup{'names'} }+1;
  373:     if (&Apache::response::showallfoils()) { $max=$count; }
  374:     if ($count>$max) { $count=$max } 
  375:     &Apache::lonxml::debug("Count is $count from $max");
  376:     return $count;
  377: }
  378: 
  379: sub whichfoils {
  380:     my ($max,$randomize)=@_;
  381:     return &Apache::response::whichorder($max,$randomize,
  382: 					 &Apache::response::showallfoils(),
  383: 					 \%Apache::response::foilgroup);
  384: }
  385: 
  386: sub start_conceptgroup {
  387:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  388:     $Apache::rankresponse::conceptgroup=1;
  389:     %Apache::response::conceptgroup=();
  390:     my $result;
  391:     if ($target eq 'edit') {
  392: 	$result.=&Apache::edit::tag_start($target,$token,
  393: 					  "Concept Grouped Foils");
  394: 	$result.=&Apache::edit::text_arg('Concept:','concept',$token,'50').
  395: 	    &Apache::edit::end_row().&Apache::edit::start_spanning_row();
  396:     }
  397:     if ($target eq 'modified') {
  398: 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
  399: 						     $safeeval,'concept');
  400: 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  401:     }
  402:     return $result;
  403: }
  404: 
  405: sub end_conceptgroup {
  406:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  407:     $Apache::rankresponse::conceptgroup=0;
  408:     my $result='';
  409:     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
  410: 	$target eq 'tex' || $target eq 'analyze') {
  411: 	#if not there aren't any foils to display and thus no question
  412: 	&Apache::response::pick_foil_for_concept($target,
  413: 						 ['value','text','location'],
  414: 						 \%Apache::hint::rank,
  415: 						 $parstack,$safeeval);
  416:     } elsif ($target eq 'edit') {
  417: 	$result=&Apache::edit::end_table();
  418:     }
  419:     return $result;
  420: }
  421: 
  422: sub insert_conceptgroup {
  423:     my $result="\n\t\t<conceptgroup concept=\"\">".&insert_foil()."\n\t\t</conceptgroup>\n";
  424:     return $result;
  425: }
  426: 
  427: sub start_foil {
  428:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  429:     my $result='';
  430:     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
  431: 	&Apache::lonxml::startredirection;
  432: 	if ($target eq 'analyze') {
  433: 	    &Apache::response::check_if_computed($token,$parstack,$safeeval,'value');
  434: 	}
  435:     } elsif ($target eq 'edit') {
  436: 	$result=&Apache::edit::tag_start($target,$token,"Foil");
  437: 	my $level='-2';
  438: 	if ($$tagstack[-2] eq 'conceptgroup') { $level = '-3'; }
  439: 	$result.=&Apache::edit::text_arg('Name:','name',$token);
  440: 	$result.= &Apache::edit::text_arg('Rank Value:','value',$token,'15');
  441: 	my $randomize=&Apache::lonxml::get_param('randomize',$parstack,
  442: 						 $safeeval,'-3');
  443: 	if ($randomize ne 'no') {
  444: 	    $result.=&Apache::edit::select_arg('Location:','location',
  445: 					     ['random','top','bottom'],$token);
  446: 	}
  447: 	$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
  448:     } elsif ($target eq 'modified') {
  449: 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
  450: 						     $safeeval,'value',
  451: 						     'name','location');
  452: 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  453:     }
  454:     return $result;
  455: }
  456: 
  457: sub end_foil {
  458:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  459:     my $text ='';
  460:     my $result = '';
  461:     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
  462: 	$text=&Apache::lonxml::endredirection;
  463:     }
  464:     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
  465: 	$target eq 'tex' || $target eq 'analyze') {
  466: 	my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
  467: 	if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
  468: 	    $text='\vskip 5mm $\triangleright$ '.$text;
  469: 	}
  470: 	if ($value ne 'unused') {
  471: 	    my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
  472: 	    &Apache::lonxml::debug("Got a name of :$name:");
  473: 	    if ($name eq "") {
  474: 		&Apache::lonxml::warning("Foils without names exist. This can cause problems to malfunction.");
  475: 		$name=$Apache::lonxml::curdepth;
  476: 	    }
  477: 	    &Apache::lonxml::debug("Using a name of :$name:");
  478: 	    if (defined($Apache::response::foilnames{$name})) {
  479: 		&Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name));
  480: 	    }
  481: 	    $Apache::response::foilnames{$name}++;
  482: 	    my $location =&Apache::lonxml::get_param('location',$parstack,
  483: 						     $safeeval);
  484: 	    if ( $Apache::rankresponse::conceptgroup
  485: 		 && !&Apache::response::showallfoils() ) {
  486: 		push @{ $Apache::response::conceptgroup{'names'} }, $name;
  487: 		$Apache::response::conceptgroup{"$name.value"} = $value;
  488: 		$Apache::response::conceptgroup{"$name.text"} = $text;
  489: 		$Apache::response::conceptgroup{"$name.location"} = $location;
  490: 	    } else {
  491: 		push @{ $Apache::response::foilgroup{'names'} }, $name;
  492: 		$Apache::response::foilgroup{"$name.value"} = $value;
  493: 		$Apache::response::foilgroup{"$name.text"} = $text;
  494: 		$Apache::response::foilgroup{"$name.location"} = $location;
  495: 	    }
  496: 	}
  497:     }
  498:     if ($target eq 'edit') {
  499: 	$result.= &Apache::edit::tag_end($target,$token,'');
  500:     }
  501:     return $result;
  502: }
  503: 
  504: sub insert_foil {
  505:     return '
  506: <foil name="" value="unused">
  507: <startouttext />
  508: <endouttext />
  509: </foil>';
  510: }
  511: 1;
  512: __END__

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