(* 1. Complex addition       check
 2. Subtracting Quadratics       check
 3. Adding Quadratics            check
 4. Completing The Square        check
 5. Complex points     check
 6. Abs of complex      check
 7. Conjugate of complex   check
 8. quad function from graph    check
 9. Factoring
10. Finding zeros
11. function given vertex
12. Vertex from quad
13. complex subtraction
14. complex multiplication
15. complex division
16. Simple Complex Conjugate

1"Question Type...",2"★ All","▸ 3Quadtatics","   4Adding/Subtracting","   5Completing the Square","  6 Quadratic from Graph"," 7  Factoring"," 8  Finding Zeros","  9 Quadtratic from Vertex"," 10  Vertex from Quadratic","▸11 Complex Numbers"," 12  Adding/Subtracting"," 13  Multiplication/Division","  14 Complex Points"," 15  Absolute Value","  16 Complex Conjugate"
*)
ptotal=0;
pclick=0;
pright=0;
questionselect[]:=
Module[{plist},
pclick=0;
questiontype=If[qtype<3,RandomInteger[{1,12}],If[qtype==3,RandomChoice[{2,3,4,8,9,10,11,12}],If[qtype==4,RandomChoice[{2,3}],If[qtype==5,4,If[qtype==6,8,If[qtype==7,9,If[qtype==8,10,If[qtype==9,11,If[qtype==10,12,If[qtype==11,RandomChoice[{1,5,6,7,13,14,15,16}],If[qtype==12,RandomChoice[{1,14}],If[qtype==13,RandomChoice[{13,15}],If[qtype==14,5,If[qtype==15,6,RandomChoice[{7,16}]]]]]]]]]]]]]]];

If[questiontype==1,rannumone[],If[questiontype==2,rannumtwo[],If[questiontype==3,rannumthree[],If[questiontype==4,rannumfour[],If[questiontype==5,rannumfive[],If[questiontype==6,rannumsix[],If[questiontype==7,rannumseven[],If[questiontype==8,rannumeight[],If[questiontype==9,rannumnine[],If[questiontype==10,rannumten[],If[questiontype==11,rannumeleven[],If[questiontype==12,rannumtwelve[],If[questiontype==13,rannumthirteen[],If[questiontype==14,rannumfourteen[],If[questiontype==15,rannumfifteen[],If[questiontype==16,rannumsixteen[]]]]]]]]]]]]]]]]];]
(*Complex addition*)
rannumone[]:=
Module[{plist},
p=0;

m=RandomInteger[{-30,30}];
h=RandomInteger[{-30,30}];
k=RandomInteger[{-30,30}];
r=RandomInteger[{-30,30}];
j=RandomInteger[{-30,30}];
n=RandomInteger[{-30,30}];

w=m+r;
q=h+j;
t=m+h;
g=j+n;

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
ansplace=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];]
(*Subtracting Quadratics*)
rannumtwo[]:=
Module[{plist},
p=0;

m=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
h=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
k=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];

r=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
j=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
n=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];

w=m-r;
q=h-j;
t=k-n;
g=m+r;
v=h+j;
c=k+n;

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[g==0,"",If[g<0," -"," "]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0," -","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[g==0,"",If[g<0," "," -"]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," "," -"]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[g==0,"",If[g<0," -"," "]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[g==0,"",If[g<0," "," -"]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-",""]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," "," -"]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}]};

ansplace=Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}];]

(*Adding Quadratics*)
rannumthree[]:=
Module[{plist},
p=0;
m=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
h=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
k=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];

r=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
j=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];
n=RandomChoice[{-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12}];

w=m+r;
q=h+j;
t=k+n;
g=m-r;
v=h-j;
c=k-n;

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[g==0,"",If[g<0," -"," "]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[g==0,"",If[g<0," "," -"]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[c==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," "," -"]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[g==0,"",If[g<0," -"," "]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-","+"]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[g==0,"",If[g<0," "," -"]],Bold,Darker[Black],16],Style[If[g==0||Abs[g]==1,"",Abs[g]],Bold,Darker[Black],16],Style[If[g==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[v==0,"",If[w<0,"-",""]],Bold,Darker[Black],16],Style[If[v==0||Abs[v]==1,"",Abs[v]],Bold,Darker[Black],16],Style[If[v==0,"","x"],Bold,Darker[Black],16],Style[If[w==0,"",If[c<0,"-","+"]],Bold,Darker[Black],16],Style[If[c==0,"",Abs[c]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," "," -"]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}],Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}]};

ansplace=Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w==0,"",If[w<0," -"," "]],Bold,Darker[Black],16],Style[If[w==0||Abs[w]==1,"",Abs[w]],Bold,Darker[Black],16],Style[If[w==0,"","(x^2)"],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[If[q==0||Abs[q]==1,"",Abs[q]],Bold,Darker[Black],16],Style[If[q==0,"","x"],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[If[t==0,"",Abs[t]],Bold,Darker[Black],16]}];]

(*Completing the Square*)
rannumfour[]:=
Module[{plist},
p=0;
numt=RandomInteger[{1,24}];
m=RandomInteger[{-20,20}];
h=RandomChoice[{-16,-14,-12,-10,-8,-6,-4,-2,2,4,6,8,10,12,14,16}];
k=RandomChoice[{-16,-14,-12,-10,-8,-6,-4,-2,2,4,6,8,10,12,14,16}];
r=(((h/2))^2);

plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[(Sqrt[r]),Bold,14]}],Row[{Style[-r,Bold,14]}],Row[{Style[h,Bold,14]}],Row[{Style[(h^2),Bold,14]}]};
speciallure={Row[{Style[(Sqrt[r]),Bold,14]}],Row[{Style[-r,Bold,14]}],Row[{Style[h,Bold,14]}],Row[{Style[(h^2),Bold,14]}]};
ansplace=Row[{Style[r,Bold,14]}];
specialans=Row[{Style[r,Bold,14]}];]

(*  complex points *)
rannumfive[]:=
Module[{plist},
p=0;
numt=RandomInteger[{1,24}];
h=RandomInteger[{-10,10}];
j=RandomInteger[{-10,10}];

plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[h<0,"","-"],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"-",""],Bold,14],Style[Abs[j],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h-2],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j-2],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"","-"],Bold,14],Style[Abs[j+2],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}]};
speciallure=
{Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"","-"],Bold,14],Style[Abs[j],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[h<0,"","-"],Bold,14],Style[Abs[h-2],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j-2],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"-",""],Bold,14],Style[Abs[j+2],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}]};
ansplace=Row[{Style[If[h<0,"-",""],Bold,14],If[h==0,"",Style[Abs[h],Bold,14]],Style[If[j<0," - "," + "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}];
specialans=Row[{Style[If[h<0,"-",""],Bold,14],If[h==0,"",Style[Abs[h],Bold,14]],Style[If[j<0," - "," + "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}];]

(*abs of complex s*)
rannumsix[]:=
Module[{plist},
p=0;
bq=1;
numt=RandomInteger[{1,24}];
h=RandomInteger[{-10,10}];
j=RandomInteger[{-10,10}];
m=(Sqrt[(h^2)+(j^2)]);

plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Style[2m,Bold,14],
Style[4m,Bold,14],Style[-m,Bold,14],
Style[h+j,Bold,14]};
speciallure=
{Style[2m,Bold,14],
Style[4m,Bold,14],Style[-m,Bold,14],
Style[h+j,Bold,14]};

ansplace=Style[m,Bold,14];
specialans=Style[m,Bold,14];]

(*cojugate of complex*)
rannumseven[]:=
Module[{plist},
g=1;
p=0;
numt=RandomInteger[{1,24}];
h=RandomChoice[{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10}];
j=RandomChoice[{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10}];

plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[h<0,"","-"],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"-",""],Bold,14],Style[Abs[j],Bold,14],Style[If[h<0," - "," + "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h-2],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j-2],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"","-"],Bold,14],Style[Abs[j+2],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}]};
speciallure=
{Row[{Style[If[h<0,"","-"],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"-",""],Bold,14],Style[Abs[j],Bold,14],Style[If[h<0," - "," + "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h-2],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j-2],Bold,14],Style["I",Bold,14]}],
Row[{Style[If[j<0,"","-"],Bold,14],Style[Abs[j+2],Bold,14],Style[If[h<0," + "," - "],Bold,14],Style[Abs[h],Bold,14],Style["I",Bold,14]}]};
ansplace=Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}];
specialans=Row[{Style[If[h<0,"-",""],Bold,14],Style[Abs[h],Bold,14],Style[If[j<0," + "," - "],Bold,14],Style[Abs[j],Bold,14],Style["I",Bold,14]}];]

(*quad function from graph*)
rannumeight[]:=
Module[{plist},
p=0;
numt=RandomInteger[{1,24}];
g=RandomInteger[{-8,8}];
k=RandomInteger[{-8,8}];
a=RandomChoice[{-1,1}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
speciallure={Row[{Style[" y = -(",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[k==0,"",Style[If[k<0," - "," + "],Bold,14]],If[k==0,"",Style[Abs[(k^2)],Bold,14]],Style[")^2",Bold,14],If[g==0,"",If[g<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[g==0,"",Style[Abs[g],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}]};
luresplace={Row[{Style[" y = -(",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[k==0,"",Style[If[k<0," - "," + "],Bold,14]],If[k==0,"",Style[Abs[(k^2)],Bold,14]],Style[")^2",Bold,14],If[g==0,"",If[g<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[g==0,"",Style[Abs[g],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}]};
ansplace=Row[{Style[" y = ",Bold,14],Style[If[a<0,"-",""],Bold,14],Style["(",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}];specialans=Row[{Style[" y = ",Bold,14],Style[If[a<0,"-",""],Bold,14],Style["(",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}];]
(*Factoring*)
rannumnine[]:=
Module[{plist},
p=0;
numt=RandomInteger[{1,24}];
h=First[RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32},1]];

j=First[RandomChoice[Divisors[h],1]];
d=First[RandomChoice[Divisors[h],1]];
r=h/d;
q=h/j;
m=j+q;
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
speciallure={Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," + "," - "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")^2",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," - "," + "],Bold,14]],If[j==0,"",Style[Abs[j+1],Bold,14]],Style[")^2",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," - "," + "],Bold,14]],If[j==0,"",Style[Abs[j-1],Bold,14]],Style[")^2",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," + "," - "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")^2",Bold,14]}]};
luresplace=
{Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," + "," - "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")(x",Bold,14],If[q==0,"",If[q<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[q==0,"",Style[Abs[q],Bold,14]],Style[")",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," + "," - "],Bold,14]],If[j==0,"",If[Abs[j]==Abs[q],Style[Abs[j+1],Bold,14],Style[Abs[q],Bold,14]]],Style[")(x",Bold,14],If[q==0,"",If[q<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[q==0,"",If[Abs[j]==Abs[q],Style[Abs[q+1],Bold,14],Style[Abs[q],Bold,14]]],Style[")",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[d==0,"",Style[If[d<0," + "," - "],Bold,14]],If[d==0,"",Style[Abs[d],Bold,14]],Style[")(x",Bold,14],If[r==0,"",If[r<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[r==0,"",Style[Abs[r],Bold,14]],Style[")",Bold,14]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," - "," + "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")(x",Bold,14],If[q==0,"",If[q<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[q==0,"",Style[Abs[q],Bold,14]],Style[")",Bold,14]}]};
ansplace=Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," - "," + "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")^2",Bold,14]}];
specialans=Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[j==0,"",Style[If[j<0," - "," + "],Bold,14]],If[j==0,"",Style[Abs[j],Bold,14]],Style[")(x",Bold,14],If[q==0,"",If[q<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[q==0,"",Style[Abs[q],Bold,14]],Style[")",Bold,14]}];]
(*Finding zeros*)
rannumten[]:=
Module[{plist},
p=0;
bq=1;
numt=RandomInteger[{1,24}];
l=First[RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32},1]];

w=First[RandomChoice[Divisors[l],1]];
a=First[RandomChoice[Divisors[l],1]];
z=l/w;
c=l/a;
bq=z+w;
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
speciallure={Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"- ",""],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style["(Multiplicity 2)",Bold,14]}],
Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,""," - "],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style[" and ",Bold,14],If[w==0,"",If[w<0,Style["- ",Bold,14],Style["",Bold,14]]],If[w==0,"",Style[Abs[w],Bold,14]]}],
Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"","- "],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style["(Multiplicity 3)",Bold,14]}],
Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"","- "],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]]}]};
luresplace=
{Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"","- "],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style[" and ",Bold,14],If[w==0,"",If[w<0,Style["- ",Bold,14],Style["",Bold,14]]],If[w==0,"",Style[Abs[w],Bold,14]]}],
Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"-",""],Bold,14]],If[z==0,"",Style[If[Abs[z]==Abs[w],Abs[z+1],Abs[z]],Bold,14]],Style[" and ",Bold,14],If[w==0,"",If[w<0,Style["- ",Bold,14],Style["",Bold,14]]],If[w==0,"",Style[If[Abs[z]==Abs[w],Abs[w+1],Abs[w]],Bold,14]]}],
Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"-",""],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style[" and ",Bold,14],If[w==0,"",If[w<0,Style["",Bold,14],Style["-",Bold,14]]],If[w==0,"",Style[Abs[w],Bold,14]]}],
Row[{Style[" x = ",Bold,14],If[a==0,"",Style[If[a<0,"","- "],Bold,14]],If[a==0,"",Style[Abs[a],Bold,14]],Style[" and ",Bold,14],If[c==0,"",If[c<0,Style["- ",Bold,14],Style["",Bold,14]]],If[c==0,"",Style[Abs[c],Bold,14]]}]};

ansplace=Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,""," - "],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style["(Multiplicity 2)",Bold,14]}];
specialans=Row[{Style[" x = ",Bold,14],If[z==0,"",Style[If[z<0,"","-"],Bold,14]],If[z==0,"",Style[Abs[z],Bold,14]],Style[" and ",Bold,14],If[w==0,"",If[w<0,Style["",Bold,14],Style["-",Bold,14]]],If[w==0,"",Style[Abs[w],Bold,14]]}];]
(*Function given vertex*)
rannumeleven[]:=
Module[{plist},
g=1;
p=0;
numt=RandomInteger[{1,24}];
g=First[RandomChoice[{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},1]];
k=First[RandomChoice[{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},1]];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
speciallure={Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[k==0,"",Style[If[k<0," - "," + "],Bold,14]],If[k==0,"",Style[Abs[(k^2)],Bold,14]],Style[")^2",Bold,14],If[g==0,"",If[g<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[g==0,"",Style[Abs[g],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}]};
luresplace={Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," - "," + "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[k==0,"",Style[If[k<0," - "," + "],Bold,14]],If[k==0,"",Style[Abs[(k^2)],Bold,14]],Style[")^2",Bold,14],If[g==0,"",If[g<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[g==0,"",Style[Abs[g],Bold,14]]}],
Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" + ",Bold,14],Style[" - ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}]};
ansplace=Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}];
specialans=ansplace=Row[{Style[" y = (",Bold,14],Style["x",Bold,14],If[g==0,"",Style[If[g<0," + "," - "],Bold,14]],If[g==0,"",Style[Abs[g],Bold,14]],Style[")^2",Bold,14],If[k==0,"",If[k<0,Style[" - ",Bold,14],Style[" + ",Bold,14]]],If[k==0,"",Style[Abs[k],Bold,14]]}];]

(*Vertex from quad*)
rannumtwelve[]:=
Module[{plist},
p=0;
numt=RandomInteger[{1,24}];
h=RandomInteger[{-20,20}];
m=First[RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-12,-14,-15,-16,-18,-20,-21,-22,-24,-25,-26,-27,-28,-30,-32,-10,-9,-8,-6,-4,-2,2,4,6,8,9,10,12,14,15,16,18,20,21,22,24,25,26,27,28,30,32},1]];
g=First[RandomChoice[Divisors[m],1]/2];
n=-1*m/(2*g);
f=g(((n))^2)+m(n)+h;
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
speciallure={Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"","-"],Bold,14]],Style[If[n==0,1,Abs[n]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[If[n==0,2,Abs[n/2]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[If[n==0,3,Abs[2n]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[Abs[n],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style["",Bold,14],Style["-",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}]};
luresplace={Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"","-"],Bold,14]],Style[If[n==0,1,Abs[n]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[If[n==0,2,Abs[n/2]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[If[n==0,3,Abs[2n]],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}],
Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[Abs[n],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style["",Bold,14],Style["-",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}]};

ansplace=Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[Abs[n],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}];
specialans=ansplace=Row[{Style[" (",Bold,14],If[n==0,"",Style[If[n<0,"-",""],Bold,14]],Style[Abs[n],Bold,14],Style[",",Bold,14],If[f==0,"",If[f<0,Style[" -",Bold,14],Style["",Bold,14]]],Style[Abs[f],Bold,14],Style[")",Bold,14]}];]
(*Multiplying Complex*)
rannumthirteen[]:=
Module[{plist},
p=0;

m=RandomInteger[{-10,10}];
h=RandomInteger[{-10,10}];
k=RandomInteger[{-10,10}];
r=RandomInteger[{-10,10}];

(* (m+hi)(k+ri)  *)
w=m*k-h*r;  (* real part *)
q=m*r+h*k;(*imaginary part*)


numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
ansplace=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];]
(*Complex addition*)
rannumfourteen[]:=
Module[{plist},
p=0;

m=RandomInteger[{-30,30}];
h=RandomInteger[{-30,30}];
k=RandomInteger[{-30,30}];
r=RandomInteger[{-30,30}];
j=RandomInteger[{-30,30}];
n=RandomInteger[{-30,30}];

w=m-r;
q=h-j;
t=m-h;
g=j-n;

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[g<0,"-",""],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[t<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[t==0,"",If[t<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[t],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[g==0,"",If[g<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[g],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
ansplace=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];]
(*Multiplying Complex*)
rannumfifteen[]:=
Module[{plist},
p=0;

m=RandomInteger[{-10,10}];
h=RandomInteger[{-10,10}];
k=RandomInteger[{-10,10}];
r=RandomInteger[{-10,10}];

(* (m+hi)(k-ri)  *)
t=m*k+h*r;  (* real part *)
g=(-m*r)+(h*k);(*imaginary part*)
d=(k^2)+(r^2);
w=t/d;
q=g/d;

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[2w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w/2],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[w<0,"","-"],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[2w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w/2],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
ansplace=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];
specialans=Row[{Style[If[w<0,"-",""],Bold,Darker[Black],16],Style[Abs[w],Bold,Darker[Black],16],Style[If[q==0,"",If[q<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[q],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];]
rannumsixteen[]:=
Module[{plist},
p=0;

m=RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}];
h=RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}];
k=RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}];
r=RandomChoice[{-48,-36,-60,-81,-49,-72,-42,42,72,49,81,60,36,48,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-32,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}];

numt=RandomInteger[{1,24}];
plist:=Permutations[{1,2,3,4}];
ans:=plist[[numt]][[1]];
lures:=plist[[numt]][[2]];
luret:=plist[[numt]][[3]];
lurer:=plist[[numt]][[4]];
lurelist:=Permutations[{1,2,3,4}];
randomlure=RandomInteger[{1,24}];
wrongs:=lurelist[[randomlure]][[1]];
wrongt:=lurelist[[randomlure]][[2]];
wrongr:=lurelist[[randomlure]][[3]];
wronge:=lurelist[[randomlure]][[4]];
luresplace={Row[{Style[If[m<0,"-",""],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[m<0,"","-"],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[m<0,"","-"],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[h<0,"-",""],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style[If[m==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
speciallure=
{Row[{Style[If[m<0,"-",""],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[m<0,"","-"],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[m<0,"","-"],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}],Row[{Style[If[h<0,"-",""],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style[If[m==0,"",If[h<0,"-","+"]],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}]};
ansplace=Row[{Style[If[m<0,"-",""],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];
specialans=Row[{Style[If[m<0,"-",""],Bold,Darker[Black],16],Style[Abs[m],Bold,Darker[Black],16],Style[If[h==0,"",If[h<0,"+","-"]],Bold,Darker[Black],16],Style[Abs[h],Bold,Darker[Black],16],Style["I",Bold,Darker[Black],16]}];]
(* 1. Absolute Value Graphs       check
 2. Subtracting Quadratics       check
 3. Adding Quadratics            check
 4. Completing The Square        check
 5. Complex points     check
 6. Abs of complex      check
 7. Conjugate of complex   check
 8. quad function from graph    check
 9. Factoring
10. Finding zeros
11. Function given vertex
12. Vertex from quad

type: all, quadratics, complex numbers, absolute value
*)
grader[]:=Module[{plist},

If[And[p==ans,pclick==0],pright=pright+1];
If[pclick==0,ptotal=ptotal+1];
pclick=pclick+1;

]

Manipulate[
Column[{If[questiontype==1,Row[{Style["Simplify (",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0,"",Abs[m]],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"0",Abs[h]],Bold,Darker[Blue],16],Style["I) + (",Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-",""]],Bold,Darker[Blue],16],Style[If[r==0,"0",Abs[r]],Bold,Darker[Blue],16],Style[If[j==0,"",If[j<0,"-","+"]],Bold,Darker[Blue],16],Style[If[j==0,"0",Abs[j]],Bold,Darker[Blue],16],Style["I) ?",Bold,Darker[Blue],16]}],If[questiontype==2,Row[{Style["Which expression is equivalent to ",Bold,Darker[Blue],16],Style["(",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0||Abs[m]==1,"",Abs[m]],Bold,Darker[Blue],16],Style[If[m==0,"","(x^2)"],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0||Abs[h]==1,"",Abs[h]],Bold,Darker[Blue],16],Style[If[h==0,"","x"],Bold,Darker[Blue],16],Style[If[k==0,"",If[k<0,"-","+"]],Bold,Darker[Blue],16],Style[If[k==0,"",Abs[k]],Bold,Darker[Blue],16],Style[")",Bold,Darker[Blue],16],Style[" - ",Bold,Darker[Blue],16],Style["(",Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-",""]],Bold,Darker[Blue],16],Style[If[r==0||Abs[r]==1,"",Abs[r]],Bold,Darker[Blue],16],Style[If[r==0,"","(x^2)"],Bold,Darker[Blue],16],Style[If[j==0,"",If[j<0,"-","+"]],Bold,Darker[Blue],16],Style[If[j==0||Abs[j]==1,"",Abs[j]],Bold,Darker[Blue],16],Style[If[j==0,"","x"],Bold,Darker[Blue],16],Style[If[n==0,"",If[n<0,"-","+"]],Bold,Darker[Blue],16],Style[If[n==0,"",Abs[n]],Bold,Darker[Blue],16],Style[") ?",Bold,Darker[Blue],16]}],If[questiontype==3,Row[{Style["Which expression is equivalent to ",Bold,Darker[Blue],16],Style["(",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0||Abs[m]==1,"",Abs[m]],Bold,Darker[Blue],16],Style[If[m==0,"","(x^2)"],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0||Abs[h]==1,"",Abs[h]],Bold,Darker[Blue],16],Style[If[h==0,"","x"],Bold,Darker[Blue],16],Style[If[k==0,"",If[k<0,"-","+"]],Bold,Darker[Blue],16],Style[If[k==0,"",Abs[k]],Bold,Darker[Blue],16],Style[")",Bold,Darker[Blue],16],Style[" + ",Bold,Darker[Blue],16],Style["(",Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-",""]],Bold,Darker[Blue],16],Style[If[r==0||Abs[r]==1,"",Abs[r]],Bold,Darker[Blue],16],Style[If[r==0,"","(x^2)"],Bold,Darker[Blue],16],Style[If[j==0,"",If[j<0,"-","+"]],Bold,Darker[Blue],16],Style[If[j==0||Abs[j]==1,"",Abs[j]],Bold,Darker[Blue],16],Style[If[j==0,"","x"],Bold,Darker[Blue],16],Style[If[n==0,"",If[n<0,"-","+"]],Bold,Darker[Blue],16],Style[If[n==0,"",Abs[n]],Bold,Darker[Blue],16],Style[") ?",Bold,Darker[Blue],16]}],If[questiontype==4,Row[{Style["To complete the square, which number should be added to both sides of ",Bold,Darker[Blue],16],Style[If[m==0,"","(x^2)"],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0||Abs[h]==1,"",Abs[h]],Bold,Darker[Blue],16],Style[If[h==0,"","x"],Bold,Darker[Blue],16],Style[If[k==0,"",If[k<0,"-","+"]],Bold,Darker[Blue],16],Style[If[k==0,"",Abs[k]],Bold,Darker[Blue],16],Style[" = ",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[Abs[m],Bold,Darker[Blue],16],Style[" ?",Bold,Darker[Blue],16]}],If[questiontype==9,Row[{Style["Factor the following ",Bold,Darker[Blue],16],Style["y = ",Bold,Darker[Blue],16],Style["(x^2)",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-","+"]],Bold,Darker[Blue],16],Style[If[m==0||m==1||m==-1,"",Abs[m]],Bold,Darker[Blue],16],Style[If[m==0,"","x"],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"",Abs[h]],Bold,Darker[Blue],16],Style[".",Bold,Darker[Blue],16]}],If[questiontype==10,Row[{Style["What are the zeros of ",Bold,Darker[Blue],16],Style["y = ",Bold,Darker[Blue],16],Style["(x^2)",Bold,Darker[Blue],16],Style[If[bq==0,"",If[bq<0,"-","+"]],Bold,Darker[Blue],16],Style[If[bq==0||bq==1||bq==-1,"",Abs[bq]],Bold,Darker[Blue],16],Style[If[bq==0,"","x"],Bold,Darker[Blue],16],Style[If[l==0,"",If[l<0,"-","+"]],Bold,Darker[Blue],16],Style[If[l==0,"",Abs[l]],Bold,Darker[Blue],16],Style["?",Bold,Darker[Blue],16]}],If[questiontype==11,Row[{Style["What function represents ",Bold,Darker[Blue],16],Style["y = ",Bold,Darker[Blue],16],Style["(x^2)",Bold,Darker[Blue],16],Style[" with a vertex at ",Bold,Darker[Blue],16],Style["(",Bold,Darker[Blue],16],Style[g,Bold,Darker[Blue],16],Style[",",Bold,Darker[Blue],16],Style[k,Bold,Darker[Blue],16],Style[")?",Bold,Darker[Blue],16]}],If[questiontype==12,Row[{Style["Which represents the vertex of ",Bold,Darker[Blue],16],Style["y = ",Bold,Darker[Blue],16],Style[If[g==0,"",If[g<0,"-",""]],Bold,Darker[Blue],16],Style[If[Abs[g]==1,"",Abs[g]],Bold,Darker[Blue],16],Style["(x^2)",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-","+"]],Bold,Darker[Blue],16],Style[If[m==0||m==1||m==-1,"",Abs[m]],Bold,Darker[Blue],16],Style[If[m==0,"","x"],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"",Abs[h]],Bold,Darker[Blue],16],Style[".",Bold,Darker[Blue],16]}],If[questiontype==5,Column[{Style["Which complex number is represented by the point below?",Bold,Darker[Blue],16],Plot[12,{x,-10,10},PlotRange->{-11,11},AxesLabel->{"Real","Imaginary"},LabelStyle->Directive[Darker[Blue],16,Bold],ImageSize->Large,Epilog->{PointSize[Large],Darker[Blue],Point[{h,j}]},GridLines->{{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}},GridLinesStyle->Directive[GrayLevel[.85],Thickness[.001]]]}],If[questiontype==6,Column[{Style["What is the absolute value, |a+bI|, of complex number below?",Bold,Darker[Blue],16],Plot[13,{x,-10,10},PlotRange->{-11,11},AxesLabel->{"Real","Imaginary"},LabelStyle->Directive[Darker[Blue],16,Bold],ImageSize->Large,Epilog->{PointSize[Large],Darker[Magenta],Point[{h,j}]},GridLines->{{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}},GridLinesStyle->Directive[GrayLevel[.85],Thickness[.001]]]}],If[questiontype==7,Column[{Row[{Style["What is the complex ",Bold,Darker[Blue],16],Style["conjugate ",Bold,Darker[Blue],Underlined,16],Style["of the point below?",Bold,Darker[Blue],16]}],Plot[13,{x,-10,10},PlotRange->{-11,11},AxesLabel->{"Real","Imaginary"},LabelStyle->Directive[Darker[Blue],16,Bold],ImageSize->Large,Epilog->{PointSize[Large],Darker[Magenta],Point[{h,j}]},GridLines->{{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}},GridLinesStyle->Directive[GrayLevel[.85],Thickness[.001]]]}],If[questiontype==13,Row[{Style["Simplify (",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0,"",Abs[m]],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"0",Abs[h]],Bold,Darker[Blue],16],Style["I)(",Bold,Darker[Blue],16],Style[If[k==0,"",If[k<0,"-",""]],Bold,Darker[Blue],16],Style[If[k==0,"0",Abs[k]],Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-","+"]],Bold,Darker[Blue],16],Style[If[r==0,"0",Abs[r]],Bold,Darker[Blue],16],Style["I) ?",Bold,Darker[Blue],16]}],If[questiontype==14,Row[{Style["Simplify (",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0,"",Abs[m]],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"0",Abs[h]],Bold,Darker[Blue],16],Style["I)-(",Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-",""]],Bold,Darker[Blue],16],Style[If[r==0,"0",Abs[r]],Bold,Darker[Blue],16],Style[If[j==0,"",If[j<0,"-","+"]],Bold,Darker[Blue],16],Style[If[j==0,"0",Abs[j]],Bold,Darker[Blue],16],Style["I) ?",Bold,Darker[Blue],16]}],If[questiontype==15,Row[{Style["Simplify (",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0,"",Abs[m]],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"0",Abs[h]],Bold,Darker[Blue],16],Style["I)÷(",Bold,Darker[Blue],16],Style[If[k==0,"",If[k<0,"-",""]],Bold,Darker[Blue],16],Style[If[k==0,"0",Abs[k]],Bold,Darker[Blue],16],Style[If[r==0,"",If[r<0,"-","+"]],Bold,Darker[Blue],16],Style[If[r==0,"0",Abs[r]],Bold,Darker[Blue],16],Style["I) ?",Bold,Darker[Blue],16]}],If[questiontype==16,Row[{Style["What is the complex conjugate of ",Bold,Darker[Blue],16],Style[If[m==0,"",If[m<0,"-",""]],Bold,Darker[Blue],16],Style[If[m==0,"",Abs[m]],Bold,Darker[Blue],16],Style[If[h==0,"",If[h<0,"-","+"]],Bold,Darker[Blue],16],Style[If[h==0,"0",Abs[h]],Bold,Darker[Blue],16],Style["I ?",Bold,Darker[Blue],16]}],Column[{Style["Which quadratic function is graphed below?",Bold,Darker[Blue],16],Plot[a*(((x-g))^2)+k,{x,-10,10},PlotRange->{-11,11},AxesLabel->{"x","y"},LabelStyle->Directive[Darker[Blue],16,Bold],ImageSize->Large,Epilog->{PointSize[Large],Darker[Magenta],Point[{g,k}]},GridLines->{{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10},{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}},GridLinesStyle->Directive[GrayLevel[.85],Thickness[.001]]]}]]]]]]]]]]]]]]]],
Row[{Style[If[p==0,"         ",Column[If[p==ans,If[p==1,{Style["Correct! ",Bold,Darker[Green]],"","","","","",""},If[p==2,{"","",Style["Correct! ",Bold,Darker[Green]],"","","",""},If[p==3,{"","","","",Style["Correct! ",Bold,Darker[Green]],"",""},{"","","","","","",Style["Correct! ",Bold,Darker[Green]]}]]],If[p==1,{Style["Try Again! ",Bold,Darker[Red]],"","","","","",""},If[p==2,{"","",Style["Try Again! ",Bold,Darker[Red]],"","","",""},If[p==3,{"","","","",Style["Try Again! ",Bold,Darker[Red]],"",""},{"","","","","","",Style["Try Again! ",Bold,Darker[Red]]}]]]]]]],Column[{Row[{Button["A",{p=1,grader[]}],"  ",If[ans==1,If[j==q,ansplace,specialans],If[j!=q,luresplace[[wrongs]],speciallure[[wrongs]]]]}],
Row[{Button["B",{p=2,grader[]}],"  ",If[ans==2,If[j==q,ansplace,specialans],If[j!=q,luresplace[[wrongt]],speciallure[[wrongt]]]]}],
Row[{Button["C",{p=3,grader[]}],"  ",If[ans==3,If[j==q,ansplace,specialans],If[j!=q,luresplace[[wrongr]],speciallure[[wrongr]]]]}],
Row[{Button["D",{p=4,grader[]}],"  ",If[ans==4,If[j==q,ansplace,specialans],If[j!=q,luresplace[[wronge]],speciallure[[wronge]]]]}]}],Row[{"        ",Column[{Row[{Style["   Correct: ",Bold,16,Darker[Green]],Style[pright,Bold,16,Darker[Green]]}],Row[{Style["Inncorrect: ",Bold,16,Darker[Red]],Style[ptotal-pright,Bold,16,Darker[Red]]}]}],"  "Style[If[ptotal==0,"___",N[100*pright/ptotal,3]],Bold,16,Darker[Blue]],Style["%",Bold,16,Darker[Blue]]}]}]},FrameStyle->Directive[Thickness[.2],Darker[Blue]],Background->GrayLevel[1]],Row[{Style["  Chapter 5: Quadratic Functions  ",20,Darker[Magenta]],PopupView[{"Question Type...","★ All","▸ Quadtatics","    Adding/Subtracting","    Completing the Square","    Quadratic from Graph","    Factoring","    Finding Zeros","    Quadtratic from Vertex","    Vertex from Quadratic","▸ Complex Numbers","    Adding & Subtracting","    Multiplication/Division","    Complex Points","    Absolute Value","    Complex Conjugate"},Dynamic[qtype]],"    ",Button["New Problem",questionselect[]]}],Paneled->False,SaveDefinitions->True]