$O$

$A$

%v

$\math{x= }$

$C$

%v

#4D4D4D

$\text{Check}$

$\text{NEW ANGLE}$

Fix position and allow selection for all text objects

Empty all input boxes

$b=$

Reset app

\text{This is the error specific hint}

#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}

\textsf{Solve for } x.

$B$

°

\text{Simplify your answer}

allCaseNum: {1, 2}
countQuestion = 0
caseNum = Element(allCaseNum, Mod[countQuestion, Length[allCaseNum]] + 1)
angBig: 180
allAngMini2 = Shuffle(Sequence[t, t, 20, angBig - 10, 2])
allAngMini3 = Shuffle(Sequence[t, t, 21, angBig - 12, 3])
angMini2 = Element(allAngMini2, Mod[countQuestion, Length[allAngMini2]] + 1)
angMini3 = Element(allAngMini3, Mod[countQuestion, Length[allAngMini3]] + 1)
O: (0, 0)
A: (4, 0)
B = Rotate(A, If[caseNum ≟ 1, angMini2°, angMini3°], O)
angAOB = Angle(A, O, B)
input1 = NaN
studUniSaved: {NaN}
inputCurrent: {input1}
InputBox1 = Textfield(input1)
studUniCurrent = TextToUnicode(("" * InputBox1))
notSimplified: CountIf[x ≟ 43, studUniCurrent] + CountIf[x ≟ 45, studUniCurrent] ≠ 0
AF = Rotate(A, angBig°, O)
angBOF = Angle(B, O, AF)
ans1 = If(caseNum ≟ 1, angMini2 / 2, angMini3 / 3)
bigA = Angle(A, O, AF)
onboarding = false
inputSaved: {NaN}
input2 = NaN
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox2 = Textfield(input2)
correct1: false
correct2: false
correct: input1 ≟ ans1
isTypicalError: input2 ≟ input1 + 1
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
helpTextHint: "" + (LaTeX[input1]) + "° \times " + (LaTeX[If[caseNum ≟ 1, 2, 3]]) + " = " + (LaTeX[If[caseNum ≟ 1, (2 * input1), (3 * input1)]]) + "°\\\\
\textsf{The animated angle has a measure that is}\\
\textsf{" + (LaTeX[If[caseNum ≟ 1, "twice", "three times"]]) + " your attempted answer.}"
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)}])
layoutY: 178
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: studUniCurrent ≠ studUniSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent]
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
StartA = (3.4347091871177713, 5.572495645015256)
StartB = (4.1638207264560645, 6.136241785204535)
pulsingSpeed: 8
pulsing = 0.8 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
count = 2
onboardingCase: 1
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
useOnboarding: false
layoutCase: 1
layoutHintSolnY: layoutY + Element[{56, 88}, layoutCase]
layoutHintSolnX = Element({If[layoutX ≟ 16, layoutX - 5, 11], layoutX - 5}, layoutCase)
layoutFeedbackX: layoutX + Element[{If[correct ∨ tries ≟ 3, -5, 126], -5}, layoutCase]
layoutFeedbackY: layoutY + Element[{If[correct, 6, 1], If[correct, 6, If[tries ≟ 3, 1, 51]]}, layoutCase]
B': B
labelVert: "" + (LaTeX[angAOB]) + ""
BB: (4; angAOB + 6°)
AFF: (4; bigA - 4°)
AA: (4; 6°)
posLabelAOB = Point(Vector[(1.8 * UnitVector[AngularBisector[AA, O, BB]])], 1)
posLabBig = Point(Vector[(4.4 * UnitVector[AngularBisector[AA, O, AFF]])], 1)
vert = Segment(O, AF)
hor = Segment(O, A)
angSide = Segment(O, B')
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
posLabelSol2 = Point(Vector[(1.8 * UnitVector[AngularBisector[B', O, AF]])], 1)
solCase1 = Angle(A, O, B')
posLabelSol1 = Point(Vector[(1.8 * UnitVector[AngularBisector[A, O, B']])], 1)
labelAOB: "" + (LaTeX[If[¬showsolution, If[caseNum ≟ 1, "2x", "3x"], angAOB]]) + ""
textSolution: "\textsf{\bold\textcolor{#006758}{Solution}}\\\\\\
\frac{\textcolor{#3A6ED6}{" + (LaTeX[If[caseNum ≟ 1, "2x", "3x"]]) + "}}{\textcolor{#252525}{" + (LaTeX[If[caseNum ≟ 1, 2, 3]]) + "}}\:=\frac{\textcolor{#3A6ED6}{" + (LaTeX[angAOB]) + "}}{\textcolor{#252525}{" + (LaTeX[If[caseNum ≟ 1, 2, 3]]) + "}}\\\\
\hspace{16px}\textcolor{#252525}{x=" + (LaTeX[If[caseNum ≟ 1, angAOB / 2, angAOB / 3]]) + " }"
posLabelBOF = Point(Vector[(2.2 * UnitVector[AngularBisector[BB, O, AFF]])], 1)
BO = Mirror(B, O)
angSide2 = Segment(O, BO)
angVert = Angle(AF, O, BO)
posLabelVert: Mirror[posLabelAOB, O] + (-0.5, 0.5)
aniSli = 0 (slider from 0 to 1, step 0.01)
speed = If(showhint, 3, 0)
SA = Rotate(A, If[caseNum ≟ 1, ((2 * aniSli) * input1°), ((3 * aniSli) * input1°)], O)
studSide = Segment(O, SA)
tabOrder: {textQuestion, labelVert, labelAOB, InputBox1, btnValidate, textSolution, btnNew}
studAng = Angle(A, O, SA)
labelSol1: "" + (LaTeX[If[caseNum ≟ 1, "2x", "3x"]]) + "=" + (LaTeX[solCase1]) + ""

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)