#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$\math{x=}$

$\textsf{Number of real solutions:}$

Reset app

\textsf{How many solutions exist for }x^2 = 1\textsf{? Apply this reasoning to your equation. }

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

\text{Drag to start}

$\math{x=}$

\text{Describe the applet here}

$\text{Some string input}$

allRandomSeeds = RandomUniform(0, 0.99, 200)
inputSaved: {"-1", "", ""}
validA = true
validB = true
validC = true
inputA = NaN
inputB = NaN
numRandoms = 5
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomLevel: 1 + floor((currentRandomSeeds(1) * 4))
onboarding = false
randomNum2: randomLevel + 2 + floor((currentRandomSeeds(2) * 10))
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
coeffas: Sequence[-3, 3] \ {0}
coeffns: {1, 2, 3, 4, 5, 8, 9, 10, 11, 12}
coeffn: Element[coeffns, Mod[countQuestion, 1 + floor((currentRandomSeeds(2) * Length[coeffns]))] + 1]^(2)
coeffa: Element[coeffas, Mod[countQuestion, 1 + floor((currentRandomSeeds(2) * Length[coeffas]))] + 1]^(2)
coeffbs = Sequence(-3, 3)
coeffb: Element[coeffbs, Mod[countQuestion, 1 + floor((currentRandomSeeds(3) * Length[coeffbs]))] + 1]^(2)
coeffcs = KeepIf(IsInteger[sqrt(kk - coeffb)], kk, Sequence[-9, 9] \ {0})
coeffc = Element(coeffcs, Mod[countQuestion, 1 + floor((currentRandomSeeds(4) * Length[coeffcs]))] + 1)
coeffds: Sequence[-9, 9] \ {0}
coeffd = Element(coeffds, 1 + floor((currentRandomSeeds(5) * Length[coeffds])))
level1Eq(x) = x^(2)
level2Eq = Polynomial((coeffa * x^(2)))
level3Eq = Polynomial((coeffa * x^(2)) + coeffc)
level4Eq = If(coeffa ≟ 1, (x + coeffd)^(2) + coeffc, coeffa ≟ -1, (-(x + coeffd)^(2)) + coeffc, (coeffa * (x + coeffd)^(2)) + coeffc)
equat = Element({level1Eq, level2Eq, level3Eq, level4Eq}, randomLevel)
rootsPoints: {Root[equat(x) - If[randomLevel ≟ 1, coeffn, coeffb]]}
sols = Zip(x(PP), PP, RemoveUndefined[rootsPoints])
solsText = Zip((If[kk ≥ 0, "", "-"] * FractionText[abs(kk)]), kk, sols)
l1: {Text[equat], "=", Text[If[randomLevel ≟ 1, coeffn, coeffb]]}
a = If(randomLevel ≟ 1, 1, coeffa)
d = If(randomLevel ≟ 4, coeffd, 0)
c = If(randomLevel ≥ 3, coeffc, 0)
b = If(randomLevel ≟ 1, coeffn, coeffb)
l2: {LaTeX[If[d ≟ 0, (a * x^(2)), (a * (x + d)^(2))]], "=", Text[b - c]}
l3: {LaTeX[If[d ≟ 0, x^(2), (x + d)^(2)]], "=", (If[(b - c) / a ≥ 0, "", "-"] * FractionText[abs(b - c) / a])}
l4: {LaTeX[x + d], "=", ((("\pm\sqrt{" * If[(b - c) / a ≥ 0, "", "-"]) * FractionText[abs(b - c) / a]) * "}")}
l6: {LaTeX[x], "=", If[b - c ≟ 0, (If[d ≥ 0, "-", ""] * Text[abs(d)]), ((("\pm" * FractionText[sqrt(abs(b - c) / a)]) * If[d ≥ 0, "-", "+"]) * abs(d))]}
l5: {LaTeX[x + d], "=", (If[b ≟ c, "", "\pm"] * FractionText[sqrt(abs(b - c) / a)])}
l7 = KeepIf(Length[ll] ≟ 3, ll, {l1, If[c ≟ 0, {}, l2], If[a ≟ 1, {}, l3], If[Length[sols] ≟ 0 ∨ b - c ≟ 0, {}, l4], If[Length[sols] ≟ 0, {}, l5], If[Length[sols] ≟ 0 ∨ d ≟ 0, {}, l6]})
workedSol = TableText(l7, "rcl")
textSolution: "\textsf\bold{Possible Solution}\\" + (LaTeX[workedSol]) + "
\\\textsf{The equation has " + (LaTeX[Element[{"no real solutions}", ("one real solution: }x =" * solsText(1)), ((("two real solutions: }x=" * solsText(1)) * "\textsf{ and }x=") * solsText(2))}, Length[sols] + 1]]) + "."
InputBoxB = Textfield(inputB)
menu = Zip((("$\textsf{" * tt) * " }$"), tt, {"Choose an option", "No real solutions", "One real solution", "Two real solutions"})
selectedNumOfSols: SelectedIndex[menu] - 2
inputValid: Sum[{validA, validB}] ≥ selectedNumOfSols ∧ selectedNumOfSols ≥ 0
inputDefined: Sum[Zip[A ≠ "?" ∧ ReplaceAll[A, " ", ""] ≠ "", A, {stringA, stringB}]] ≥ selectedNumOfSols
inputCurrent: {Text[selectedNumOfSols], stringA, stringB}
correct2: inputA ∈ sols
correct1: selectedNumOfSols ≟ Length[sols]
correct3: inputB ∈ sols ∧ inputB ≠ inputA
corrects = Take({correct1, correct2, correct3}, 1, 1 + Length[sols])
correct: ¬(false ∈ corrects)
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
hint: "Use the properties of equalities to isolate \(" + (LaTeX[If[randomLevel ≟ 4, (("(" * Polynomial[x + coeffd]) * ")^2"), "x^2"]]) + "\).\\"
helpTextHint: "\textsf{" + (LaTeX[If[randomLevel ≥ 2, hint, ""]]) + "T" + (LaTeX[If[randomLevel ≥ 2, "hen t", ""]]) + "ake the square root on both sides.}"
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)}])
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
layoutY = 150
layoutX: 416
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputDefined ∧ inputValid ∧ selectedNumOfSols ≥ 0
pulsingSpeed: 8
pulsing = 0.6 (slider from 0 to 1, step 0.1)
onboardingCase: 1
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
solutionView: showanswer ∨ showsolution
InputBoxA = Textfield(inputA)
altFeedback: "\text{" + (LaTeX[If[correct, (("Your answer is correct. Total number correct: " * countCorrect) * ". "), ("Your answer is not correct. " * If[tries < 3, "Try again. ", "Maybe next time. "])]]) + "}" + (LaTeX[If[showsolution, ("\\" * textSolution), If[showhint ∨ showhinttypicalerror, textHint, ""]]]) + ""
InputBoxC = Textfield(inputC)
maxTries: 3
labelBtnValidate: "\text{CHECK (" + (LaTeX[maxTries - tries]) + ")}"
enableInput: tries < maxTries ∧ (¬(validate ∧ correct))
eq1:=level2Eq = (coeffa * x^(2)) + coeffb
textequation = TableText(Text[equat], "=", Text[If[randomLevel ≟ 1, coeffn, coeffb]], "lcr")
textequationPos = Text(textequation, (0, 0), true, true, 0, 0)
A = (0.8469186447228471, 0.2889239204458378)
f: y = y(A)
Cor1 = (-5.840818239467918, -6.4234446923076645)
Cor3 = (5.840818239467916, 0.8885036875981115)
f' = Translate(f, Vector[(Vector[Corner[1], Corner[4]] / 500 * 24)])
isTypicalError: Length[sols] ≟ 2 ∧ selectedNumOfSols ≟ 1 ∧ correct2
g(x) = (a * (x - d)^(2)) + c
B = (-3.434401124807136, -4.890860311879414)
C: B + (0.5, 0)
D = (0.3504490943680742, -0.9541073041381443)
E = (-4.019573236297187, -1.7876694194474028)
F = (-1.4195732362971851, -1.7876694194474028)
pic3 = Translate(If[correct1, pic1, pic2], Vector[B, D])
pic4 = Translate(If[correct2, pic1, pic2], Vector[B, E])
pic5 = Translate(If[correct3, pic1, pic2], Vector[B, F])
textQuestion: "\textsf{Solve for x}:\hspace{25} " + (LaTeX[Text[equat]]) + "= " + (LaTeX[Text[If[randomLevel ≟ 1, coeffn, coeffb]]]) + ""
tabOrder: {textQuestion, textequationPos, menu, InputBoxA, InputBoxB, btnValidate, textHint, textSolution, btnNew}
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{Correct}"), (((("\textcolor{" * colorRedError) * "}{") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + "}"

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: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

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)