Tuesday, September 11, 2012

Generating a Randomized Test


Generating a Randomized Test
Teachers wishing to not have to stare down the back row can easily generate many versions of a test.
In the following, there are 1250 possible versions of problem 1 and 1,889,568 possible versions of problem two.
The first two blocks of code create two procedures.  The third block generates the test.
That generates a test without answers followed by the same test with answers.
The program is best run on the Classic Worksheet because it allows one to block and print the blocked selection.
Generate more versions by increasing the range of k.
> ComplexFraction[c2p19]:=proc(answer) 
local r1,r103,r103a,r103b,r103c,r103d,r103e,plist103,s103,s103a,s103b,s103c,s103d,s103e,s103f,s103g,s103h,clist103,ans103:
r1:=(-1)^rand(1..2)():r103:=rand(1..4)()*r1:
r103a:=rand(1..4)():r103b:=rand(1..4)()*r1:r103c:=rand(1..4)()*r1:
r103d:=-rand(1..2)():r103e:=-rand(1..2)():
printf("Simplify the complex fraction.\n");#with(combinat):
print([1/[r103+x]+r1/x]/[r103a+r103b/x]);
if answer = 1 then
print(Answer=simplify((1/(r103+x)+r1/x)/(r103a+r103b/x)));
fi:
end proc:

LinearEquation[c2p20]:=proc(answer) 
local r1103a,r1103b,r1103c,r1103d,r1103e:
r1103a:=(-1)^(rand(1..2)())*rand(2..9)():
r1103b:=(-1)^(rand(1..2)())*rand(2..9)():
r1103c:=(-1)^(rand(1..2)())*rand(2..9)():
r1103d:=(-1)^(rand(1..2)())*rand(2..9)():
r1103e:=(-1)^(rand(1..2)())*rand(2..9)():
printf("Solve.\n");
print(r1103a/(x+r1103b)+r1103d=r1103c/r1103e);
if answer = 1 then
print(x=solve(r1103a/(x+r1103b)+r1103d=r1103c/r1103e,x),x=evalf(solve(r1103a/(x+r1103b)+r1103d=r1103c/r1103e,x)));
#print(x=evalf(solve(r1103a/(x+r1103b)+r1103d=r1103c/r1103e,x)));
fi:end proc:


> printf("\nA Randomized Test with and without Answers\n");
for k from 1 to 2 do
for j from 1 to 2 do
randomize(k):
answers:=j-1:
printf("Problem 1, Version %d\n",k);
ComplexFraction[c2p19](answers);printf("\n\n\n");
printf("Problem 2, Version %d\n",k);
LinearEquation[c2p20](answers);printf("\n\n\n");
end do:end do:

A Randomized Test with and without Answers
Problem 1, Version 1
Simplify the complex fraction.



Problem 2, Version 1
Solve.



Problem 1, Version 1
Simplify the complex fraction.



Problem 2, Version 1
Solve.







Problem 1, Version 2
Simplify the complex fraction.




Problem 2, Version 2
Solve.




Problem 1, Version 2
Simplify the complex fraction.




Problem 2, Version 2
Solve.





No comments:

Post a Comment