$\times\vphantom{1}$

$\textsf{One factor: }$

#4D4D4D

$\text{CHECK}$

$\text{TRY AGAIN}$

$\text{NEW PROBLEM}$

No selection allowed for all input boxes

Fix position and allow selection for all text objects

Empty all input boxes

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

Iterate

execute

\textsf{Complete the expression using \at least one prime factor.}

feedbackIndex = 3
bigPrimes = KeepIf(IsPrime[A], A, Sequence[12, 100])
randomList1 = Shuffle(Sequence[2, 99])
input1Prev = 5
input2Prev = 3
studentFactors: {1}
countQuestion = 1
compositeList = KeepIf((¬IsPrime[P]) ∧ bigPrimes \ PrimeFactors[P] ≟ bigPrimes, P, randomList1)
number = If(countQuestion ≟ 1, 21, compositeList(countQuestion))
n: number / Product[studentFactors]
feedbackNotPrimesEqual: "\text{" + (LaTeX[input1Prev]) + " is not a prime factor of " + (LaTeX[n]) + ".}"
feedbackNotPrimesDiff: "\text{Neither " + (LaTeX[input1Prev]) + " nor " + (LaTeX[input2Prev]) + " are prime \\factors of " + (LaTeX[n]) + ".}"
feedbackFactor1: "\text{" + (LaTeX[input1Prev]) + " is a prime factor but \\
\[" + (LaTeX[input1Prev]) + "\times" + (LaTeX[input2Prev]) + "\] is not " + (LaTeX[n]) + ".}"
feedbackFactor2: "\text{" + (LaTeX[input2Prev]) + " is a prime factor but \\\[" + (LaTeX[input1Prev]) + "\times" + (LaTeX[input2Prev]) + "\] is not " + (LaTeX[n]) + ".}"
input2 = NaN
InputBox2 = Textfield(input2)
input1 = NaN
InputBox1 = Textfield(input1)
studentFactorization = Take(Reverse[studentFactors], 2)
textFactorization: "\math{" + (LaTeX[If[Length[studentFactors] ≤ 1, "", LaTeX[studentFactorization(1)] + (If[Length[studentFactorization] > 1, ("" * Sum[Zip[If[F ≟ 1, "", " \times " + (LaTeX[F])], F, Take[studentFactorization, 2]]]), ""]) + (If[n ≠ 1, "\hspace{3}\times", ""])]]) + "}"
validate = false
nPrev: number / Product[studentFactors]
factors = Reverse(PrimeFactors[n])
iterations = Length(factors)
index = 3 (slider from 1 to 10, step 1)
Ctr = (0, 0)
TopPoint = Point(x = x(Ctr))
smallRad = miniRad(n, Ctr, TopPoint)
randomNum1 = Element(randomList1, Mod[countQuestion, 20] + 1)
correct1: factors ≟ {}
showanswer = false
countCorrect = 0
showhint = false
showbuttons = true
showhinttypicalerror = false
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
borderBox = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}])
unit = Circle(Ctr, TopPoint)
centers: {(-7.136767207166492, 3.681853475316208), (-4.213441814489286, 3.6818534753162067), (-5.675104510827889, 6.213527528902787), (-8.538402270305976, -2.4591109789121086), (-5.615076877628766, -2.4591109789121113), (-7.0767395739673695, 0.07256307467447431), (-4.611108095068266, -7.383782108993959), (-1.6877827023910543, -7.38378210899396), (-3.14944539872966, -4.852108055407374), (1.687782702391054, -7.383782108993959), (4.611108095068262, -7.38378210899396), (3.149445398729659, -4.852108055407377), (5.615076877628766, -2.4591109789121113), (8.538402270305975, -2.4591109789121113), (7.0767395739673695, 0.0725630746744721), (4.2134418144892845, 3.681853475316205), (7.1367672071664945, 3.6818534753162035), (5.6751045108278895, 6.213527528902788), (-1.4616626963386081, 6.4148397668110295), (1.4616626963386112, 6.414839766811029), (2.1912639027355015E-15, 8.946513820397621)}
splitTP: {(-7.136767207166492, 5.143516171654813), (-4.213441814489286, 5.143516171654811), (-5.675104510827889, 7.675190225241392), (-8.538402270305976, -0.9974482825735043), (-5.615076877628766, -0.9974482825735069), (-7.0767395739673695, 1.5342257710130787), (-4.611108095068266, -5.922119412655355), (-1.6877827023910543, -5.922119412655356), (-3.14944539872966, -3.39044535906877), (1.687782702391054, -5.922119412655355), (4.611108095068262, -5.922119412655356), (3.149445398729659, -3.3904453590687726), (5.615076877628766, -0.9974482825735069), (8.538402270305975, -0.9974482825735069), (7.0767395739673695, 1.5342257710130764), (4.2134418144892845, 5.1435161716548095), (7.1367672071664945, 5.143516171654808), (5.6751045108278895, 7.675190225241392), (-1.4616626963386081, 7.876502463149634), (1.4616626963386112, 7.876502463149633), (2.1912639027355015E-15, 10.408176516736226)}
oldCenters: {(-5.675104510827889, 4.525744826511734), (-7.07673957396737, -1.6152196277165816), (-3.14944539872966, -6.539890757798431), (3.1494453987296587, -6.539890757798432), (7.07673957396737, -1.6152196277165833), (5.6751045108278895, 4.525744826511732), (1.7778763659076045E-15, 7.25873111800656)}
oldSplitTP: {(-5.675104510827889, 7.675190225241394), (-7.07673957396737, 1.534225771013078), (-3.14944539872966, -3.3904453590687713), (3.1494453987296587, -3.390445359068772), (7.07673957396737, 1.5342257710130762), (5.6751045108278895, 7.675190225241392), (1.7778763659076045E-15, 10.40817651673622)}
A: centers(1)
B: centers(2)
rule: 500
enableBtnValidate: Defined[input1] ∧ Defined[input2]
AppSize = Corner(5)
feedbackText = Element({"", feedbackFactor1, feedbackFactor2, feedbackNotPrimesDiff, feedbackNotPrimesEqual}, feedbackIndex + 1)
clickingBox1 = Polygon({Corner[InputBox1, 1], Corner[InputBox2, 2], Corner[InputBox2, 3], Corner[InputBox1, 4]})
labelFactors: "" + (LaTeX[number]) + "=" + (LaTeX[textFactorization]) + ""
showfeedback = false
numRow = If(Defined[studentFactorization], Length[studentFactorization], 0)
C = Corner(labelFactors, 1)
widthLblFct: (x(Corner[5]) * (x(Corner[labelFactors, 3]) - x(Corner[labelFactors, 1])) / (x(Corner[3]) - x(Corner[1])))
xInputBox1: rule + widthLblFct - 5
showsolution: iterations ≟ 0
textSteps: "\math{" + (LaTeX[textStepsContent]) + "}"
currentStep: "\math{" + (LaTeX[((labelFactors * "\ ") * If[n > 1, ("" * n), ""])]) + "}"
yInputBox1: 104 + (28 * numRow)
textCaption: "" + (LaTeX[labelFactors]) + "\hspace{50}\times"
textFeedback: "\text{\color{" + (LaTeX[colorOrange]) + "}\textbf{Try again!}\\
\color{" + (LaTeX[colorGreyDark]) + "}" + (LaTeX[feedbackText]) + "}"
textSolution: "\text{\textbf{\[" + (LaTeX[labelFactors]) + "\]}\\\\\\
You found all prime factors of " + (LaTeX[number]) + "!
}"
circlesSol: {(x + 7.136767207166492)^(2) + (y - 3.681853475316208)^(2) = 1.968959543378996, (x + 4.213441814489286)^(2) + (y - 3.6818534753162067)^(2) = 1.968959543378996, (x + 5.675104510827889)^(2) + (y - 6.213527528902787)^(2) = 1.968959543378996, (x + 8.538402270305976)^(2) + (y + 2.4591109789121086)^(2) = 1.968959543378996, (x + 5.615076877628766)^(2) + (y + 2.4591109789121113)^(2) = 1.968959543378996, (x + 7.0767395739673695)^(2) + (y - 0.07256307467447431)^(2) = 1.968959543378996, (x + 4.611108095068266)^(2) + (y + 7.383782108993959)^(2) = 1.968959543378996, (x + 1.6877827023910543)^(2) + (y + 7.38378210899396)^(2) = 1.968959543378996, (x + 3.14944539872966)^(2) + (y + 4.852108055407374)^(2) = 1.968959543378996, (x - 1.687782702391054)^(2) + (y + 7.383782108993959)^(2) = 1.968959543378996, (x - 4.611108095068262)^(2) + (y + 7.38378210899396)^(2) = 1.968959543378996, (x - 3.149445398729659)^(2) + (y + 4.852108055407377)^(2) = 1.968959543378996, (x - 5.615076877628766)^(2) + (y + 2.4591109789121113)^(2) = 1.968959543378996, (x - 8.538402270305975)^(2) + (y + 2.4591109789121113)^(2) = 1.968959543378996, (x - 7.0767395739673695)^(2) + (y - 0.0725630746744721)^(2) = 1.968959543378996, (x - 4.2134418144892845)^(2) + (y - 3.681853475316205)^(2) = 1.968959543378996, (x - 7.1367672071664945)^(2) + (y - 3.6818534753162035)^(2) = 1.968959543378996, (x - 5.6751045108278895)^(2) + (y - 6.213527528902788)^(2) = 1.968959543378996, (x + 1.4616626963386081)^(2) + (y - 6.4148397668110295)^(2) = 1.968959543378996, (x - 1.4616626963386112)^(2) + (y - 6.414839766811029)^(2) = 1.968959543378996, x^(2) + (y - 8.946513820397621)^(2) = 1.968959543378996}
circles = Zip(Circle[A, (0.48 * Distance[centers(1), centers(2)])], A, centers)

Tool: PixelsToPoint
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: PixelsToPoint (command PixelsToPoint1)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: miniRad
(n,center,top point)
Input: n, Ctr, PMove
Output: miniRad

bigRad = Distance(Ctr, PMove)
miniRad: (bigRad * sin(pi / n) / (1 + sin(pi / n)))

Tool: splitCenters
(n, Ctr, TopPoint)
Input: n, Ctr, TopPoint
Output: centers

smallRad = miniRad(n, Ctr, TopPoint)
RefCenter = Intersect(Circle[TopPoint, smallRad], Segment[Ctr, TopPoint])
centers = Sequence(Rotate[RefCenter, ((k * 2) * pi / n), Ctr], k, 1, n)

Tool: splitTopPoints
(n,Ctr,TopPoint)
Input: n, Ctr, TopPoint
Output: bb

smallRad = miniRad(n, Ctr, TopPoint)
aa = splitCenters(n, Ctr, TopPoint)
bb: aa + (0, smallRad)

Tool: miniRad (command miniRad1)
(n,center,top point)
Input: n, Ctr, PMove
Output: miniRad

bigRad = Distance(Ctr, PMove)
miniRad: (bigRad * sin(pi / n) / (1 + sin(pi / n)))

Tool: split2CentersHor
(Ctr, TopPoint)
Input: Ctr, TopPoint
Output: centers

smallRad = miniRad(2, Ctr, TopPoint)
RefCenter = Intersect(Circle[TopPoint, smallRad], Segment[Ctr, TopPoint])
centers = Sequence(Rotate[RefCenter, (k * pi) + pi / 2, Ctr], k, 1, 2)

Tool: miniRad (command miniRad2)
(n,center,top point)
Input: n, Ctr, PMove
Output: miniRad

bigRad = Distance(Ctr, PMove)
miniRad: (bigRad * sin(pi / n) / (1 + sin(pi / n)))

Tool: split2CentersHor (command split2CentersHor1)
(Ctr, TopPoint)
Input: Ctr, TopPoint
Output: centers

smallRad = miniRad(2, Ctr, TopPoint)
RefCenter = Intersect(Circle[TopPoint, smallRad], Segment[Ctr, TopPoint])
centers = Sequence(Rotate[RefCenter, (k * pi) + pi / 2, Ctr], k, 1, 2)

Tool: split2TopPointsHor
(Ctr,TopPoint)
Input: Ctr, TopPoint
Output: bb

smallRad = miniRad(2, Ctr, TopPoint)
aa = split2CentersHor(Ctr, TopPoint)
bb: aa + (0, smallRad)