File:  [LON-CAPA] / loncom / homework / rankresponse.pm
Revision 1.55: download - view: text, annotated - select for diffs
Mon Oct 15 09:47:29 2007 UTC (16 years, 6 months ago) by foxr
Branches: MAIN
CVS tags: version_2_6_1, version_2_6_0, version_2_5_99_1, version_2_5_99_0, HEAD
BZ 4074  Ensure the bubble lines chunk of the analysis hash gets
keyed by the concatenation of partid.resopnseid.

    1: # The LearningOnline Network with CAPA
    2: # rank style response
    3: #
    4: # $Id: rankresponse.pm,v 1.55 2007/10/15 09:47:29 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: 	my $part = $Apache::inputtags::part;
  124: 	my $id   = $Apache::inputtags::response[-1];
  125: 	&Apache::lonxml::increment_counter(&getfoilcounts($max),
  126: 					   "$part.$id");
  127: 	if ($target eq 'analyze') {
  128: 	    &Apache::lonhomework::set_bubble_lines();
  129: 	}
  130:     } elsif ($target eq 'edit') {
  131: 	$result=&Apache::edit::end_table();
  132:     }
  133:     &Apache::response::poprandomnumber();
  134:     return $result;
  135: }
  136: 
  137: sub get_correct_order {
  138:     my ($tol,@foils) =@_;
  139:     my @correctorder;
  140:     my @value_names;
  141:     foreach my $name (@foils) {
  142: 	my @pair=($Apache::response::foilgroup{$name.'.value'},$name);
  143: 	push(@value_names,\@pair);
  144:     }
  145:     @value_names =
  146: 	sort {
  147: 	    if (abs($a->[0] - $b->[0]) > $tol) {return ($a->[0] <=> $b->[0]);}
  148: 	    return 0;
  149: 	} @value_names;
  150:     my @value_names_tmp=@value_names;
  151:     my $firstpair=shift(@value_names_tmp);
  152:     my $order=1;
  153:     my %order;
  154:     my $count=1;
  155:     my $lastvalue=$firstpair->[0];
  156:     $order{$firstpair->[1]}=$order;
  157:     foreach my $pair (@value_names_tmp) {
  158: 	$count++;
  159: 	if (abs($pair->[0]-$lastvalue) > $tol ) {
  160: 	    $order=$count;
  161: 	}
  162: 	$order{$pair->[1]}=$order;
  163: 	$lastvalue=$pair->[0];
  164:     }
  165:     foreach my $name (@foils) {
  166: 	push(@correctorder,$order{$name});
  167:     }
  168:     &Apache::lonhomework::showhash('b' => \@value_names);
  169:     &Apache::lonhomework::showhash('b' => \@correctorder);
  170:     return @correctorder;
  171: }
  172: 
  173: sub displayanswers {
  174:     my ($max,$randomize,$tol,@opt)=@_;
  175:     if (!defined(@{ $Apache::response::foilgroup{'names'} })) { return; }
  176:     my @names = @{ $Apache::response::foilgroup{'names'} };
  177:     my @whichfoils = &whichfoils($max,$randomize);
  178:     my @correctorder=&get_correct_order($tol,@whichfoils);
  179:     my $result;
  180:     if ($Apache::lonhomework::type eq 'exam') {
  181: 	my @alphabet = ('A'..'Z');
  182: 	my $i=0;
  183: 	foreach my $order (@correctorder) {
  184: 	    $result.=&Apache::response::answer_header('rankresponse',$i++);
  185: 	    $result.=&Apache::response::answer_part('rankresponse',
  186: 						    $alphabet[$order-1]);
  187: 	    $result.=&Apache::response::answer_part('rankresponse',$order);
  188: 	    $result.=&Apache::response::answer_footer('rankresponse');
  189: 	}
  190:     } else {
  191: 	$result=&Apache::response::answer_header('rankresponse');
  192: 	foreach my $order (@correctorder) {
  193: 	    $result.=&Apache::response::answer_part('rankresponse',$order);
  194: 	}
  195: 	$result.=&Apache::response::answer_footer('rankresponse');
  196:     }
  197:     return $result;
  198: }
  199: 
  200: sub check_response_order {
  201:     my (%responsehash)=@_;
  202:     my @order=sort( {$a <=> $b} values(%responsehash));
  203:     my $lastvalue=0;
  204:     my $expected=1;
  205:     my $malformed=0;
  206:     foreach my $current (@order) {
  207: 	&Apache::lonxml::debug("$lastvalue $expected $malformed");
  208: 	if (!($current == $lastvalue || $current == $expected)) {
  209: 	    $malformed=1;
  210: 	}
  211: 	$expected++;
  212: 	$lastvalue=$current;
  213:     }
  214:     return $malformed;
  215: }
  216: 
  217: sub grade_response {
  218:     my ($max,$randomize,$tol)=@_;
  219:     my (@whichfoils)=&whichfoils($max,$randomize);
  220:     if (!&Apache::response::submitted()) { return; }
  221:     my %responsehash;
  222:     my %grade;
  223:     my ($temp,$right,$wrong,$ignored)=(1,0,0,0);
  224:     my @correctorder=&get_correct_order($tol,@whichfoils);
  225:     foreach my $name (@whichfoils) {
  226: 	my $response = &Apache::response::getresponse($temp,'A is 1');
  227: 	my $value=shift(@correctorder);
  228: 	if ( $response =~ /[^\s]/) {
  229: 	    $responsehash{$name}=$response;
  230: 	    &Apache::lonxml::debug("submitted a $response for $value<br />\n");
  231: 	    if ($value eq $response) {
  232: 		$grade{$name}='1'; $right++;
  233: 	    } else {
  234: 		$grade{$name}='0'; $wrong++;
  235: 	    }
  236: 	} else {
  237: 	    $ignored++;
  238: 	}
  239: 	$temp++;
  240:     }
  241:     my $malformed=&check_response_order(%responsehash);
  242:     my $part=$Apache::inputtags::part;
  243:     my $id = $Apache::inputtags::response['-1'];
  244:     my $responsestr=&Apache::lonnet::hash2str(%responsehash);
  245:     my $gradestr   =&Apache::lonnet::hash2str(%grade);
  246:     my %previous=&Apache::response::check_for_previous($responsestr,
  247: 						       $part,$id);
  248:     &Apache::lonxml::debug("Got $right right and $wrong wrong, and $ignored were ignored and was $malformed malformed");
  249:     my $ad;
  250:     if ($malformed) {
  251: 	$ad='MISORDERED_RANK';
  252:     } elsif ($wrong==0 && $ignored==0) {
  253: 	$ad='EXACT_ANS';
  254:     } elsif ($wrong==0 && $right==0) {
  255: 	#nothing submitted
  256:     } else {
  257: 	if ($ignored==0) {
  258: 	    $ad='INCORRECT';
  259: 	} else {
  260: 	    $ad='MISSING_ANSWER';
  261: 	}
  262:     }
  263:     if ($Apache::lonhomework::type eq 'survey' &&
  264: 	($ad eq 'INCORRECT' || $ad eq 'EXACT_ANS') ) {
  265: 	$ad='SUBMITTED';
  266:     } else {
  267: 	$Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr;
  268:     }
  269:     $Apache::lonhomework::results{"resource.$part.$id.submission"}=
  270: 	$responsestr;
  271:     $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
  272:     &Apache::response::handle_previous(\%previous,$ad);
  273: }
  274: 
  275: sub format_prior_answer {
  276:     my ($mode,$answer,$other_data) = @_;
  277:     my %lastresponse=&Apache::lonnet::str2hash($answer);
  278:     my $foil_order  =$other_data->[0];
  279:     my %grading     =&Apache::lonnet::str2hash($other_data->[1]);
  280:     my $output;
  281:     foreach my $name (@{ $foil_order }) {
  282: 	next if (!defined($lastresponse{$name}));
  283: 	$output .= '<tr><td>'.$lastresponse{$name}.'</td></tr>';
  284:     }
  285:     return if (!defined($output));
  286:     $output =
  287: 	'<table class="LC_prior_rank">'.$output.'</table>';
  288:     return $output;
  289: }
  290: 
  291: sub displayfoils {
  292:     my ($target,$max,$randomize,$tol)=@_;
  293:     my $result;
  294:     my @alphabet=('A'..'Z');
  295:     my (@whichfoils)=&whichfoils($max,$randomize);
  296:     my $part=$Apache::inputtags::part;
  297:     my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
  298:     my @whichopt=(1..($#whichfoils+1));
  299:     my @correctorder=&get_correct_order($tol,@whichfoils);
  300:     if ( &Apache::response::show_answer() && ($target ne 'tex')) {
  301: 	foreach my $name (@whichfoils) {
  302: 	    my $text=$Apache::response::foilgroup{$name.'.text'};
  303: 	    my $value=shift(@correctorder);
  304: 	    if ($target eq 'web') {
  305: 		$result.='<br /><b>'.$value.':</b> '.$text;
  306: 	    } else {
  307: 		$result.=' \strut\\\\\strut '.$value.':'.$text;
  308: 	    }
  309: 	}
  310:     } else {
  311: 	my $i = 0;
  312: 	my $temp=1;
  313: 	my $id=$Apache::inputtags::response[-1];
  314: 	my $part=$Apache::inputtags::part;
  315: 	my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
  316: 	my %lastresponse=&Apache::lonnet::str2hash($lastresponse); 
  317: 	my @alp = splice @alphabet, 0, $#whichopt + 1;
  318: 	my $internal_counter=$Apache::lonxml::counter;
  319: 	foreach my $name (@whichfoils) {
  320: 	    my $lastopt=$lastresponse{$name};
  321: 	    my $optionlist='';
  322: 	    if ($target ne 'tex') {$optionlist="<option></option>\n";}
  323: 	    my $option;
  324: 	    foreach $option (@whichopt) {
  325: 		if ($option eq $lastopt) {
  326: 		    if ($target ne 'tex') {$optionlist.="<option selected=\"on\">$option</option>\n";}
  327: 		} else {
  328: 		    if ($target ne 'tex') {$optionlist.="<option>$option</option>\n";}
  329: 		}
  330: 	    }
  331: 	    if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
  332: 		$optionlist='<select onchange="javascript:setSubmittedPart(\''.
  333: 		  $part.'\');" name="HWVAL_'.
  334: 		    $Apache::inputtags::response[-1].':'.$temp.'">'.
  335: 		        $optionlist."</select>\n";
  336: 	    } else {
  337: 		$optionlist=' '.$temp.' '.$optionlist.' ';
  338: 	    }
  339: 	    my $text=$Apache::response::foilgroup{$name.'.text'};
  340: 	    if ($target ne 'tex') {
  341: 		if ($Apache::lonhomework::type ne 'exam') {
  342: 		    $result.='<br />'.$optionlist.$text."\n";
  343: 		} else {
  344: 		    $result.='<br />'.$text."\n";
  345: 		}
  346: 		if ($Apache::lonhomework::type eq 'exam') {
  347: 		    my @values=(1..scalar(@whichopt));
  348: 		    $result.=&Apache::optionresponse::webbubbles(\@values,\@whichopt,$temp,$lastopt);
  349: 		}
  350: 	    } else {
  351: 		if ($Apache::lonhomework::type eq 'exam') {
  352: 		    $result.='\vskip 0 mm   '.$text.' \vskip 0 mm '."\n";
  353: 		    $result.='\vskip -1 mm\noindent\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]'.&Apache::optionresponse::bubbles(\@alp,\@whichopt,'rankresponse').'\end{enumerate} \vskip -8 mm \strut ';
  354: 		    $internal_counter++;
  355: 		} else {
  356: 		    $result.=' \vskip 0mm \framebox[5 mm][s]{\tiny\strut} '.$text."\n";
  357: 		}
  358: 	    }
  359: 	    $temp++;
  360: 	}
  361:     }
  362:     if ($target eq 'web') {
  363: 	&Apache::response::setup_prior_tries_hash(\&format_prior_answer,
  364: 						  [\@whichfoils,
  365: 						   'submissiongrading']);
  366:     }
  367:     if ($target ne 'tex') {$result.="<br />";} else {$result.=' \vskip 0 mm ';}
  368:     return $result;
  369: }
  370: 
  371: sub getfoilcounts {
  372:     my ($max)=@_;
  373:     # +1 since instructors will count from 1
  374:     my $count = $#{ $Apache::response::foilgroup{'names'} }+1;
  375:     if (&Apache::response::showallfoils()) { $max=$count; }
  376:     if ($count>$max) { $count=$max } 
  377:     &Apache::lonxml::debug("Count is $count from $max");
  378:     return $count;
  379: }
  380: 
  381: sub whichfoils {
  382:     my ($max,$randomize)=@_;
  383:     return &Apache::response::whichorder($max,$randomize,
  384: 					 &Apache::response::showallfoils(),
  385: 					 \%Apache::response::foilgroup);
  386: }
  387: 
  388: sub start_conceptgroup {
  389:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  390:     $Apache::rankresponse::conceptgroup=1;
  391:     %Apache::response::conceptgroup=();
  392:     my $result;
  393:     if ($target eq 'edit') {
  394: 	$result.=&Apache::edit::tag_start($target,$token,
  395: 					  "Concept Grouped Foils");
  396: 	$result.=&Apache::edit::text_arg('Concept:','concept',$token,'50').
  397: 	    &Apache::edit::end_row().&Apache::edit::start_spanning_row();
  398:     }
  399:     if ($target eq 'modified') {
  400: 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
  401: 						     $safeeval,'concept');
  402: 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  403:     }
  404:     return $result;
  405: }
  406: 
  407: sub end_conceptgroup {
  408:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  409:     $Apache::rankresponse::conceptgroup=0;
  410:     my $result='';
  411:     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
  412: 	$target eq 'tex' || $target eq 'analyze') {
  413: 	#if not there aren't any foils to display and thus no question
  414: 	&Apache::response::pick_foil_for_concept($target,
  415: 						 ['value','text','location'],
  416: 						 \%Apache::hint::rank,
  417: 						 $parstack,$safeeval);
  418:     } elsif ($target eq 'edit') {
  419: 	$result=&Apache::edit::end_table();
  420:     }
  421:     return $result;
  422: }
  423: 
  424: sub insert_conceptgroup {
  425:     my $result="\n\t\t<conceptgroup concept=\"\">".&insert_foil()."\n\t\t</conceptgroup>\n";
  426:     return $result;
  427: }
  428: 
  429: sub start_foil {
  430:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  431:     my $result='';
  432:     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
  433: 	&Apache::lonxml::startredirection;
  434: 	if ($target eq 'analyze') {
  435: 	    &Apache::response::check_if_computed($token,$parstack,$safeeval,'value');
  436: 	}
  437:     } elsif ($target eq 'edit') {
  438: 	$result=&Apache::edit::tag_start($target,$token,"Foil");
  439: 	my $level='-2';
  440: 	if ($$tagstack[-2] eq 'conceptgroup') { $level = '-3'; }
  441: 	$result.=&Apache::edit::text_arg('Name:','name',$token);
  442: 	$result.= &Apache::edit::text_arg('Rank Value:','value',$token,'15');
  443: 	my $randomize=&Apache::lonxml::get_param('randomize',$parstack,
  444: 						 $safeeval,'-3');
  445: 	if ($randomize ne 'no') {
  446: 	    $result.=&Apache::edit::select_arg('Location:','location',
  447: 					     ['random','top','bottom'],$token);
  448: 	}
  449: 	$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
  450:     } elsif ($target eq 'modified') {
  451: 	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
  452: 						     $safeeval,'value',
  453: 						     'name','location');
  454: 	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  455:     }
  456:     return $result;
  457: }
  458: 
  459: sub end_foil {
  460:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  461:     my $text ='';
  462:     my $result = '';
  463:     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
  464: 	$text=&Apache::lonxml::endredirection;
  465:     }
  466:     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
  467: 	$target eq 'tex' || $target eq 'analyze') {
  468: 	my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
  469: 	if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
  470: 	    $text='\vskip 5mm $\triangleright$ '.$text;
  471: 	}
  472: 	if ($value ne 'unused') {
  473: 	    my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
  474: 	    &Apache::lonxml::debug("Got a name of :$name:");
  475: 	    if ($name eq "") {
  476: 		&Apache::lonxml::warning("Foils without names exist. This can cause problems to malfunction.");
  477: 		$name=$Apache::lonxml::curdepth;
  478: 	    }
  479: 	    &Apache::lonxml::debug("Using a name of :$name:");
  480: 	    if (defined($Apache::response::foilnames{$name})) {
  481: 		&Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name));
  482: 	    }
  483: 	    $Apache::response::foilnames{$name}++;
  484: 	    my $location =&Apache::lonxml::get_param('location',$parstack,
  485: 						     $safeeval);
  486: 	    if ( $Apache::rankresponse::conceptgroup
  487: 		 && !&Apache::response::showallfoils() ) {
  488: 		push @{ $Apache::response::conceptgroup{'names'} }, $name;
  489: 		$Apache::response::conceptgroup{"$name.value"} = $value;
  490: 		$Apache::response::conceptgroup{"$name.text"} = $text;
  491: 		$Apache::response::conceptgroup{"$name.location"} = $location;
  492: 	    } else {
  493: 		push @{ $Apache::response::foilgroup{'names'} }, $name;
  494: 		$Apache::response::foilgroup{"$name.value"} = $value;
  495: 		$Apache::response::foilgroup{"$name.text"} = $text;
  496: 		$Apache::response::foilgroup{"$name.location"} = $location;
  497: 	    }
  498: 	}
  499:     }
  500:     if ($target eq 'edit') {
  501: 	$result.= &Apache::edit::tag_end($target,$token,'');
  502:     }
  503:     return $result;
  504: }
  505: 
  506: sub insert_foil {
  507:     return '
  508: <foil name="" value="unused">
  509: <startouttext />
  510: <endouttext />
  511: </foil>';
  512: }
  513: 1;
  514: __END__

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