#C75000

#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

\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

#E07415

\text{This is the general hint}

#eeeeee

#2E006758

#2EB00020

\text{Drag to start}

\text{Watch the animation, then complete the sentence.\\vspace{70}The line gets closer to the\\\and the slope gets \hspace{140} 0.} 

$\textsf{REPLAY}$

$\math{g(x)}$

anim = 0 (slider from 0 to 1, step 0.001)
numRandoms: 2
c = Semicircle((-1, 0), (1, 0))
allRandomSeeds = Sequence(Random[0, 99] / 100, A, 1, 200)
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
slopes: {-5, -4, -3, -2, -1, -1 / 2, -1 / 3, -1 / 4, -1 / 5, 5, 4, 3, 2, 1, 1 / 2, 1 / 3, 1 / 4, 1 / 5}
randomNum2: 1 + floor((currentRandomSeeds(2) * (Length[slopes] - 2)))
randomNum1: 1 + floor((currentRandomSeeds(1) * Length[slopes]))
slp1 = Element(slopes, randomNum1)
lineOriginal: y = (slp1 * x)
P0 = Intersect(c, lineOriginal)
α = Angle(Vector[(1, 0)], Vector[P0])
slp2: (abs(Element[slopes \ {slp1, (-slp1)}, randomNum2]) * sgn(slp1))
lineTarget: y = (slp2 * x)
P1 = Intersect(c, lineTarget)
β = Angle(Vector[(1, 0)], Vector[P1])
slpAnim: tan(α + (anim * (β - α)))
EPM1 = If(1 ≤ abs(slpAnim), (5 / slpAnim, 5), If[slpAnim ≤ 0, (-5, (slpAnim * (-5))), (5, (slpAnim * 5))])
EPM2 = Mirror(EPM1, (0, 0))
EPO1 = If(1 ≤ abs(slp1), (5 / slp1, 5), If[slp1 ≤ 0, (-5, (slp1 * (-5))), (5, (slp1 * 5))])
q1 = Polygon({(-5.2, -5.2), (5.2, -5.2), (5.2, 5.2), (-5.2, 5.2)})
lineModified: y = (tan(α + (anim * (β - α))) * x)
hint2 = true
hint1 = true
menu2 = Zip((("$\textsf{" * tt) * "}$"), tt, {"\phantom{further from}", "further from", "  closer to  "})
menu1: {"$\phantom{x-\textsf{axis} }$", "$x-\textsf{axis }$", "$y-\textsf{axis }$"}
selected1 = SelectedIndex(menu1)
onboarding = false
inputSaved: {1, 1}
input2 = NaN
input1 = NaN
selected2 = SelectedIndex(menu2)
inputCurrent: {selected1, selected2}
correct1: selected1 ≟ If[abs(slp2) ≥ abs(slp1), 3, 2]
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
textSolution: "\textsf{\bold{Possible Solution}}\\
f(x)=" + (LaTeX[(If[slp1 ≤ 0, "-", ""] * FractionText[abs(slp1)])]) + "x \text{ and }g(x)=" + (LaTeX[(If[slp2 ≤ 0, "-", ""] * FractionText[abs(slp2)])]) + "x\\
g(x)\textsf{ is closer to the }" + (LaTeX[If[abs(slp2) ≥ abs(slp1), "y", "x"]]) + "\textsf{-axis than }f(x)\\\textsf{and slope }" + (LaTeX[(If[slp1 ≤ 0, "-", ""] * FractionText[abs(slp1)])]) + "\textsf{ is " + (LaTeX[If[abs(slp1) ≥ abs(slp2), "further from", "closer to"]]) + " }0\\\textsf{than slope }" + (LaTeX[(If[slp2 ≤ 0, "-", ""] * FractionText[abs(slp2)])]) + "."
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct2: selected2 ≟ If[abs(slp2) ≥ abs(slp1), 2, 3]
correct: correct1 ∧ correct2
isTypicalError: input2 ≟ input1 + 1
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
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 = 183.5
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved
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]) + ""
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correct}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + ""
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[hint1, "Notice where the line moves."]]) + "" + (LaTeX[If[hint1 ∧ hint2, "\\"]]) + "" + (LaTeX[If[hint2, "Find and compare the slopes of the lines."]]) + "}"
altFeedback: "\text{" + (LaTeX[If[correct, "Your answer is correct. ", ("Your answer is not correct. " * If[tries < 3, "Try again. ", "Maybe next time. "])]]) + "}"
solutionView: showanswer ∨ showsolution
Cor1 = (-17.399068559556788, -7.454567867036012)
Cor3 = (6.2499342105263125, 7.396844875346267)
fakexaxis = Segment((-5.2, 0), (5.2, 0))
eq1: x = x(Corner[2]) - (x(Corner[2] - Corner[1]) / 800 * 16)
MoveGL = (-3.3754109973347024, -3.6079769275542275)
eq2: x = x(MoveGL)
labelxaxis = Text("x", (5.5, 0.1), true, true, 0, 0)
fakeyaxis = Segment((0, -5.2), (0, 5.2))
labelyaxis = Text("y", (0, 5.6), true, true, 0, 0)
f: y = y(Corner[4]) - (y(Corner[4] - Corner[1]) / 600 * 24)
g: y = y(Corner[4]) - (y(Corner[4] - Corner[1]) / 500 * (448 - 16))
speed: 8
h: y = y(MoveGL)
eq2' = Translate(eq2, Vector[(((-Vector[Corner[2] - Corner[1]])) / 800 * 8)])
enableInput: tries < 3 ∧ (¬(validate ∧ correct)) ∧ anim ≟ 1
LineModifiedShow = Segment(EPM1, EPM2)
PointLabelG = Vertex(LineModifiedShow, If[slp1 ≥ 0, 2, 1])
EPO2 = Mirror(EPO1, (0, 0))
lineOriginalShow = Segment(EPO1, EPO2)
PointLabelF = Vertex(lineOriginalShow, If[slp1 ≥ 0, 2, 1])
haligf = If(x(PointLabelF) ≟ -5.2, 0, If[x(PointLabelF) ≟ 5.2, 0, x(PointLabelF) ≥ x(PointLabelG), 1, -1])
haligg = If(x(PointLabelG) ≟ -5.2, 0, If[x(PointLabelG) ≟ 5.2, 0, x(PointLabelG) ≥ x(PointLabelF), 1, -1])
valigg = If(y(PointLabelG) ≟ -5.2, 1, If[y(PointLabelG) ≟ 5.2, -1, y(PointLabelG) ≥ y(PointLabelF), 1, -1])
valigf = If(y(PointLabelF) ≟ -5.2, 1, If[y(PointLabelF) ≟ 5.2, -1, y(PointLabelF) ≥ y(PointLabelG), 1, -1])
legendf = Segment((-5, If[slp1 ≥ 0, 4.5, -4.5]), (-3, If[slp1 ≥ 0, 4.5, -4.5]))
legendg = Segment((-5, If[slp1 ≥ 0, 3.5, -3.5]), (-3, If[slp1 ≥ 0, 3.5, -3.5]))
text1 = Text("g", PointLabelG, true, true, haligg, valigg)
text2 = Text("f", PointLabelF, true, true, haligf, valigf)
tabOrder: {textQuestion, btnReplay, menu1, menu2, btnValidate, textHint, textSolution, btnNew}
h' = Translate(h, Vector[(16 * Vector[Corner[4], Corner[1]] / 500)])

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)