I thought that I had understood how to use unionTables, but seem to be
wrong. What I have here seems essentially the same as something that worked
in another problem, but either I have misunderstood where I can use the
tables or I have made one of my (sad to say) usual errors.
Here is the code
#DESCRIPTION
##Type of
#ENDDESCRIPTION
DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"PGgraphmacros.pl",
"MathObjects.pl",
"compoundProblem.pl",
"contextCurrency.pl",
"contextInequalities.pl",
"contextLeadingZero.pl",
"unionTables.pl",
"unionLists.pl",
"unionMacros.pl",
"contextTF.pl",
);
#for currency use context("Currency") then currency($A);
Context()->texStrings;
TEXT(beginproblem());
$showPartialCorrectAnswers = 1;
$a1=random(10,19,1)/10;
$a2=random(20,29,1)/10;
$a3=random(30,39,1)/10;
$a4=random(40,49,1)/10;
$ans1=String("T");
$b1=random(10,19,1)/10;
$b2=random(20,29,1)/10;
$b3=$b2;
$b4=random(40,49,1)/10;
$ans2=String("T");
$c1=random(10,19,1)/10;
$c2=random(20,29,1)/10;
$c3=random(30,39,1)/10;
$c4=random(40,49,1)/10;
$ans1=String("F");
$d1=random(10,19,1)/10;
$ans1=String("T");
Context()->texStrings;
BEGIN_TEXT
$PAR
For each of the following relation tables answer T if the relation is a function
and F if it is not.
$PAR
\{BeginTable().
AlignedRow ( [, 1, $a1, , 1, $b4, ,1, $c1, ,1 ,$d1],separation=>30,align=>"ri
ght").
AlignedRow ( [, 2, $a2, , 2, $b2, ,2, $c2, ,2 ,$d2],separation=>30,align=>"ri
ght").
AlignedRow ( [, 3, $a3, , 3, $b3, ,2, $c3, ,1 ,$d2],separation=>30,align=>"ri
ght").
AlignedRow ( [, 4, $a4, , 4, $b1, ,4, $c4, ,3 ,$d2],separation=>30,align=>"ri
ght").
AlignedRow([, ans_rule(2), , ans_rule(2),, ans_rule(2),,
ans_rule(2)],align=>"right")
.
EndTable() \}
END_TEXT
Context("TF");
ANS($ans1->cmp);
ENDDOCUMENT()
The display looks like this;
For each of the following relation tables answer T if the relation is a function and F if it is not.
\{
BeginTable(). AlignedRow ( [, 1, 1.9, , 1, 4.9, ,1, 1.1, ,1 ,1.7],separation=>30,align=>"right"). AlignedRow ( [, 2, 2.6, , 2, 2.7, ,2, 2.6, ,2 ,2.3],separation=>30,align=>"right"). AlignedRow ( [, 3, 3, , 3, 2.7, ,2, 3.2, ,1 ,2.3],separation=>30,align=>"right"). AlignedRow ( [, 4, 4.8, , 4, 1.7, ,4, 4.8, ,3 ,2.3],separation=>30,align=>"right"). AlignedRow([, ans_rule(2), , ans_rule(2),, ans_rule(2),, ans_rule(2)],align=>"right") . EndTable()
\}
Ken