$\text{The slope is \\not defined}$

#4D4D4D

Select any two points on the line \and find the rise and run.  \Slope = \frac{Rise}{Run}.

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{}

Reset app

Select any two points on the line \and find the rise and run.  \Slope = \frac{Rise}{Run}.

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Use the measurements on the graph\to find the slope.}

#eeeeee

#2E006758

#2EB00020

Make sure the input current is defined if the student selected the checkbox.

\text{This is the onboarding text}

1= arrow right, 2=arrow left,3=arrow down, 4=arrow up

${Slope=}$

\text{Find the slope of the line shown.}

${Slope=}$

allRandoms = RandomUniform(-6, 6.999, 200)
studentSlopeTemp = NaN
notDefined = false
randomY2 = Zip(floor(A), A, Take[allRandoms, 151, 200])
countQuestion = 0
randomY1 = Zip(floor(A), A, Take[allRandoms, 101, 150])
randomX1 = Zip(floor(A), A, Take[allRandoms, 1, 50])
randomX2 = Zip(floor(A), A, Take[allRandoms, 51, 100])
y2 = Element(randomY2, Mod[countQuestion, Length[randomY2]] + 1)
y1 = Element(randomY1, Mod[countQuestion, Length[randomY1]] + 1)
x1 = Element(randomX1, Mod[countQuestion, Length[randomX1]] + 1)
x2Temp = Element(randomX2, Mod[countQuestion, Length[randomX2]] + 1)
x2 = If(x2Temp ≠ x1, x2Temp, (-x2Temp))
P2: (If[x1 < x2, x2, x1], y2)
P1: (If[x1 < x2, x1, x2], y1)
expectedRise: y(P2) - y(P1)
expectedRun: x(P2) - x(P1)
lblPosRun = If(expectedRise ≟ 0, (100, 100), P2 - (Max[expectedRun, 3] / 2, If[expectedRise < 0, 1, -1]))
studentSlope = NaN
expectedSlope: expectedRise / expectedRun
helpTextTypical2: (("The line slopes " * If[expectedSlope < 0, "downwards", "upwards"]) * ".")
displayLine = Line(P1, P2)
randomNum2 = Element(randomY2, Mod[countQuestion, 15] + 1)
input2: NaN
randomNum1 = Element(randomX2, Mod[countQuestion, 20] + 1)
input1: NaN
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correct: studentSlope ≟ expectedSlope ∨ notDefined ∧ expectedRun ≟ 0
showbuttons = true
typicalError1: 0
typicalError2: 0
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)}])
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
layoutY: 125
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
inputCurrent: {If[¬notDefined, studentSlopeTemp, 0], notDefined}
inputSaved: {NaN, false}
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent]
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
onboardTimer = 9 (slider from 1 to 10, step 1)
onboarding: false
onboardingX: 400
onboardingY: 300
onboardOffsetX: onboardingX + Element[{-2, 2, -2, 2, 0, 0, 0, 0, 0, 0, 0, 0}, onboardTimer]
onboardSpeed: 5
onboardingTextPixels: PointToPixels[Corner[1], Corner[3], Corner[5], Corner[onboardingText, 3]] - PointToPixels[Corner[1], Corner[3], Corner[5], Corner[onboardingText, 1]]
onboardingTextWidth: x(onboardingTextPixels)
onboardingCase: 1
onboardTextX: onboardingX + Element[{32, (-onboardingTextWidth), 16 - onboardingTextWidth / 2, 16 - onboardingTextWidth / 2}, onboardingCase]
onboardTextY: onboardingY - y(onboardingTextPixels) + Element[{8, 8, y(onboardingTextPixels) + 8, -16}, onboardingCase]
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
onboardOffset = Element({-2, 2, -2, 2, 0, 0, 0, 0, 0, 0, 0, 0}, onboardTimer)
viewbox = Polygon({(-10.5, -10.5), (-10.5, 10.5), (10.5, 10.5), (10.5, -10.5)})
lblX = Text("x", (11, 0.3), true, true, 0, 0)
lblY = Text("y", (0, 10.5), true, true, 0, 1)
inputSlope = Textfield(studentSlope)
tempRun = Element(randomY1, Mod[countQuestion, Length[randomY1]])
showSlope = PolyLine({P1, (x(P1), y(P2)), P2})
ansReduced: (If[expectedSlope < 0, "-", ""] * FractionText[abs(expectedSlope)])
showReduced: expectedRun ≠ 0 ∧ (expectedRise < 0 ∨ expectedRun ≤ 1 ∨ abs(expectedRun) ≠ abs(Denominator[expectedSlope]))
lblRun = Text(("Run=" * expectedRun), lblPosRun, false, true, 0, 0)
lblRise = Text(("Rise=" * expectedRise), P1 + (0, (y(P2) - y(P1)) / 2), false, true, -1, If[expectedRise ≟ 0, -1, 0])
isTypicalError: ¬correct
axisX = Segment((-10.5, 0), (10.5, 0))
axisY = Segment((0, -10.5), (0, 10.5))
backgroundBoxes = Zip(Polygon[Corner[A, 1], Corner[A, 2], Corner[A, 3], Corner[A, 4]], A, {lblRise, lblRun})
countQuetion: countQuestion + 1
A = Intersect(countQuestion = countQuestion, countQuestion = 1)
B = Intersect(countQuestion = countQuestion, countQuestion = 1)
C = Intersect(countQuestion = countQuestion, countQuestion = 1)
inputBoxDisabled = Textfield(studentSlope)
displayAxis: axisX
countQuestoin: 0
textSolution: "\textsf\bold{Possible Solution}\\
\textsf{Slope = \dfrac{Rise}{Run} }\[=\dfrac{" + (LaTeX[expectedRise]) + "}{" + (LaTeX[expectedRun]) + "}" + (LaTeX[If[showReduced, ("=" * ansReduced), ""]]) + "\]
\\\textsf{" + (LaTeX[If[expectedRun ≟ 0, "The slope is not defined.", ""]]) + "}"

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: PointToPixels
PointToPixels(Corner1,Corner3,Corner5,InputPoint)
Input: Corner1, Corner3, Corner5, InputPoint
Output: OutputPixels

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

Tool: boxTool
(length,width,Point)
Input: width, length, A
Output: myBox

length: 1
width: 1
D: A + (0, length)
B: A + (width, 0)
C: A + (width, length)
myBox = Polygon({A, B, C, D})