\textsf{Recall that }ax\textsf{ is }a\textsf{ times }x.

\textsf{Beware of the order of operations.}

\textsf{Distribute }x\textsf{ through the sum}\
\textsf{to check whether the expressions}\
\textsf{are the equivalent.}

\textsf{Beware of the difference}\\textsf{between }\frac{a}{b}\textsf{ and }\frac{b}{a}.

\textsf{A constant term is a term without}\\textsf{variables. For example, in }2x+5,\ 2x\textsf{ and }5\textsf{ are terms, and }5\\textsf{is the constant term.}

\textsf{An equation is a mathematical}\\textsf{statement with an 'equal to'}\\textsf{symbol between two expressions.}\\textsf{For example, }3x + 5 = 15 \\textsf{is an equation.}

\textsf{An expression is a sentence with a}\\textsf{minimum of two numbers or }\\textsf{variables and at least one math}\\textsf{operation in it. For example }\x + y + 4\textsf{ is an expression.}

\textsf{The power or exponent of a}\
\textsf{number says how many times to}\
\textsf{use the number in a multiplication.}\
\textsf{For example in }2 ^ 3=2\times2\times2 ,\;\2\textsf{ is the base and }3 
\textsf{ is the power}\\textsf{or exponent}.

\textsf{A term can be a number, a variable,}\
\textsf{product of two or more variables or}\
\textsf{product of a number and a variable. }\
\textsf{For example in the expression }\2x + y + 5\textsf{ there are three terms.}

\textsf{A coefficient is a number multiplied}\\textsf{by a variable. For example, in the}\\textsf{expression }2x +1,\; 2\textsf{ is the}\\textsf{coefficient of }x.

\textsf{A variable is a letter that represents}\\textsf{an unknown quantity. For example,}\\textsf{in the expression } x + y,\; x \textsf{ and }y\\textsf{are variables.}

\text{Drag into the blank}

#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$a=\vphantom{b}$

$b=$

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{}

#eeeeee

#2E006758

#2EB00020

\text{Drag the correct description into the blank.} 

Organize

box1

\textsf{There are three terms in this}\
\textsf{expression}

E = (-0.4283316790324938, 1.994621885465043)
D = (-3.088815691374957, 1.994621885465043)
hei: 0.33
countQuestion = 0
randomList2 = Shuffle(Sequence[15])
q11Hints: {"", hintOrder, hintOrder, hintOrder}
q6Hints: {"", hintEquation, hintOrder, hintConstant}
q12Hints: {"", hintExponent, hintConstant, hintExponent}
q5Hints: {"", hintQ5, hintConstant, hintExponent}
q15Hints: {"", hintConstant, hintConstant, hintTerm}
q14Hints: {"", hintCoefficient, hintQ14, hintTerm}
q9Hints: {"", hintExponent, hintCoefficient, hintExponent}
q4Hints: {"", hintDivision, hintCoefficient, hintDivision}
q3Hints: {"", hintConstant, hintCoefficient, hintTerm}
q2Hints: {"", hintEquation, hintCoefficient, hintConstant}
q13Hints: {"", hintExpression, hintVariable, hintCoefficient}
q10Hints: {"", hintEquation, hintCoefficient, hintVariable}
q8Hints: {"", hintVariable, hintVariable, hintCoefficient}
q7Hints: {"", hintCoefficient, hintVariable, hintTerm}
q1Hints: {"", hintVariable, hintEquation, hintTerm}
hintsAll: {q1Hints, q2Hints, q3Hints, q4Hints, q5Hints, q6Hints, q7Hints, q8Hints, q9Hints, q10Hints, q11Hints, q12Hints, q13Hints, q14Hints, q15Hints}
MoveBox1 = (-3.0885264821336476, 1.2000000000000002)
MoveBox2 = (-3.0885264821336476, 0.8)
MoveBox3 = (-3.0885264821336476, 0.4)
MoveBox4 = (-3.0885264821336476, 0)
randomn = Shuffle(Sequence[2, 4])
coeffn = Element(randomn, Mod[countQuestion, 3] + 1)
f9 = Simplify((0 * x) + y^(coeffn))
f12 = Simplify(x^(coeffn) + (0 * y))
randoma = Shuffle(Sequence[2, 9])
coeffa = Element(randoma, Mod[countQuestion, Length[randoma]] + 1)
randomb = Shuffle(Sequence[2, 9] \ {coeffa})
coeffb = Element(randomb, Mod[countQuestion, Length[randomb]] + 1)
f5 = Simplify((coeffa * x^(coeffn)) + (coeffb * y))
f1 = Simplify(coeffa + (0 * x) + (coeffb * y))
f7 = Simplify(((coeffa * x) * y) + coeffb)
f8 = Simplify((coeffa * y) + (coeffb * x))
f11 = Simplify(coeffa - (coeffb * x) + (0 * y))
f13 = Simplify((0 * x) + (coeffa * y) + coeffb)
f14 = Simplify((0 * x) + (coeffa * y) + coeffb)
f15 = Simplify(((coeffa * x) * y) + (coeffb * x) + 9)
f2 = Simplify(((coeffa + 1) * x) - (coeffb * y) + coeffa)
f3 = Simplify((coeffa * x) - (0 * y) - coeffb)
expressionQ11 = Text((((coeffa * "-") * coeffb) * "x"))
expressionQ1 = Text((((coeffa * "+") * coeffb) * "y"))
f4 = Simplify((0 * x) + coeffa / y)
f6 = Simplify((coeffa * (x + y)))
f10 = Simplify((x + y) / coeffa)
l1: {f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15}
n = Element(randomList2, Mod[countQuestion, Length[randomList2]] + 1)
expressionNoQ1Q11: "" + (LaTeX[If[n ≟ 4 ∨ n ≟ 10, "\scriptsize"]]) + "" + (LaTeX[If[n ≠ 11 ∧ n ≠ 1, Element[l1, n]]]) + "" + (LaTeX[If[n ≟ 8 ∨ n ≟ 13, ("=" * coeffb)]]) + ""
textPrompt = TableText({If[n ≟ 1, expressionQ1, n ≟ 11, expressionQ11, expressionNoQ1Q11]}, "c", 400, 38)
wid: 2.66
MoveBox12: MoveBox1 + (wid, 0)
MoveBox22: MoveBox2 + (wid, 0)
MoveBox32: MoveBox3 + (wid, 0)
MoveBox42: MoveBox4 + (wid, 0)
MoveBox14: MoveBox1 + (0, hei)
MoveBox13: MoveBox1 + (wid, hei)
box1, movebox1, movebox12, movebox13, movebox14 = Polygon(MoveBox1, MoveBox12, MoveBox13, MoveBox14)
MoveBox23: MoveBox2 + (wid, hei)
MoveBox24: MoveBox2 + (0, hei)
box2, movebox2, movebox22, movebox23, movebox24 = Polygon(MoveBox2, MoveBox22, MoveBox23, MoveBox24)
MoveBox34: MoveBox3 + (0, hei)
MoveBox33: MoveBox3 + (wid, hei)
box3, movebox3, movebox32, movebox33, movebox34 = Polygon(MoveBox3, MoveBox32, MoveBox33, MoveBox34)
MoveBox43: MoveBox4 + (wid, hei)
MoveBox44: MoveBox4 + (0, hei)
box4, movebox4, movebox42, movebox43, movebox44 = Polygon(MoveBox4, MoveBox42, MoveBox43, MoveBox44)
droparea = Translate(Polygon[{D, D - (0, hei), E - (0, hei), E}], (0, -0.07))
box1InReg = Defined(IndexOf[true, Sequence[IsInRegion[Vertex[box1, ii], droparea], ii, 1, 4]])
box2InReg = Defined(IndexOf[true, Sequence[IsInRegion[Vertex[box2, ii], droparea], ii, 1, 4]])
box3InReg = Defined(IndexOf[true, Sequence[IsInRegion[Vertex[box3, ii], droparea], ii, 1, 4]])
box4InReg = Defined(IndexOf[true, Sequence[IsInRegion[Vertex[box4, ii], droparea], ii, 1, 4]])
InsertedText = IndexOf(true, {box1InReg, box2InReg, box3InReg, box4InReg})
inputSaved: {NaN, NaN}
expression, f, g, h, i = Polygon(D, E, E + (0, hei), D + (0, hei))
inputCurrent: {box1InReg, box2InReg, box3InReg, box4InReg}
tableQ9 = TableText(Append[Flatten[Sequence[{"\hspace{-10}y", "\hspace{-10}\times"}, i, 1, coeffn - 1]], "\hspace{-10}y"])
randomList1 = Shuffle(Flatten[Sequence[{1, 2, 3, 4}, ii, 1, 5]])
randomNum1 = Element(randomList1, Mod[countQuestion, Length[randomList1]] + 1)
RanPositionsOrder = Shuffle(Sequence[4] \ {randomNum1})
B = (5.000341064524864, 5.69392166828734)
input2 = NaN
input1 = NaN
randomNum2 = Element(randomList2, Mod[countQuestion, 15] + 1)
correct1: input1 ≟ randomNum1
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct2: input2 ≟ randomNum2
correct: box1InReg
showbuttons = true
typicalError1: 0
typicalError2: 0
helpTextHintTypicalError: "" + (LaTeX[Element[Element[hintsAll, n], If[Defined[InsertedText], InsertedText, 1]]]) + ""
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
layoutY: 140
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 480
layoutAppSize = Corner(5)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
onboarding = true
pulsingSpeed: 8
pulsing = 0.8 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
A = (4.591072725036432, 5.892161020227049)
C = (4.917208433066277, 6.084005554362252)
layoutOnboarding = PointToPixels(Corner[onboardingDisplayText, 2], Corner[1], Corner[3], Corner[5])
onboardingX: 430 + 16
onboardingY: 324
onboardingCase = 1
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
q15: {(coeffa * "xy\textsf{ is a term}"), "\textsf{This expression has two terms}", (coeffb * "\textsf{ is a constant term}"), "\textsf{There is no constant}"}
q14: {((("\textsf{The sum of }" * coeffa) * "y\textsf{ and }") * coeffb), "\textsf{There are three terms in this equation}", "y \textsf{ is a coefficient}", ((("\textsf{The sum of }" * coeffa) * "\textsf{ and }y\textsf{ and }") * coeffb)}
q13: {"\textsf{This is an equation}", (coeffb * "\textsf{ is the coefficient of }y"), "\textsf{This is an expression}", "\textsf{There is no variable}"}
q12: {("\textsf{The power of }x\textsf{ is }" * coeffn), "\textsf{The power of }x\textsf{ is }1", "x\textsf{ is the exponent}", (coeffn * "\textsf{ is the constant term}")}
q11: {((("\textsf{Multiply }" * coeffb) * "\textsf{ by }x\textsf{ then, subtract from }") * coeffa), (((("\textsf{Subtract }" * coeffb) * "\textsf{ from }") * coeffa) * "\textsf{, then multiply by }x"), ((("\textsf{Subtract }" * coeffb) * "\textsf{ by }") * coeffa), ((("\textsf{Multiply }" * coeffb) * "\textsf{ by }x\textsf{, then subtract }") * coeffa)}
q10: {("\textsf{Add }x\textsf{ and }y\textsf{, then divide by }" * coeffa), "\textsf{There are three variables in this expression}", "\textsf{This is an equation}", (coeffa * "\textsf{ is the coefficient of }x")}
q8: {"\textsf{This is an equation}", ("x\textsf{ is the coefficient of }" * coeffb), "y\textsf{ is the only variable}", (coeffb * "\textsf{ is a variable}")}
q7: {(coeffa * "xy\textsf{ is a term}"), "\textsf{There are four terms in this expression}", "xy\textsf{ is called a coefficient}", "\textsf{This expression has one variable only}"}
q6: {(((("\textsf{The same as }" * coeffa) * "x+") * coeffa) * "y"), (coeffa * "\textsf{ is the constant term in this expression}"), "\textsf{This is an equation}", (("\textsf{Multiply }" * coeffa) * "\textsf{ by }x\textsf{ and add y}")}
q5: {("\textsf{The power of }x\textsf{ is }" * coeffn), "\textsf{The power of }x\textsf{ is }1", (("\textsf{This expression can also be written as }x(" * Simplify[(coeffa * x^(coeffn - 1)) + (coeffb * y)]) * ")"), (coeffb * "\textsf{ is the constant term}")}
q4: {(("\textsf{Divide }" * coeffa) * "\textsf{ by }y"), ("\textsf{Divide }y\textsf{ by }" * coeffa), (("y\textsf{ is divided into }" * coeffa) * "\textsf{ parts}"), ("\textsf{The coefficient of }y\textsf{ is }" * coeffa)}
q3: {((("\textsf{Multiply }x\textsf{ by }" * coeffa) * " \textsf{ and then subtract }") * coeffb), "\textsf{This expression has three terms}", (coeffa * "\textsf{ is the constant term in this expression}"), ("\textsf{The coefficient of }x\textsf{ is }" * coeffb)}
q2: {"\textsf{There are three terms in this expression}", "\textsf{There is no constant term}", "\textsf{This is an equation}", ("\textsf{The coefficient of }x\textsf{ is }" * coeffa)}
q1: {("\textsf{The coefficient of }y\textsf{ is }" * coeffb), "\textsf{This expression has one term only}", "\textsf{There is no variable in this expression}", "\textsf{This is an equation}"}
q9: {("\textsf{The same as \hspace{10}}" * tableQ9), "\textsf{The power of }y\textsf{ is }1", (("\textsf{The same as }" * coeffn) * "\textsf{ times }y"), ("\textsf{The coefficient of }y\textsf{ is }" * coeffn)}
m1: {q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15}
optionCorrect = Element(Element[m1, n], 1)
optionIncorrect1 = Element(Element[m1, n], 2)
optionIncorrect2 = Element(Element[m1, n], 3)
optionIncorrect3 = Element(Element[m1, n], 4)
Cor1 = (-3.2042101786572807, -0.43870860623465746)
Cor3 = (1.9244337005571057, 2.771489931627744)
MoveGL = (-1.2360930900087599, 1.8790547381019966)
vGL: x = x(MoveGL)
text1 = Text(optionCorrect, Midpoint[MoveBox1, MoveBox13], true, true, 0, 0)
text3 = Text(optionIncorrect3, Midpoint[MoveBox3, MoveBox33], true, true, 0, 0)
text4 = Text(optionIncorrect1, Midpoint[MoveBox4, MoveBox43], true, true, 0, 0)
l2 = Sequence((x(Corner[textPrompt, 1]), (ii * 0.4)), ii, 0, 3)
PositionsOrder = Sort(l2, Append[randomNum1, RanPositionsOrder])
p: y = y(MoveGL)
P = Vertex(droparea, 2)
boxInDroparea = 1
enableBtnValidate: (box1InReg ∨ box2InReg ∨ box3InReg ∨ box4InReg) ∧ inputCurrent ≠ inputSaved
optionCorrectForSolText = UnicodeToText(Insert[TextToUnicode["."], If[Length[optionCorrect] ≥ 40, Insert[TextToUnicode["\\"], TextToUnicode[optionCorrect], IndexOf[32, TextToUnicode[optionCorrect], 30] + 1], TextToUnicode[optionCorrect]], -2])
textAnswer: "" + (LaTeX[If[n ≟ 2, "\textsf{There are three terms in this\\expression}", optionCorrect]]) + "" + (LaTeX[If[n ≟ 9, "\hspace{-10}", ""]]) + "."
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
box1InMov: ¬(MoveBox1 ∈ Flatten[{P, PositionsOrder}])
box2InMov: ¬(MoveBox2 ∈ Flatten[{P, PositionsOrder}])
box3InMov: ¬(MoveBox3 ∈ Flatten[{P, PositionsOrder}])
box4InMov: ¬(MoveBox4 ∈ Flatten[{P, PositionsOrder}])
activeDropArea: {true, true} ∈ {{box1InMov, box1InReg}, {box2InMov, box2InReg}, {box3InMov, box3InReg}, {box4InMov, box4InReg}}
solutionExplain: {hintCoefficient, hintTerm, "", "", hintExponent, "", hintTerm, hintEquation, hintExponent, "", "", hintExponent, hintEquation, "", hintTerm}
sol11: "\textsf{Multiply } " + (LaTeX[coeffb]) + " \textsf{ by }x\textsf{ then, subtract}\\\textsf{from } " + (LaTeX[coeffa]) + ""
sol3: "\textsf{Multiply }x\textsf{ by }" + (LaTeX[coeffa]) + " \textsf{ and then}\\\textsf{subtract }" + (LaTeX[coeffb]) + ""
isTypicalError: true
pulsingObject1 = expandQuad(MoveBox1, MoveBox12, MoveBox13, MoveBox14, (7 * pulsing), Corner[1], Corner[3], Corner[5])
pulsingObject2 = expandQuad(MoveBox2, MoveBox22, MoveBox23, MoveBox24, (7 * pulsing), Corner[1], Corner[3], Corner[5])
pulsingObject3 = expandQuad(MoveBox3, MoveBox32, MoveBox33, MoveBox34, (7 * pulsing), Corner[1], Corner[3], Corner[5])
pulsingObject4 = expandQuad(MoveBox4, MoveBox42, MoveBox43, MoveBox44, (7 * pulsing), Corner[1], Corner[3], Corner[5])
text2 = Text(optionIncorrect2, Midpoint[MoveBox2, MoveBox23], true, true, 0, 0)
p' = Translate(p, Vector[(Vector[Corner[4], Corner[1]] / 500 * 36)])
textSolution: "\textsf{\bold{Solution}}\\\\{" + (LaTeX[If[n ≟ 2, sol2, n ≟ 3, sol3, n ≟ 11, sol11, text1]]) + ".}
\\\\" + (LaTeX[solutionExplain(n)]) + ""
boxTeal: box1

Tool: PointToPixels
PointToPixels(InputPoint,Corner1,Corner3,Corner5)
Input: InputPoint, Corner1, Corner3, Corner5
Output: OutputPixels

xLeft: x(Corner1)
xRight: x(Corner3)
yTop: y(Corner3)
yBottom: y(Corner1)
yPixels: (y(Corner5) * (yTop - y(InputPoint)) / (yTop - yBottom))
xPixels: (x(Corner5) * (x(InputPoint) - xLeft) / (xRight - xLeft))
OutputPixels: (xPixels, yPixels)

Tool: sectorPixels
sectorPixels(Midpoint,B,C,pixelRadius,Corner1,Corner3,Corner5
Input: A, B, C, pixelRadius, Corner1, Corner3, Corner5
Output: newSector

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
BPrime: A + (pointRadius * UnitVector[B - A])
newSector = CircleSector(A, BPrime, C)

Tool: onboardingTextOffset
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)