File:  [LON-CAPA] / loncom / homework / default_homework.lcpm
Revision 1.127: download - view: text, annotated - select for diffs
Wed Mar 5 16:06:39 2008 UTC (16 years, 2 months ago) by www
Branches: MAIN
CVS tags: HEAD
Bug #4721: don't interpret whitespace in number as part of unit

    1: # The LearningOnline Network with CAPA 
    2: # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
    3: #
    4: # $Id: default_homework.lcpm,v 1.127 2008/03/05 16:06:39 www 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: #
   29: 
   30: #init some globals
   31: $hidden::RANDOMINIT=0;
   32: $pi=atan2(1,1)*4;
   33: $rad2deg=180.0/$pi;
   34: $deg2rad=$pi/180.0;
   35: $"=' ';
   36: use strict;
   37: {
   38:     my $n = 0;
   39:     my $total = 0;
   40:     my $num_left = 0;
   41:     my @order;
   42:     my $type;
   43: 
   44:     sub init_permutation {
   45: 	my ($size,$requested_type) = @_;
   46: 	@order = (0..$size-1);
   47: 	$n = $size;
   48: 	$type = $requested_type;
   49: 	if ($type eq 'ordered') {
   50: 	    $total = $num_left = 1;
   51: 	} elsif ($type eq 'unordered') {
   52: 	    $total = $num_left = &factorial($size);
   53: 	} else {
   54: 	    die("Unkown type: $type");
   55: 	}
   56:     }
   57: 
   58:     sub get_next_permutation {
   59: 	if ($num_left == $total) {
   60: 	    $num_left--;
   61: 	    return \@order;
   62: 	}
   63: 
   64: 	# Find largest index j with a[j] < a[j+1]
   65: 
   66: 	my $j = scalar(@order) - 2;
   67: 	while ($order[$j] > $order[$j+1]) {
   68: 	    $j--;
   69: 	}
   70: 
   71: 	# Find index k such that a[k] is smallest integer
   72: 	# greater than a[j] to the right of a[j]
   73: 
   74: 	my $k = scalar(@order) - 1;
   75: 	while ($order[$j] > $order[$k]) {
   76: 	    $k--;
   77: 	}
   78: 
   79: 	# Interchange a[j] and a[k]
   80: 
   81: 	@order[($k,$j)] = @order[($j,$k)];
   82: 
   83: 	# Put tail end of permutation after jth position in increasing order
   84: 
   85: 	my $r = scalar(@order) - 1;
   86: 	my $s = $j + 1;
   87: 
   88: 	while ($r > $s) {
   89: 	    @order[($s,$r)]=@order[($r,$s)];
   90: 	    $r--;
   91: 	    $s++;
   92: 	}
   93: 
   94: 	$num_left--;
   95: 	return(\@order);
   96:     }
   97:     
   98:     sub get_permutations_left {
   99: 	return $num_left;
  100:     }
  101: }
  102: 
  103: sub check_commas {
  104:     my ($response)=@_;
  105:     #print("$response ");
  106:     my @numbers=split(',',$response);
  107:     #print(" numbers ".join('-',@numbers)." ");
  108:     if (scalar(@numbers) > 1) {
  109:         #print(" numbers[0] ".$numbers[0]." "); 
  110: 	if (length($numbers[0]) > 3 || length($numbers[0]) == 0) { return -1; }
  111: 	shift(@numbers);
  112: 	#print(" numbers ".scalar(@numbers)." ");
  113: 	while (scalar(@numbers) > 1) {
  114: 	    #print(" numbers ".join('-',@numbers)." ");
  115: 	    if (length($numbers[0]) != 3) { return -2; }
  116: 	    shift(@numbers);
  117: 	}
  118: 	my ($number)=split('\.',$numbers[0]);
  119: 	#print(" number ".$number." ");
  120: 	#print(" numbers[0] ".$numbers[0]." ");
  121: 	if (length($number) != 3) { return -3; }
  122:     } else {
  123: 	my ($number)=split('\.',$numbers[0]);
  124: 	if (length($number) > 3) { return -4; }
  125:     }
  126:     return 1;
  127: }
  128: 
  129: 
  130: sub caparesponse_check {
  131:     my ($answer,$response)=@_;
  132:     #not properly used yet: calc
  133:     #not to be used: $ans_fmt
  134:     my $type=$LONCAPA::CAPAresponse_args{'type'};
  135:     my $tol=$LONCAPA::CAPAresponse_args{'tol'};
  136:     my $sig=$LONCAPA::CAPAresponse_args{'sig'};
  137:     my $ans_fmt=$LONCAPA::CAPAresponse_args{'format'};
  138:     my $unit=$LONCAPA::CAPAresponse_args{'unit'};
  139:     my $calc=$LONCAPA::CAPAresponse_args{'calc'};
  140:     my $samples=$LONCAPA::CAPAresponse_args{'samples'};
  141:     
  142:     my $tol_type=''; # gets it's value from whether tol has a % or not done
  143:     my $sig_lbound=''; #done
  144:     my $sig_ubound=''; #done
  145: 
  146: 
  147:     #type's definitons come from capaParser.h
  148: 
  149:     #remove leading and trailing whitespace
  150:     if (!defined($response)) {
  151: 	$response='';
  152:     }
  153:     if ($response=~ /^\s|\s$/) {
  154: 	$response=~ s:^\s+|\s+$::g;
  155: 	&LONCAPA_INTERNAL_DEBUG("Removed ws now :$response:");
  156:     }
  157: 
  158:     #&LONCAPA_INTERNAL_DEBUG(" type is $type ");
  159:     if ($type eq 'cs' || $type eq 'ci') {
  160: 	#for string answers make surec all places spaces occur, there is 
  161:         #really only 1 space, in both the answer and the response
  162: 	$answer=~s/ +/ /g;
  163: 	$response=~s/ +/ /g;
  164:     } elsif ($type eq 'mc') {
  165: 	$answer=~s/[\s,]//g;
  166: 	$response=~s/[\s,]//g;
  167:     }
  168:     if ($type eq 'float' && $unit=~/\$/) {
  169: 	if ($response!~/^\$|\$$/)  { return ('NO_UNIT', undef); }
  170: 	$response=~s/\$//g;
  171:     }
  172:     if ($type eq 'float' && $unit=~/\,/ && (&check_commas($response)<0)) {
  173: 	return "COMMA_FAIL:";
  174:     }
  175:     $ans_fmt=~s/\W//g;
  176:     $unit=~s/[\$,]//g;
  177:     if ($type eq 'float') { $response=~s/,//g; }
  178: 
  179:     if (length($response) > 500) { return ('TOO_LONG',undef); }
  180: 
  181:     if ($type eq '' ) {
  182: 	&LONCAPA_INTERNAL_DEBUG("Didn't find a type :$type: defaulting");
  183: 	if ( $answer eq ($answer *1.0)) { $type = 2;
  184: 				      } else { $type = 3; }
  185:     } else {
  186: 	if    ($type eq 'cs')    { $type = 4; }
  187: 	elsif ($type eq 'ci')    { $type = 3 }
  188: 	elsif ($type eq 'mc')    { $type = 5; }
  189: 	elsif ($type eq 'fml')   { $type = 8; }
  190:         elsif ($type eq 'math')  { $type = 9; }
  191: 	elsif ($type eq 'subj')  { $type = 7; }
  192: 	elsif ($type eq 'float') { $type = 2; }
  193: 	elsif ($type eq 'int')   { $type = 1; }
  194: 	else { return ('ERROR', "Unknown type of answer: $type") }
  195:     }
  196: 
  197:     my $points;
  198:     my $id_list;
  199:     #formula type setup the sample points
  200:     if ($type eq '8') {
  201: 	($id_list,$points)=split(/@/,$samples);
  202: 	&LONCAPA_INTERNAL_DEBUG("Found :$id_list:$points: points in $samples");
  203:     }
  204:     if ($tol eq '') {
  205: 	$tol=0.0;
  206: 	$tol_type=1; #TOL_ABSOLUTE
  207:     } else {
  208: 	if ($tol =~ /%$/) {
  209: 	    chop $tol;
  210: 	    $tol_type=2; #TOL_PERCENTAGE
  211: 	} else {
  212: 	    $tol_type=1; #TOL_ABSOLUTE
  213: 	}
  214:     }
  215: 
  216:     ($sig_ubound,$sig_lbound)=&LONCAPA_INTERNAL_get_sigrange($sig);
  217: 
  218:     my $reterror="";
  219:     my $result;
  220:     if ((($type eq '9') || ($type eq '8')) && ($response=~/\=/)) { return ('BAD_FORMULA','Please submit just an expression, not an equation.'); }
  221:     if ($type eq '9') {
  222:       $result = &maxima_check(&maxima_cas_formula_fix($response),&maxima_cas_formula_fix($answer),\$reterror);
  223:     } else {
  224: 	if ($type eq '8') { # fml type
  225: 	    $response = &capa_formula_fix($response);
  226: 	    $answer   = &capa_formula_fix($answer);
  227: 	}
  228:        $result = &caparesponse_capa_check_answer($response,$answer,$type,
  229: 						 $tol_type,$tol,
  230: 						 $sig_lbound,$sig_ubound,
  231: 						 $ans_fmt,$unit,$calc,$id_list,
  232: 						 $points,$external::randomseed,
  233: 						 \$reterror);
  234:     }
  235:     if    ($result == '1') { $result='EXACT_ANS'; } 
  236:     elsif ($result == '2') { $result='APPROX_ANS'; }
  237:     elsif ($result == '3') { $result='SIG_FAIL'; }
  238:     elsif ($result == '4') { $result='UNIT_FAIL'; }
  239:     elsif ($result == '5') { $result='NO_UNIT'; }
  240:     elsif ($result == '6') { $result='UNIT_OK'; }
  241:     elsif ($result == '7') { $result='INCORRECT'; }
  242:     elsif ($result == '8') { $result='UNIT_NOTNEEDED'; }
  243:     elsif ($result == '9') { $result='ANS_CNT_NOT_MATCH'; }
  244:     elsif ($result =='10') { $result='SUB_RECORDED'; }
  245:     elsif ($result =='11') { $result='BAD_FORMULA'; }
  246:     elsif ($result =='12' && !$response) { $result='MISSING_ANSWER'; }
  247:     elsif ($result =='12') { $result='WANTED_NUMERIC'; }
  248:     elsif ($result =='13') { $result='UNIT_INVALID_INSTRUCTOR'; }
  249:     elsif ($result =='141') { $result='UNIT_INVALID_STUDENT'; }
  250:     elsif ($result =='142') { $result='UNIT_INVALID_STUDENT'; }
  251:     elsif ($result =='143') { $result='UNIT_INVALID_STUDENT'; }
  252:     elsif ($result =='15') { $result='UNIT_IRRECONCIBLE'; }
  253:     else  {$result = "ERROR: Unknown Result:$result:$@:";}
  254: 
  255:     &LONCAPA_INTERNAL_DEBUG("RetError $reterror: Answer $answer: Response $response:  type-$type|$tol|$tol_type|$sig:$sig_lbound:$sig_ubound|$unit|");
  256:     &LONCAPA_INTERNAL_DEBUG(" $answer $response $result ");
  257:     return ($result,$reterror)
  258: }
  259: 
  260: 
  261: sub caparesponse_check_list {
  262:     my $responses=$LONCAPA::CAPAresponse_args{'response'};
  263: #    &LONCAPA_INTERNAL_DEBUG(" answer is ".
  264: #			    &LONCAPA_INTERNAL_Dumper($LONCAPA::CAPAresponse_answer).":\n");
  265: #    &LONCAPA_INTERNAL_DEBUG(" respons is ".
  266: #			    &LONCAPA_INTERNAL_Dumper($responses).":\n");
  267:     &LONCAPA_INTERNAL_DEBUG("args ".join(':',%LONCAPA::CAPAresponse_args));
  268:     my $type = $LONCAPA::CAPAresponse_args{'type'};
  269:     &LONCAPA_INTERNAL_DEBUG("Got type :$type:\n");
  270:     
  271:     my $num_input_lines =
  272: 	scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}});
  273:     
  274:     if ($type ne '' ) {
  275: 	if (scalar(@$responses) < $num_input_lines) {
  276: 	    return 'MISSING_ANSWER';
  277: 	}
  278: 	if (scalar(@$responses) > $num_input_lines) {
  279: 	    return 'EXTRA_ANSWER';
  280: 	}
  281: 
  282:     }
  283: 
  284:     foreach my $which (0..($num_input_lines-1)) {
  285: 	my $answer_size = 
  286: 	    scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}[$which]});
  287: 	if ($type ne '' 
  288: 	    && $answer_size > 1) {
  289: 	    $responses->[$which]=[split(/,/,$responses->[$which])];
  290: 	} else {
  291: 	    $responses->[$which]=[$responses->[$which]];
  292: 	}
  293:     }
  294: #    &LONCAPA_INTERNAL_DEBUG(" parsed response is ".
  295: #			    &LONCAPA_INTERNAL_Dumper($responses).":\n");
  296:     foreach my $which (0..($num_input_lines-1)) {
  297: 	my $answer_size = 
  298: 	    scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}[$which]});
  299: 	my $response_size = 
  300: 	    scalar(@{$responses->[$which]});
  301: 	if ($answer_size > $response_size) {
  302: 	    return 'MISSING_ANSWER';
  303: 	}
  304: 	if ($answer_size < $response_size) {
  305: 	    return 'EXTRA_ANSWER';
  306: 	}
  307:     }
  308: 
  309:     &LONCAPA_INTERNAL_DEBUG("Initial final response :$responses->[0][-1]:");
  310:     my $unit;
  311:     if ($type eq '' || $type eq 'float') {
  312: 	#for numerical problems split off the unit
  313: 	if ( $responses->[0][-1]=~ /(.*[^\s])\s+([^\s]+)/ ) {
  314: 	    $responses->[0][-1]=$1;
  315: 	    $unit=$2;
  316: 	}
  317:     }
  318:     &LONCAPA_INTERNAL_DEBUG("Final final response :$responses->[0][-1]:$unit:");
  319:     $unit=~s/\s//;
  320:     if ($unit ne '') {
  321: 	foreach my $response (@$responses) {
  322: 	    foreach my $element (@$response) {	
  323:                 $element =~ s/\s//g;    
  324: 		$element .= " $unit";
  325: 	    }
  326: 	}
  327:     }
  328:     
  329:     foreach my $thisanswer (@{ $LONCAPA::CAPAresponse_answer->{'answers'} }) {
  330: 	if (!defined($thisanswer)) {
  331: 	    return ('ERROR','answer was undefined');
  332: 	}
  333:     }
  334: 
  335: 
  336: #    &LONCAPA_INTERNAL_DEBUG(&LONCAPA_INTERNAL_Dumper($responses));
  337:     my %memoized;
  338:     if ($LONCAPA::CAPAresponse_answer->{'type'}  eq 'ordered') {
  339: 	for (my $i=0; $i<scalar(@$responses);$i++) {
  340: 	    my $answer   = $LONCAPA::CAPAresponse_answer->{'answers'}[$i];
  341: 	    my $response = $responses->[$i];
  342: 	    my $key = "$answer\0$response";
  343: 	    my (@awards,@msgs);
  344: 	    for (my $j=0; $j<scalar(@$response); $j++) { 
  345: 		my ($award,$msg) = &caparesponse_check($answer->[$j],
  346: 						       $response->[$j]);
  347: 		push(@awards,$award);
  348: 		push(@msgs,  $msg);
  349: 	    }
  350: 	    my ($award,$msg) = 
  351: 		&LONCAPA_INTERNAL_FINALIZEAWARDS(\@awards,\@msgs);
  352: 	    $memoized{$key} = [$award,$msg];
  353: 	}
  354:     } else {
  355: 	#FIXME broken with unorder responses where one is a <value>
  356:         #      and the other is a <vector> (need to delay parse til
  357:         #      inside the loop?)
  358: 	foreach my $response (@$responses) {
  359: 	    my $response_size = scalar(@{$response});
  360: 	    foreach my $answer (@{ $LONCAPA::CAPAresponse_answer->{'answers'} }) {
  361: 		my $key = "$answer\0$response";
  362: 		my $answer_size =  scalar(@{$answer});
  363: 		my ($award,$msg);
  364: 		if ($answer_size > $response_size) {
  365: 		    $award = 'MISSING_ANSWER';
  366: 		} elsif ($answer_size < $response_size) {
  367: 		    $award = 'EXTRA_ANSWER';
  368: 		} else {
  369: 		    my (@awards,@msgs);
  370: 		    for (my $j=0; $j<scalar(@$response); $j++) {
  371: 			my ($award,$msg) = &caparesponse_check($answer->[$j],
  372: 							       $response->[$j]);
  373: 			push(@awards,$award);
  374: 			push(@msgs,  $msg);
  375: 		    }
  376: 		    ($award,$msg) = 
  377: 			&LONCAPA_INTERNAL_FINALIZEAWARDS(\@awards,\@msgs);
  378: 		}
  379: 		$memoized{$key} = [$award,$msg];
  380: 	    }
  381: 	}
  382:     }
  383: 
  384:     my ($final_award,$final_msg);
  385:     &init_permutation(scalar(@$responses),
  386: 		      $LONCAPA::CAPAresponse_answer->{'type'});
  387: 
  388:     # possible FIXMEs
  389:     # - significant time is spent calling non-safe space routine
  390:     #   from safe space
  391:     # - early outs could be possible with classifying awards is to stratas
  392:     #   and stopping as so as hitting the top strata 
  393:     # - some early outs also might be possible with check ing the 
  394:     #   memoized hash of results (is correct even possible? etc.)
  395: 
  396:     my (@final_awards,@final_msg);
  397:     while( &get_permutations_left() ) {
  398: 	my $order = &get_next_permutation();
  399: 	my (@awards, @msgs, $i);
  400: 	foreach my $thisanswer (@{ $LONCAPA::CAPAresponse_answer->{'answers'} }) {
  401: 	    my $key = "$thisanswer\0".$responses->[$order->[$i]];
  402: 	    push(@awards,$memoized{$key}[0]);
  403: 	    push(@msgs,$memoized{$key}[1]);
  404: 	    $i++;
  405: 
  406: 	}
  407: 	&LONCAPA_INTERNAL_DEBUG(" all awards ".join(':',@awards));
  408: 
  409: 	my ($possible_award,$possible_msg) = 
  410: 	    &LONCAPA_INTERNAL_FINALIZEAWARDS(\@awards,\@msgs);
  411: 	&LONCAPA_INTERNAL_DEBUG(" pos awards ".$possible_award);
  412: 	push(@final_awards,$possible_award);
  413: 	push(@final_msg,$possible_msg);
  414:     }
  415: 
  416:     &LONCAPA_INTERNAL_DEBUG(" all final_awards ".join(':',@final_awards));
  417:     my ($final_award,$final_msg) = 
  418: 	&LONCAPA_INTERNAL_FINALIZEAWARDS(\@final_awards,\@final_msg,undef,1);
  419:     return ($final_award,$final_msg);
  420: }
  421: 
  422: sub cas {
  423:     my ($system,$input)=@_;
  424:     my $output;
  425:     if ($system eq 'maxima') {
  426:        $output=&maxima_eval($input);
  427:     }
  428:     return $output;
  429: }
  430: 
  431: sub tex {
  432:     if ( $external::target eq "tex" ) {
  433: 	return $_[0];
  434:     } else {
  435: 	return $_[1];
  436:     }
  437: }
  438: 
  439: sub var_in_tex {
  440:     if ( $external::target eq "tex" ) {
  441: 	return $_[0];
  442:     } else {
  443: 	return "";
  444:     }
  445: }
  446: 
  447: sub web {
  448:     if ( $external::target eq "tex" ) {
  449: 	return $_[1];
  450:     } else {
  451: 	if ( $external::target eq "web" || $external::target eq "answer") {
  452: 	    return $_[2];
  453: 	} else {
  454: 	    return $_[0];
  455: 	}
  456:     }
  457: }
  458: 
  459: sub html {
  460:     if ( $external::target eq "web" ) {
  461: 	return shift;
  462:     }
  463: }
  464: 
  465: sub hinton {
  466:     return 0;
  467: }
  468: 
  469: sub random {
  470:     my ($start,$end,$step)=@_;
  471:     if ( ! $hidden::RANDOMINIT ) {
  472: 	if ($external::randomseed == 0) { $external::randomseed=1; }
  473: 	if ($external::randomseed =~/,/) {
  474: 	    my ($num1,$num2)=split(/,/,$external::randomseed);
  475: 	    &random_set_seed(1,abs($num1));
  476: 	} elsif ($external::randomseed =~/:/) {
  477: 	    my ($num1,$num2)=split(/:/,$external::randomseed);
  478: 	    &random_set_seed(abs($num1),abs($num2));
  479: 	} else {
  480: 	    &random_set_seed(1,int(abs($external::randomseed)));
  481: 	}
  482: 	&math_random_uniform();
  483: 	$hidden::RANDOMINIT=1;
  484:     }
  485:     if (!defined($step)) { $step=1; }
  486:     my $num=1+int(($end-$start)/$step);
  487:     my $result=$start + int(&math_random_uniform() * $num)*$step;
  488:     return $result;
  489: }
  490: 
  491: sub random_normal {
  492:     my ($item_cnt,$seed,$av,$std_dev) = @_;
  493:     my @oldseed=&random_get_seed();
  494:     my @retArray;
  495:     &random_set_seed_from_phrase($seed);
  496:     @retArray=&math_random_normal($item_cnt,$av,$std_dev);
  497:     &random_set_seed(@oldseed);
  498:     return @retArray;
  499: }
  500: 
  501: sub random_beta {
  502:     my ($item_cnt,$seed,$aa,$bb) = @_;
  503:     my @oldseed=&random_get_seed();
  504:     my @retArray;
  505:     &random_set_seed_from_phrase($seed);
  506:     @retArray=&math_random_beta($item_cnt,$aa,$bb);
  507:     &random_set_seed(@oldseed);
  508:     return @retArray;
  509: }
  510: 
  511: sub random_gamma {
  512:     my ($item_cnt,$seed,$a,$r) = @_;
  513:     my @oldseed=&random_get_seed();
  514:     my @retArray;
  515:     &random_set_seed_from_phrase($seed);
  516:     @retArray=&math_random_gamma($item_cnt,$a,$r);
  517:     &random_set_seed(@oldseed);
  518:     return @retArray;
  519: }
  520: 
  521: sub random_exponential {
  522:     my ($item_cnt,$seed,$av) = @_;
  523:     my @oldseed=&random_get_seed();
  524:     my @retArray;
  525:     &random_set_seed_from_phrase($seed);
  526:     @retArray=&math_random_exponential($item_cnt,$av);
  527:     &random_set_seed(@oldseed);
  528:     return @retArray;
  529: }
  530: 
  531: sub random_poisson {
  532:     my ($item_cnt,$seed,$mu) = @_;
  533:     my @oldseed=&random_get_seed();
  534:     my @retArray;
  535:     &random_set_seed_from_phrase($seed);
  536:     @retArray=&math_random_poisson($item_cnt,$mu);
  537:     &random_set_seed(@oldseed);
  538:     return @retArray;
  539: }
  540: 
  541: sub random_chi {
  542:     my ($item_cnt,$seed,$df) = @_;
  543:     my @oldseed=&random_get_seed();
  544:     my @retArray;
  545:     &random_set_seed_from_phrase($seed);
  546:     @retArray=&math_random_chi_square($item_cnt,$df);
  547:     &random_set_seed(@oldseed);
  548:     return @retArray;
  549: }
  550: 
  551: sub random_noncentral_chi {
  552:     my ($item_cnt,$seed,$df,$nonc) = @_;
  553:     my @oldseed=&random_get_seed();
  554:     my @retArray;
  555:     &random_set_seed_from_phrase($seed);
  556:     @retArray=&math_random_noncentral_chi_square($item_cnt,$df,$nonc);
  557:     &random_set_seed(@oldseed);
  558:     return @retArray;
  559: }
  560: 
  561: sub random_f {
  562:     my ($item_cnt,$seed,$dfn,$dfd) = @_;
  563:     my @oldseed=&random_get_seed();
  564:     my @retArray;
  565:     &random_set_seed_from_phrase($seed);
  566:     @retArray=&math_random_f($item_cnt,$dfn,$dfd);
  567:     &random_set_seed(@oldseed);
  568:     return @retArray;
  569: }
  570: 
  571: sub random_noncentral_f {
  572:     my ($item_cnt,$seed,$dfn,$dfd,$nonc) = @_;
  573:     my @oldseed=&random_get_seed();
  574:     my @retArray;
  575:     &random_set_seed_from_phrase($seed);
  576:     @retArray=&math_random_noncentral_f($item_cnt,$dfn,$dfd,$nonc);
  577:     &random_set_seed(@oldseed);
  578:     return @retArray;
  579: }
  580: 
  581: sub random_multivariate_normal {
  582:     my ($item_cnt,$seed,$mean,$covar) = @_;
  583:     my @oldseed=&random_get_seed();
  584:     &random_set_seed_from_phrase($seed);
  585:     my @retArray=&math_random_multivariate_normal($item_cnt,@$mean,@$covar);
  586:     &random_set_seed(@oldseed);
  587:     return @retArray;
  588: }
  589: 
  590: sub random_multinomial {
  591:     my ($item_cnt,$seed,@p) = @_;
  592:     my @oldseed=&random_get_seed();
  593:     my @retArray;
  594:     &random_set_seed_from_phrase($seed);
  595:     my @retArray=&math_random_multinomial($item_cnt,@p);
  596:     &random_set_seed(@oldseed);
  597:     return @retArray;
  598: }
  599: 
  600: sub random_permutation {
  601:     my ($seed,@inArray) = @_;
  602:     my @oldseed=&random_get_seed();
  603:     my @retArray;
  604:     &random_set_seed_from_phrase($seed);
  605:     @retArray=&math_random_permutation(@inArray);
  606:     &random_set_seed(@oldseed);
  607:     return @retArray;
  608: }
  609: 
  610: sub random_uniform {
  611:     my ($item_cnt,$seed,$low,$high) = @_;
  612:     my @oldseed=&random_get_seed();
  613:     my @retArray;
  614:     &random_set_seed_from_phrase($seed);
  615:     @retArray=&math_random_uniform($item_cnt,$low,$high);
  616:     &random_set_seed(@oldseed);
  617:     return @retArray;
  618: }
  619: 
  620: sub random_uniform_integer {
  621:     my ($item_cnt,$seed,$low,$high) = @_;
  622:     my @oldseed=&random_get_seed();
  623:     my @retArray;
  624:     &random_set_seed_from_phrase($seed);
  625:     @retArray=&math_random_uniform_integer($item_cnt,$low,$high);
  626:     &random_set_seed(@oldseed);
  627:     return @retArray;
  628: }
  629: 
  630: sub random_binomial {
  631:     my ($item_cnt,$seed,$nt,$p) = @_;
  632:     my @oldseed=&random_get_seed();
  633:     my @retArray;
  634:     &random_set_seed_from_phrase($seed);
  635:     @retArray=&math_random_binomial($item_cnt,$nt,$p);
  636:     &random_set_seed(@oldseed);
  637:     return @retArray;
  638: }
  639: 
  640: sub random_negative_binomial {
  641:     my ($item_cnt,$seed,$ne,$p) = @_;
  642:     my @oldseed=&random_get_seed();
  643:     my @retArray;
  644:     &random_set_seed_from_phrase($seed);
  645:     @retArray=&math_random_negative_binomial($item_cnt,$ne,$p);
  646:     &random_set_seed(@oldseed);
  647:     return @retArray;
  648: }
  649: 
  650: sub abs { CORE::abs(shift) }
  651: sub sin { CORE::sin(shift) }
  652: sub cos { CORE::cos(shift) }
  653: sub exp { CORE::exp(shift) }
  654: sub int { CORE::int(shift) }
  655: sub log { CORE::log(shift) }
  656: sub atan2 { CORE::atan2($_[0],$_[1]) }
  657: sub sqrt { CORE::sqrt(shift) }
  658: 
  659: sub tan  { CORE::sin($_[0]) / CORE::cos($_[0]) }
  660: #sub atan { atan2($_[0], 1); }
  661: #sub acos { atan2(sqrt(1 - $_[0] * $_[0]), $_[0] ); }
  662: #sub asin { atan2($_[0], sqrt(1- $_[0] * $_[0]) );  }
  663: 
  664: sub log10 { CORE::log($_[0])/CORE::log(10); }
  665: 
  666: sub factorial {
  667:     my $input = CORE::int(shift);
  668:     return "Error - unable to take factorial of an negative number ($input)" if $input < 0;
  669:     return "Error - factorial result is greater than system limit ($input)" if $input > 170;
  670:     return 1 if $input == 0;
  671:     my $result = 1; 
  672:     for (my $i=2; $i<=$input; $i++) { $result *= $i }
  673:     return $result;
  674: }
  675: 
  676: sub sgn {
  677:     return -1 if $_[0] < 0;
  678:     return 0 if $_[0] == 0;
  679:     return 1 if $_[0] > 0;
  680: }
  681: 
  682: sub min {
  683:     my @sorted = sort { $a <=> $b || $a cmp $b } @_;
  684:     return shift @sorted;
  685: }
  686: 
  687: sub max {
  688:     my @sorted = sort { $a <=> $b || $a cmp $b } @_;
  689:     return pop @sorted;
  690: }
  691: 
  692: sub roundto {
  693:     my ($input,$n) = @_;
  694:     return sprintf('%.'.$n.'f',$input);
  695: }
  696: 
  697: sub to_string {
  698:     my ($input,$n) = @_;
  699:     return sprintf($input) if $n eq "";
  700:     $n = '.'.$n if $n !~ /^\./;
  701:     return sprintf('%'.$n,$input) if $n ne "";
  702: }
  703: 
  704: sub sub_string {
  705:     my ($str,$start,$len) = @_;
  706:     return substr($str,$start-1,$len);
  707: }
  708: 
  709: sub pow   {return $_[0] ** $_[1]; }
  710: sub ceil  {return (($_[0]-CORE::int($_[0]))== 0.0) ? $_[0] : (($_[0] > 0) ? (CORE::int($_[0])+ 1) : CORE::int($_[0])); }
  711: sub floor  {return (($_[0]-CORE::int($_[0]))== 0.0) ? $_[0] : (($_[0] > 0) ? CORE::int($_[0]) : (CORE::int($_[0])-1)); }
  712: #sub floor {return int($_[0]); }
  713: 
  714: sub format {
  715:     my ($value,$fmt)=@_;
  716:     my ($dollarmode,$commamode,$alwaysperiod,$options);
  717:     if ($fmt =~ /^([^\d]*)(.*)/) { $options=$1; $fmt=$2; } 
  718:     #if ($options =~ /\$/) { $dollamode=1; }
  719:     #if ($options =~ /,/)  { $commamode=1; }
  720:     if ($options =~ /\./) { $alwaysperiod=1; }
  721:     my $result;
  722:     if ($fmt=~/s$/i) {
  723: 	$result=&format_significant_figures($value,$fmt);
  724:     } else {
  725: 	$fmt=~s/e/E/g;
  726: 	$result=sprintf('%.'.$fmt,$value);
  727: 	if ($alwaysperiod && $fmt eq '0f') { $result .='.'; }
  728: 	$result=~s/(E[+-]*)0/$1/;
  729:     }
  730:     #if ($dollarmode) {$result=&dollarformat($result);}
  731:     #if ($commamode) {$result=&commaformat($result);}
  732:     return $result;
  733: }
  734: 
  735: sub chemparse {
  736:     my ($reaction) = @_;
  737:     my @tokens = split(/(\s\+|\->|<=>|<\-|\.)/,$reaction);
  738:     my $formula = '';
  739:     foreach my $token (@tokens) {
  740: 	if ($token eq '->' ) {
  741: 	    $formula .= '<m>\ensuremath{\rightarrow}</m> ';
  742: 	    next;
  743: 	}
  744: 	if ($token eq '<-' ) {
  745: 	    $formula .= '<m>\ensuremath{\leftarrow}</m> ';
  746: 	    next;
  747: 	}  
  748: 	if ($token eq '<=>') {
  749: 	    if ($external::target eq 'web' &&
  750: 		&EXT('request.browser.unicode')) {
  751: 		$formula .= '&#8652; ';
  752: 	    } else {
  753: 		$formula .= &web('<=> ','<m>\ensuremath{\rightleftharpoons}</m> ',
  754: 				 '&lt;=&gt; ');
  755: 	    }
  756: 	    next;
  757: 	}
  758: 	if ($token eq '.') {
  759: 	  $formula =~ s/(\&nbsp\;| )$//;
  760: 	  $formula .= '&middot;';
  761: 	  next;
  762: 	}
  763: 	$token =~ /^\s*([\d|\/]*(?:&frac\d\d)?)(.*)/;
  764:         $formula .= $1 if ($1 ne '1');  # stoichiometric coefficient
  765: 	
  766: 	my $molecule = $2;
  767: 	# subscripts
  768: 	$molecule =~ s|(?<=[a-zA-Z\)\]\s])(\d+)|<sub>$1</sub>|g;
  769: 	# superscripts
  770: 	$molecule =~ s|\^(\d*[+\-]*)|<sup>$1</sup>|g;
  771: 	# strip whitespace
  772: 	$molecule =~ s/\s*//g;
  773: 	# forced space
  774: 	$molecule =~ s/_/ /g;
  775: 	$molecule =~ s/-/&minus;/g;
  776: 	$formula .= $molecule.'&nbsp;';
  777:     }
  778:     # get rid of trailing space
  779:     $formula =~ s/(\&nbsp\;| )$//;
  780:     return &xmlparse($formula);
  781: }
  782: 
  783: sub prettyprint {
  784:     my ($value,$fmt,$target)=@_;
  785:     my $result;
  786:     if (!$target) { $target = $external::target; }
  787:     if ($fmt =~ /chem/i) { return(&chemparse($value)); }
  788:     my ($dollarmode,$commamode,$alwaysperiod,$options);
  789:     if ($fmt =~ /^([^\d]*)(.*)/) { $options=$1; $fmt=$2; } 
  790:     if ($options =~ /\$/) { $dollarmode=1; }
  791:     if ($options =~ /,/)  { $commamode=1; }
  792:     if ($options =~ /\./) { $alwaysperiod=1; }
  793:     if ($fmt=~/s$/i) {
  794: 	$value=&format_significant_figures($value,$fmt);
  795:     } elsif ($fmt) {
  796: 	$value=sprintf('%.'.$fmt,$value);
  797:     }
  798:     if ($alwaysperiod && $fmt eq '0f') {
  799: 	if ($target eq 'tex') {
  800: 	    $value .='\\ensuremath{.}';
  801: 	} else {
  802: 	    $value .='.';
  803: 	}
  804:     }
  805:     if ($value =~ /([0-9\.\-\+]+)E([0-9\-\+]+)/i ) {
  806: 	my $frac=$1;
  807: 	if ($dollarmode) { $frac=&dollarformat($frac); }
  808: 	if ($commamode) { $frac=&commaformat($frac); }
  809: 	my $exponent=$2;
  810: 	$exponent=~s/^\+0*//;
  811: 	$exponent=~s/^-0*/-/;
  812: 	$exponent=~s/^-0*/-/;
  813: 	if ($exponent eq '-') { undef($exponent); }
  814: 	if ($exponent) {
  815: 	    if ($target eq 'web') {
  816: 		$result=$frac.'&#215;10<sup>'.$exponent.'</sup>';
  817: 	    } elsif ($target eq 'tex') {
  818: 		$result='\ensuremath{'.$frac.'\times 10^{'.$exponent.'}}';
  819: 	    } else {
  820: 		$result=$value;
  821: 	    }
  822: 	} else {
  823: 	    $result=$frac;
  824: 	}
  825:     } else {
  826: 	$result=$value;
  827: 	if    ($dollarmode) { $result=&dollarformat($result,$target); }
  828: 	elsif ($commamode)  { $result=&commaformat($result,$target); }
  829:     }
  830:     return $result;
  831: }
  832: 
  833: sub commaformat {
  834:     my ($number,$target) = @_;
  835:     if ($number =~ /\./) {
  836: 	while ($number =~ /([^0-9]*)([0-9]+)([^\.,][^\.,][^\.,])([,0-9]*\.[0-9]*)$/) {
  837: 	    $number = $1.$2.','.$3.$4;
  838: 	}
  839:     } else {
  840: 	while ($number =~ /^([^0-9]*)([0-9]+)([^,][^,][^,])([,0-9]*)$/) {
  841: 	    $number = $1.$2.','.$3.$4;
  842: 	}
  843:     }
  844:     return $number;
  845: }
  846: 
  847: sub dollarformat {
  848:     my ($number,$target) = @_;
  849:     if (!$target) { $target = $external::target; }
  850:     $number=&commaformat($number,$target);
  851:     if ($target eq 'tex') {
  852: 	$number='\$'.$number; #' stupid emacs
  853:     } else {
  854: 	$number='$'.$number; #' stupid emacs
  855:     }
  856:     return $number; 
  857: }
  858: 
  859: # format of form ns or nS where n is an integer
  860: sub format_significant_figures {
  861:     my ($number,$format) = @_; 
  862:     return '0' if ($number == 0);
  863:     # extract number of significant figures needed
  864:     my ($sig) = ($format =~ /(\d+)s/i);
  865:     # arbitrary choice - suggestions ?? or throw error message?
  866:     $sig = 3 if ($sig eq '');
  867:     # save the minus sign
  868:     my $sign = ($number < 0) ? '-' : '';
  869:     $number = abs($number);
  870:     # needed to correct for a number greater than 1 (or
  871:     my $power = ($number < 1) ? 0 : 1;
  872:     # could round up. Take the integer part of log10.
  873:     my $x10 = int(log($number)/log(10));
  874:     # find number with values left of decimal pt = # of sign figs.
  875:     my $xsig = $number*10**($sig-$x10-$power);
  876:     # get just digits left of decimal pt - also rounds off correctly
  877:     my $xint  = sprintf('%.0f',$xsig);
  878:     # save any trailing zero's
  879:     my ($zeros) = ($xint =~ /(0+)$/);
  880:     # return number to original magnitude
  881:     my $numSig = $xint*10**($x10-$sig+$power);
  882:     # insert trailing zero's if have decimal point
  883:     $numSig =~ s/^(\d+)\.(\d+)(\e?(.*)?)$/$1\.$2$zeros$3/;
  884:     # put a decimal pt for number ending with 0 and length = # of sig fig
  885:     $numSig.='.' if (length($numSig) == $sig && $numSig =~ /0$/);
  886:     if (length($numSig) < $sig) {
  887: 	$numSig.='.'.substr($zeros,0,($sig-length($numSig)));
  888:     }
  889:     # return number with sign
  890:     return $sign.$numSig;
  891: 
  892: }
  893: 
  894: sub map {
  895:     my ($phrase,$dest,$source)=@_;
  896:     my @oldseed=&random_get_seed();
  897:     my @seed = &random_seed_from_phrase($phrase);
  898:     &random_set_seed(@seed);
  899:     my $destct = scalar(@$dest);
  900:     if (!$source) {
  901: 	my @output;
  902: 	my @idx = &math_random_permuted_index($destct);
  903: 	my $ctr = 0;
  904: 	while ($ctr < $destct) {
  905: 	    $output[$ctr] = $$dest[$idx[$ctr]];
  906: 	    $ctr++;
  907: 	}
  908:         &random_set_seed(@oldseed);
  909: 	return @output;
  910:     } else {
  911: 	my $num = scalar(@$source);
  912: 	my @idx = &math_random_permuted_index($num);
  913: 	my $ctr = 0;
  914: 	my $tot = $num;
  915: 	$tot = $destct if $destct < $num;
  916: 	if (ref($$dest[0])) {
  917: 	    while ($ctr < $tot) {
  918: 		${$$dest[$ctr]} = $$source[$idx[$ctr]];
  919: 	        $ctr++;
  920:             }
  921:         } else {
  922: 	    while ($ctr < $tot) {
  923: 		$$dest[$ctr] = $$source[$idx[$ctr]];
  924: 		$ctr++;
  925: 	    }
  926: 	}
  927:     }
  928:     &random_set_seed(@oldseed);
  929:     return '';
  930: }
  931: 
  932: sub rmap {
  933:     my ($phrase,$dest,$source)=@_;
  934:     my @oldseed=&random_get_seed();
  935:     my @seed = &random_seed_from_phrase($phrase);
  936:     &random_set_seed(@seed);
  937:     my $destct = scalar(@$dest);
  938:     if (!$source) {
  939: 	my @idx = &math_random_permuted_index($destct);
  940: 	my $ctr = 0;
  941: 	my @r_idx;
  942: 	while ($ctr < $destct) {
  943: 	    $r_idx[$idx[$ctr]] = $ctr;
  944: 	    $ctr++;
  945: 	}
  946: 	my @output;
  947: 	$ctr = 0;
  948: 	while ($ctr < $destct) {
  949: 	    $output[$ctr] = $$dest[$r_idx[$ctr]];
  950: 	    $ctr++;
  951: 	}
  952:         &random_set_seed(@oldseed);
  953: 	return @output;
  954:     } else {
  955: 	my $num = scalar(@$source);
  956: 	my @idx = &math_random_permuted_index($num);
  957: 	my $ctr = 0;
  958: 	my $tot = $num;
  959: 	$tot = $destct if $destct < $num;
  960: 	my @r_idx;
  961: 	while ($ctr < $tot) {
  962: 	    $r_idx[$idx[$ctr]] = $ctr;
  963: 	    $ctr++;
  964: 	}
  965: 	$ctr = 0;
  966: 	if (ref($$dest[0])) {
  967: 	    while ($ctr < $tot) {
  968: 		${$$dest[$ctr]} = $$source[$r_idx[$ctr]];
  969: 	        $ctr++;
  970:             }
  971:         } else {
  972: 	    while ($ctr < $tot) {
  973: 		$$dest[$ctr] = $$source[$r_idx[$ctr]];
  974: 		$ctr++;
  975: 	    }
  976: 	}
  977:     }
  978:     &random_set_seed(@oldseed);
  979:     return '';
  980: }
  981: 
  982: sub capa_id { return }
  983: 
  984: sub problem { return }
  985: 
  986: sub name{
  987:     my $fullname = &EXT('environment.lastname').', '.&EXT('environment.firstname').' '.&EXT('environment.middlename');
  988:     $fullname = "" if $fullname eq ",  ";
  989:     $fullname =~ s/\%2d/-/g;
  990:     return $fullname;
  991: }
  992: 
  993: sub student_number { 
  994:     my $id = &EXT('environment.id');
  995:     $id = '' if $id eq "";
  996:     return $id;
  997: }
  998: 
  999: sub class {
 1000:     my $course = &EXT('course.description');
 1001:     $course = '' if $course eq "";
 1002:     return $course;
 1003: }
 1004: 
 1005: sub firstname {
 1006:     my $firstname = &EXT('environment.firstname');
 1007:     $firstname = '' if $firstname eq "";
 1008:     return $firstname;
 1009: }
 1010:                                                                                 
 1011: sub lastname {
 1012:     my $lastname = &EXT('environment.lastname');
 1013:     $lastname = '' if $lastname eq "";
 1014:     return $lastname;
 1015: }
 1016: 
 1017: sub sec { 
 1018:     my $sec = &EXT('request.course.sec');
 1019:     $sec = '' if $sec eq "";
 1020:     return $sec;
 1021: }
 1022: 
 1023: sub open_date { 
 1024:     my @dc = split(/\s+/,localtime(&EXT('resource.0.opendate')));
 1025:     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
 1026:     my @hm = split(/:/,$dc[3]);
 1027:     my $ampm = " am";
 1028:     if ($hm[0] > 12) {
 1029: 	$hm[0]-=12;
 1030: 	$ampm = " pm";
 1031:     }
 1032:     return $dc[0].', '.$dc[1].' '.$dc[2].', '.$dc[4].' at '.$hm[0].':'.$hm[1].$ampm;
 1033: }
 1034: 
 1035: sub due_date { 
 1036:     my @dc = split(/\s+/,localtime(&EXT('resource.0.duedate')));
 1037:     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
 1038:     my @hm = split(/:/,$dc[3]);
 1039:     my $ampm = " am";
 1040:     if ($hm[0] > 12) {
 1041: 	$hm[0]-=12;
 1042: 	$ampm = " pm";
 1043:     }
 1044:     return $dc[0].', '.$dc[1].' '.$dc[2].', '.$dc[4].' at '.$hm[0].':'.$hm[1].$ampm;
 1045: }
 1046: 
 1047: sub answer_date { 
 1048:     my @dc = split(/\s+/,localtime(&EXT('resource.0.answerdate')));
 1049:     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
 1050:     my @hm = split(/:/,$dc[3]);
 1051:     my $ampm = " am";
 1052:     if ($hm[0] > 12) {
 1053: 	$hm[0]-=12;
 1054: 	$ampm = " pm";
 1055:     }
 1056:     return $dc[0].', '.$dc[1].' '.$dc[2].', '.$dc[4].' at '.$hm[0].':'.$hm[1].$ampm;
 1057: }
 1058: 
 1059: sub array_moments {
 1060:     my @input=@_;
 1061:     my (@output,$N);
 1062:     $N=scalar (@input);
 1063:     $output[0]=$N;
 1064:     if ($N <= 1) {
 1065: 	$output[1]=$input[0];
 1066: 	$output[1]="Input array not defined" if ($N == 0);
 1067: 	$output[2]="variance undefined for N<=1";
 1068: 	$output[3]="skewness undefined for N<=1";
 1069: 	$output[4]="kurtosis undefined for N<=1";
 1070: 	return @output;
 1071:     }
 1072:     my $sum=0;
 1073:     foreach my $line (@input) {
 1074: 	$sum+=$line;
 1075:     }
 1076:     $output[1] = $sum/$N;
 1077:     my ($x,$sdev,$var,$skew,$kurt) = 0;
 1078:     foreach my $line (@input) {
 1079: 	$x=$line-$output[1];
 1080: 	$var+=$x**2;
 1081: 	$skew+=$x**3;
 1082: 	$kurt+=$x**4;
 1083:     }
 1084:     $output[2]=$var/($N-1);
 1085:     $sdev=CORE::sqrt($output[2]);
 1086:     if ($sdev == 0) {
 1087: 	$output[3]="inf-variance=0";
 1088: 	$output[4]="inf-variance=0";
 1089: 	return @output;
 1090:     }
 1091:     $output[3]=$skew/($sdev**3*$N);
 1092:     $output[4]=$kurt/($sdev**4*$N)-3;
 1093:     return @output;
 1094: }
 1095: 
 1096: sub choose {
 1097:     my $num = $_[0];
 1098:     return $_[$num];
 1099: }
 1100: 
 1101: #&sum1(1,$x,sub { &sum1($_[0],2*$_[0], sub { fact($_[0])**2 })});
 1102: #sub sum1 {
 1103: #    my ($start,$end,$sub)=@_;
 1104: #    my $sum=0;
 1105: #    for (my $i=$start;$i<=$end;$i++) {
 1106: #        $sum+=&$sub($i);
 1107: #    }
 1108: #    return $sum
 1109: #}
 1110: 
 1111: #&sum2('a',1,$x,'&sum2(\'b\',$a,2*$a, \'&factorial($b)**2\')');
 1112: #sub sum2 {
 1113: #    my ($varname,$start,$end,$line)=@_;
 1114: #    my $sum=0;
 1115: #    for (my $i=$start;$i<=$end;$i++) {
 1116: #	my $func=sub {
 1117: #	    eval("\$".$varname."=$i");
 1118: #	    eval($line);
 1119: #	};
 1120: #        $sum+=&$func($i);
 1121: #    }
 1122: #    return $sum
 1123: #}
 1124: 
 1125: # expiremental idea
 1126: sub proper_path {
 1127:     my ($path)=@_;
 1128:     if ( $external::target eq "tex" ) {
 1129: 	return '/home/httpd/html'.$path;
 1130:     } else {
 1131: 	return $path;
 1132:     }
 1133: }
 1134: 

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