File:  [LON-CAPA] / loncom / homework / radiobuttonresponse.pm
Revision 1.53: download - view: text, annotated - select for diffs
Thu Sep 26 21:45:53 2002 UTC (21 years, 7 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- hide and show locations properly

    1: # The LearningOnline Network with CAPA
    2: # mutliple choice style responses
    3: #
    4: # $Id: radiobuttonresponse.pm,v 1.53 2002/09/26 21:45:53 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: # 2/21 Guy
   29: 
   30: package Apache::radiobuttonresponse;
   31: use strict;
   32: use HTML::Entities();
   33: 
   34: BEGIN {
   35:   &Apache::lonxml::register('Apache::radiobuttonresponse',('radiobuttonresponse'));
   36: }
   37: 
   38: sub start_radiobuttonresponse {
   39:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   40:   my $result;
   41:   #when in a radiobutton response use these
   42:   &Apache::lonxml::register('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup'));
   43:   push (@Apache::lonxml::namespace,'radiobuttonresponse');
   44:   my $id = &Apache::response::start_response($parstack,$safeeval);
   45:   if ($target eq 'meta') {
   46:     $result=&Apache::response::meta_package_write('radiobuttonresponse');
   47:   } elsif ($target eq 'edit' ) {
   48:     $result.=&Apache::edit::start_table($token).
   49: 	'<tr><td>'.&Apache::lonxml::description($token)."</td><td>Delete:".
   50: 	&Apache::edit::deletelist($target,$token)
   51: 	."</td><td>&nbsp".&Apache::edit::end_row()
   52:         .&Apache::edit::start_spanning_row();
   53: 
   54:     $result.=
   55: 	&Apache::edit::text_arg('Max Number Of Shown Foils:','max',$token,'4').
   56: 	&Apache::edit::select_arg('Randomize Foil Order','randomize',
   57: 				  ['yes','no'],$token).
   58:         &Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n";
   59:   } elsif ($target eq 'modified') {
   60:     my $constructtag=&Apache::edit::get_new_args($token,$parstack,
   61: 						 $safeeval,'max','randomize');
   62:     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
   63:   } elsif ($target eq 'tex') {
   64:       $result .= '\begin{enumerate}';
   65:   }
   66:   return $result;
   67: }
   68: 
   69: sub end_radiobuttonresponse {
   70:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   71:   my $result;
   72:   if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
   73:   if ($target eq 'tex') { $result .= '\end{enumerate}'; }
   74:   &Apache::response::end_response;
   75:   pop @Apache::lonxml::namespace;
   76:   &Apache::lonxml::deregister('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup'));
   77:   return $result;
   78: }
   79: 
   80: %Apache::response::foilgroup=();
   81: sub start_foilgroup {
   82:   %Apache::response::foilgroup=();
   83:   $Apache::radiobuttonresponse::conceptgroup=0;
   84:   &Apache::response::setrandomnumber();
   85:   return '';
   86: }
   87: 
   88: sub storesurvey {
   89:   if ( !defined($ENV{'form.submitted'})) { return ''; }
   90:   my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
   91:   &Apache::lonxml::debug("Here I am!:$response:");
   92:   if ( $response !~ /[0-9]+/) { return ''; }
   93:   my $id = $Apache::inputtags::response['-1'];
   94:   my @whichfoils=@{ $Apache::response::foilgroup{'names'} };
   95:   my %responsehash;
   96:   $responsehash{$whichfoils[$response]}=$response;
   97:   $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=&Apache::lonnet::hash2str(%responsehash);
   98:   $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED';
   99:   &Apache::lonxml::debug("submitted a $response<br />\n");
  100:   return '';
  101: }
  102: 
  103: sub grade_response {
  104:   my ($max,$randomize)=@_;
  105:   if (!defined($ENV{'form.submitted'})) { return; }
  106:   my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
  107:   if ( $response !~ /[0-9]+/) { return; }
  108:   my $part=$Apache::inputtags::part;
  109:   my $id = $Apache::inputtags::response['-1'];
  110:   my ($answer,@whichfoils)=&whichfoils($max,$randomize);
  111:   my %responsehash;
  112:   $responsehash{$whichfoils[$response]}=$response;
  113:   my $responsestr=&Apache::lonnet::hash2str(%responsehash);
  114:   my %previous=&Apache::response::check_for_previous($responsestr,
  115: 						     $part,$id);
  116:   $Apache::lonhomework::results{"resource.$part.$id.submission"}=
  117:     $responsestr;
  118:   &Apache::lonxml::debug("submitted a $response<br />\n");
  119:   my $ad;
  120:   if ($response == $answer) {
  121:     $ad='EXACT_ANS';
  122:   } else {
  123:     $ad='INCORRECT';
  124:   }
  125:   $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
  126:   &Apache::response::handle_previous(\%previous,$ad);
  127: }
  128: 
  129: sub end_foilgroup {
  130:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  131: 
  132:   my $result;
  133:   if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex') {
  134:     my $style = $Apache::lonhomework::type;
  135:     if ( $style eq 'survey' ) {
  136:       if ($target eq 'web' || $target eq 'answer' || $target eq 'tex') {
  137: 	$result=&displayallfoils();
  138:       } elsif ( $target eq 'grade' ) {
  139: 	$result=&storesurvey();
  140:       }
  141:     } else {
  142:       my $name;
  143:       my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
  144:       my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
  145: 						 $safeeval,'-2');
  146:       if ($target eq 'web' || $target eq 'tex') {
  147: 	$result=&displayfoils($target,$max,$randomize);
  148:       } elsif ($target eq 'answer' ) {
  149: 	$result=&displayanswers($max,$randomize);
  150:       } elsif ( $target eq 'grade') {
  151: 	&grade_response($max,$randomize);
  152:       }
  153:     }
  154:   }
  155:   return $result;
  156: }
  157: 
  158: sub getfoilcounts {
  159:   my @names;
  160:   my $truecnt=0;
  161:   my $falsecnt=0;
  162:   my $name;
  163:   if ( $Apache::response::foilgroup{'names'} ) {
  164:     @names= @{ $Apache::response::foilgroup{'names'} };
  165:   }
  166:   foreach $name (@names) {
  167:     if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  168:       $truecnt++;
  169:     } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'false') {
  170:       $falsecnt++;
  171:     }
  172:   }
  173:   return ($truecnt,$falsecnt);
  174: }
  175: 
  176: sub displayallfoils {
  177:   my $result;
  178:   &Apache::lonxml::debug("survey style display");
  179:   my @names = @{ $Apache::response::foilgroup{'names'} };
  180:   my $temp=0;
  181:   my $id=$Apache::inputtags::response['-1'];
  182:   my $part=$Apache::inputtags::part;
  183:   my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
  184:   my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
  185:   if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/)  || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {
  186:     foreach my $name (@names) {
  187:       if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') {
  188: 	$result.="<br />".$Apache::response::foilgroup{$name.'.value'};
  189: 	if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  190: 	  $result.='<b>';
  191: 	}
  192: 	$result .= $Apache::response::foilgroup{$name.'.text'};
  193: 	if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  194: 	  $result.='</b>';
  195: 	}
  196:       }
  197:     }
  198:   } else {
  199:     foreach my $name (@names) {
  200:       if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') {
  201: 	$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" ";
  202: 	if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
  203: 	$result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n";
  204: 	$temp++;
  205:       }
  206:     }
  207:   }
  208:   return $result;
  209: }
  210: 
  211: sub whichfoils {
  212:   my ($max,$randomize)=@_;
  213: 
  214:   my @truelist;
  215:   my @falselist;
  216:   my @whichfalse =();
  217:   my ($truecnt,$falsecnt) = &getfoilcounts();
  218:   my $count=0;
  219:   # we will add in 1 of the true statements
  220:   if (($falsecnt+1)>$max) { $count=$max } else { $count=$falsecnt+1; }
  221:   my $answer=int(&Math::Random::random_uniform() * ($count));
  222:   &Apache::lonxml::debug("Count is $count, $answer is $answer");
  223:   my @names;
  224:   if ( $Apache::response::foilgroup{'names'} ) {
  225:       @names= @{ $Apache::response::foilgroup{'names'} };
  226:   }
  227:   if (&Apache::response::showallfoils()) {
  228:       @whichfalse=@names;
  229:   } elsif ($randomize eq 'no') {
  230:       &Apache::lonxml::debug("No randomization");
  231:       my $havetrue=0;
  232:       foreach my $name (@names) {
  233: 	  if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  234: 	      if (!$havetrue ) {
  235: 		  push(@whichfalse,$name); $havetrue++; $answer=$#whichfalse;
  236: 	      }
  237: 	  } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'false') {
  238: 	      push (@whichfalse,$name);
  239: 	  } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') {
  240: 	  } else {
  241: 	      &Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>"));
  242: 	  }
  243:       }
  244:   } else {
  245:     my $current=0;
  246:     &Apache::lonhomework::showhash(%Apache::response::foilgroup);
  247:     my (%top,%bottom);
  248:     #first find out where everyone wants to be
  249:     foreach my $name (@names) {
  250: 	$current++;
  251: 	if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  252: 	    push (@truelist,$name);
  253: 	    if ($Apache::response::foilgroup{$name.'.location'} eq 'top') {
  254: 		$top{$name}=$current;
  255: 	    } elsif ($Apache::response::foilgroup{$name.'.location'} eq 'bottom') {
  256: 		$bottom{$name}=$current;
  257: 	    }
  258: 	} elsif ($Apache::response::foilgroup{$name.'.value'} eq 'false') {
  259: 	    push (@falselist,$name);
  260: 	    if ($Apache::response::foilgroup{$name.'.location'} eq 'top') {
  261: 		$top{$name}=$current;
  262: 	    } elsif ($Apache::response::foilgroup{$name.'.location'} eq 'bottom') {
  263: 		$bottom{$name}=$current;
  264: 	    }
  265: 	} elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') {
  266: 	} else {
  267: 	    &Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>"));
  268: 	}
  269:     }
  270:     #pick a true statement
  271:     my $whichtrue = int(&Math::Random::random_uniform() * ($#truelist+1));
  272:     &Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue");
  273:     my $numinserted;
  274:     my (@toplist, @bottomlist);
  275:     my $topcount=0;
  276:     # assign everyone to either toplist/bottomlist or whichfalse
  277:     # which false is randomized, toplist bottomlist are in order
  278:     while ((($numinserted) < $max-1) && ($#falselist > -1)) {
  279: 	&Apache::lonxml::debug("Have $#whichfalse max is $max");
  280: 	my $afalse=int(&Math::Random::random_uniform() * ($#falselist+1));
  281: 	&Apache::lonxml::debug("From $#falselist elms, picking $afalse");
  282: 	$afalse=splice(@falselist,$afalse,1);
  283: 	&Apache::lonxml::debug("Picked $afalse");
  284: 	&Apache::lonhomework::showhash(('names'=>\@names));
  285: 	&Apache::lonhomework::showhash(%top);
  286: 	if ($top{$afalse}) {
  287: 	    $toplist[$top{$afalse}]=$afalse;
  288: 	    $topcount++;
  289: 	} elsif ($bottom{$afalse}) {
  290: 	    $bottomlist[$bottom{$afalse}]=$afalse;
  291: 	} else {
  292: 	    push (@whichfalse,$afalse);
  293: 	}
  294:     }
  295:     my $truename=$truelist[$whichtrue];
  296:     my $dosplice=1;
  297:     #insert the true statement, keeping track of where it wants to be
  298:     if ($Apache::response::foilgroup{$truename.'.location'} eq 'top' ) {
  299: 	$toplist[$top{$truename}]=$truename;
  300: 	$answer=-1;
  301: 	foreach my $top (reverse(@toplist)) {
  302: 	    if ($top) { $answer++;}
  303: 	    if ($top eq $truename) { last; }
  304: 	}
  305: 	$dosplice=0;
  306:     } elsif ($Apache::response::foilgroup{$truename.'.location'} eq 'bottom') {
  307: 	$bottomlist[$bottom{$truename}]=$truename;
  308: 	$answer=-1;
  309: 	foreach my $bot (@bottomlist) {
  310: 	    if ($bot) { $answer++;}
  311: 	    if ($bot eq $truename) { last; }
  312: 	}
  313: 	$answer+=$topcount+$#whichfalse+1;
  314: 	$dosplice=0;
  315:     } else {
  316: 	if ($topcount>0) { 
  317: 	  $answer = int(&Math::Random::random_uniform() * ($#whichfalse+1))
  318: 	    + $topcount;
  319: 	}
  320:     }
  321:     #add the top items to the top, bottom items to the bottom
  322:     for (my $i=0;$i<=$#toplist;$i++) {
  323: 	if ($toplist[$i]) { unshift(@whichfalse,$toplist[$i]) }
  324:     }
  325:     for (my $i=0;$i<=$#bottomlist;$i++) {
  326: 	if ($bottomlist[$i]) { push(@whichfalse,$bottomlist[$i]) }
  327:     }
  328:     #if the true statement is randomized insert it into the list
  329:     if ($dosplice) { splice(@whichfalse,$answer,0,$truelist[$whichtrue]); }
  330:   }
  331:   &Apache::lonxml::debug("Answer is $answer");
  332:   return ($answer,@whichfalse);
  333: }
  334: 
  335: sub displayfoils {
  336:   my ($target,$max,$randomize)=@_;
  337:   my $result;
  338: 
  339:   my ($answer,@whichfoils)=&whichfoils($max,$randomize);
  340:   if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {
  341:     foreach my $name (@whichfoils) {
  342:       if ($target ne 'tex') {
  343: 	  $result.="<br />";
  344:       } else {
  345: 	  $result.='\vskip 0 mm \item ';
  346:       }
  347:       if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { 
  348: 	  if ($target ne 'tex') { $result.='Correct:<b>'; } else { $result.='Correct: ';}
  349:       } else {
  350: 	$result.='Incorrect:';
  351:       }
  352:       if ($target ne 'tex') {
  353: 	  $result.=$Apache::response::foilgroup{$name.'.text'}."</input>\n";
  354:       } else {
  355: 	  $result.=$Apache::response::foilgroup{$name.'.text'};
  356:       }
  357:       if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
  358: 	  if ($target ne 'tex') { $result.='</b>';}
  359:       }
  360:     }
  361:   } else {
  362:     my $temp=0;
  363:     my $id=$Apache::inputtags::response['-1'];
  364:     my $part=$Apache::inputtags::part;
  365:     my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
  366:     my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
  367:     foreach my $name (@whichfoils) {
  368:       if ($target ne 'tex') {
  369: 	  $result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" ";
  370: 	  if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
  371: 	  $result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n";
  372:       } else {
  373: 	  $result .= '\item '.$Apache::response::foilgroup{$name.'.text'};
  374:       }
  375:       $temp++;
  376:     }
  377:   }
  378:   if ($target ne 'tex') { $result.="<br />"; } else { $result.='\vskip 0 mm '; }
  379:   return $result;
  380: }
  381: 
  382: sub displayanswers {
  383:   my ($max,$randomize)=@_;
  384:   my ($answer,@whichopt) = &whichfoils($max,$randomize);
  385:   my $result=&Apache::response::answer_header('radiobuttonresponse');
  386:   foreach my $name (@whichopt) {
  387:     $result.=&Apache::response::answer_part('radiobuttonresponse',
  388: 		     $Apache::response::foilgroup{$name.'.value'})
  389:   }
  390:   $result.=&Apache::response::answer_footer('radiobuttonresponse');
  391:   return $result;
  392: }
  393: 
  394: sub start_conceptgroup {
  395:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  396:   $Apache::radiobuttonresponse::conceptgroup=1;
  397:   %Apache::response::conceptgroup=();
  398:   my $result;
  399:   if ($target eq 'edit') {
  400:     $result.=&Apache::edit::tag_start($target,$token);
  401:     $result.=&Apache::edit::text_arg('Concept:','concept',$token,'50').
  402: 	&Apache::edit::end_row().&Apache::edit::start_spanning_row();
  403:   } elsif ($target eq 'modified') {
  404:     my $constructtag=&Apache::edit::get_new_args($token,$parstack,
  405: 						 $safeeval,'concept');
  406:     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  407:   }
  408:   return $result;
  409: }
  410: 
  411: sub end_conceptgroup {
  412:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  413:   $Apache::radiobuttonresponse::conceptgroup=0;
  414:   my $result;
  415:   if ($target eq 'web' || $target eq 'grade' || $target eq 'answer'  || $target eq 'tex') {
  416:     if (defined(@{ $Apache::response::conceptgroup{'names'} })) {
  417:       my @names = @{ $Apache::response::conceptgroup{'names'} };
  418:       my $pick=int(&Math::Random::random_uniform() * ($#names+1));
  419:       my $name=$names[$pick];
  420:       push @{ $Apache::response::foilgroup{'names'} }, $name;
  421:       $Apache::response::foilgroup{"$name.text"} =  $Apache::response::conceptgroup{"$name.text"};
  422:       $Apache::response::foilgroup{"$name.value"} = $Apache::response::conceptgroup{"$name.value"};
  423:       $Apache::response::foilgroup{"$name.location"} = $Apache::response::conceptgroup{"$name.location"};
  424:       my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval);
  425:       $Apache::response::foilgroup{"$name.concept"} = $concept;
  426:       &Apache::lonxml::debug("Selecting $name in $concept");
  427:     }
  428:   } elsif ($target eq 'edit') {
  429:     $result=&Apache::edit::end_table();
  430:   }
  431:   return $result;
  432: }
  433: 
  434: sub insert_conceptgroup {
  435:   my $result="\n\t\t<conceptgroup concept=\"\">".&insert_foil()."\n\t\t</conceptgroup>\n";
  436:   return $result;
  437: }
  438: 
  439: sub start_foil {
  440:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  441:   my $result='';
  442:   if ($target eq 'web' || $target eq 'tex') {
  443:     &Apache::lonxml::startredirection;
  444:   } elsif ($target eq 'edit') {
  445:     $result=&Apache::edit::tag_start($target,$token);
  446:     $result.=&Apache::edit::text_arg('Name:','name',$token);
  447:     $result.=&Apache::edit::select_or_text_arg('Correct Option:','value',
  448: 				       ['unused','true','false'],$token);
  449:     my $randomize=&Apache::lonxml::get_param('randomize',$parstack,
  450: 					     $safeeval,'-3');
  451:     if ($randomize ne 'no') {
  452:       $result.=&Apache::edit::select_arg('Location:','location',
  453: 					 ['random','top','bottom'],$token);
  454:     }
  455:     $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
  456:   } elsif ($target eq 'modified') {
  457:      my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,
  458: 						  'value','name','location');
  459:     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
  460:   } 
  461:   return $result;
  462: }
  463: 
  464: sub end_foil {
  465:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  466:   my $text='';
  467:   if ($target eq 'web' || $target eq 'tex') { $text=&Apache::lonxml::endredirection; }
  468:   if ($target eq 'web' || $target eq 'grade' || $target eq 'answer'  || $target eq 'tex') {
  469:     my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
  470:     if ($value ne 'unused') {
  471:       my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
  472:       my $location =&Apache::lonxml::get_param('location',$parstack,$safeeval);
  473:       if (!$name) { $name=$Apache::lonxml::curdepth; }
  474:       if ( $Apache::radiobuttonresponse::conceptgroup
  475: 	   && !&Apache::response::showallfoils() ) {
  476: 	push @{ $Apache::response::conceptgroup{'names'} }, $name;
  477: 	$Apache::response::conceptgroup{"$name.value"} = $value;
  478: 	$Apache::response::conceptgroup{"$name.text"} = $text;	
  479: 	$Apache::response::conceptgroup{"$name.location"} = $location;	
  480:       } else {
  481: 	push @{ $Apache::response::foilgroup{'names'} }, $name;
  482: 	$Apache::response::foilgroup{"$name.value"} = $value;
  483: 	$Apache::response::foilgroup{"$name.text"} = $text;
  484: 	$Apache::response::foilgroup{"$name.location"} = $location;
  485:       }
  486:     }
  487:   }
  488:   return '';
  489: }
  490: 
  491: sub insert_foil {
  492:   return '
  493: <foil name="" value="unused">
  494: <startouttext />
  495: <endouttext />
  496: </foil>';
  497: }
  498: 1;
  499: __END__
  500:  

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