1 =  increasing, 2 = decreasing

#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$b=$

Reset app

\text{The function continues\beyond what is depicted.}

#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 modify the interval}

$a=\vphantom{b}$

\text{Describe the applet here}

$\text{Some string input}$

allRandomSeeds = RandomUniform(0, 0.99, 200)
inputSaved: {-2, 2}
inputDefined: Sum[Zip[A ≠ "?" ∧ ReplaceAll[A, " ", ""] ≠ "", A, {stringA, stringB, stringC}]] ≟ 3
validA = true
validB = true
validC = true
inputValid: Sum[{validA, validB, validC}] ≟ 3
inputA = NaN
inputB = NaN
numRandoms = 4
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1 = If(currentRandomSeeds(1) ≤ 0.5, 1, -1)
onboarding = true
correct1: inputA ≟ randomNum1
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
GridPoints = Flatten(Zip[Zip[(ii, jj), ii, Sequence[-5, 5]], jj, Sequence[-5, 5]])
P1 = If(countQuestion ≟ 0, (0, -2), Element[GridPoints, 1 + floor((currentRandomSeeds(2) * Length[GridPoints]))])
poscoeffa: Sequence[-1, 1, 0.25] \ {0}
randomNum2 = If(countQuestion ≟ 0, 1, Element[poscoeffa, 1 + floor((currentRandomSeeds(3) * Length[poscoeffa]))])
posScale: {0.5, 1, 2, 5, 10}
scale = Element(posScale, 1 + floor((currentRandomSeeds(4) * Length[posScale])))
solnum: (x(P1) * scale)
textSolution: "\textsf{\bold{Solution}}\\
\textsf{The function is " + (LaTeX[If[randomNum1 ≟ 1, "in", "de"]]) + "creasing}\\\textsf{over }" + (LaTeX[If[(randomNum1 * randomNum2) ≤ 0, (("(-\infty," * solnum) * "]"), (("[" * solnum) * ",\infty)")]]) + "."
InputBoxB = Textfield(inputB)
correct2: inputB ≟ randomNum2
LinePoints = Sequence((kk, 0), kk, -11, 11)
A = Point(LinePoints)
B = Point(LinePoints)
xmin = Min(x(A), x(B))
xmax = Max(x(A), x(B))
correct = If((randomNum1 * randomNum2) ≤ 0, xmin ≟ x(LinePoints(1)) ∧ xmax ≟ x(P1), xmin ≟ x(P1), xmax ≟ x(LinePoints(-1)))
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
helpTextHint: "\text{The interval where a\\quadratic is " + (LaTeX[If[randomNum1 ≟ 1, "in", "de"]]) + "creasing\\is where the function is\\moving " + (LaTeX[If[randomNum1 ≟ 1, "up", "down"]]) + " from\\left to right.}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
layoutY: 120 + 16
layoutX = 549
layoutAppSize = Corner(5)
inputCurrent: {xmin, xmax}
enableBtnValidate: inputCurrent ≠ inputSaved
pulsingSpeed: 8
pulsing = 0.4 (slider from 0 to 1, step 0.1)
onboardingCase = 3
onboardingX = 287
onboardingY: 284 + 16
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)
textQuestion: "\text{Identify the interval where the quadratic function is \bold{" + (LaTeX[If[randomNum1 ≟ 1, "increasing", "decreasing"]]) + "}.} "
xminText = If(xmin ≟ -11, "(-\infty", xmin ≟ 11, "(\infty", ("[" * Text[(scale * xmin)]))
xmaxText = If(xmax ≟ -11, "-\infty)", xmax ≟ 11, "\infty)", (Text[(scale * xmax)] * "]"))
text1: "\textsf{The function is \bold{" + (LaTeX[If[randomNum1 ≟ 1, "in", "de"]]) + "creasing}}\\\textsf{over }" + (LaTeX[xminText]) + ", " + (LaTeX[xmaxText]) + "."
tabOrder: {textQuestion, text1, A, B, btnValidate, textHint, textSolution, btnNew}
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correct}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + "}"
maxTries: 3
labelBtnValidate: "\text{CHECK (" + (LaTeX[maxTries - tries]) + ")}"
enableInput: tries < maxTries ∧ (¬(validate ∧ correct))
ViewCorner1_{1}: (-11.5, -9.25)
ViewCorner3_{1}: (11.5, 9.25)
q1_{1} = Polygon({ViewCorner1_{1}, (x(ViewCorner3_{1}), y(ViewCorner1_{1})), ViewCorner3_{1}, (x(ViewCorner1_{1}), y(ViewCorner3_{1}))})
text1_{1} = Text("x", (11.25, 0.75), true, true, 0, 0)
text2_{1} = Text("y", (0, 9), true, true, 1, 0)
MoveGL = (-0.7561119008264464, -10.15468595041322)
hGL: y = y(MoveGL)
hGL' = Translate(hGL, Vector[(Vector[Corner[1], Corner[4]] / 500 * 16)])
vGL: x = x(MoveGL)
Cor1 = (-12.392111900826443, -11.981826446280989)
Cor3 = (26.074003801652882, 12.155661157024788)
f(x) = y(P1) + ((x - x(P1))^(2) * randomNum2)
g: f(x)
h(x) = If[Min[x(A), x(B)] ≤ x ≤ Max[x(A), x(B)], g(x)]
interval = Segment(A, B)
D: LinePoints(-1)
pulsingObject = circlePixels(B, 5 + (7 * pulsing), Cor1, Cor3, (800, 500))
EndPoints = Sort({Intersect[f, q1_{1}]})
speedAnim: 4
anim = 2 (slider from 0 to 2)
AnimPointLeft: (x(EndPoints(1)) + (Min[anim, 1] * (x(P1) - x(EndPoints(1)))), f(x(EndPoints(1)) + (Min[anim, 1] * (x(P1) - x(EndPoints(1))))))
AnimPointRight: (x(P1) - (Min[anim, 1] * (x(P1) - x(EndPoints(2)))), f(x(P1) - (Min[anim, 1] * (x(P1) - x(EndPoints(2))))))
fRight(x) = If[x(AnimPointRight) ≥ x ≥ x(P1), g(x)]
fLeft(x) = If[x(EndPoints(1)) ≤ x ≤ x(AnimPointLeft), g(x)]
C: LinePoints(1)
xAxisFake_{1} = Segment((x(ViewCorner1_{1}) + 0.05, 0), (x(ViewCorner3_{1}) - 0.05, 0))
yAxisFake_{1} = Segment((0, y(ViewCorner1_{1}) + 0.05), (0, y(ViewCorner3_{1}) - 0.05))
ticks = Zip(Segment[(kk, 0.2), (kk, -0.2)], kk, Sequence[-13, 13, 2])
ticksNums = Sequence(Text[(scale * kk), (kk, 0), true, true, 0, -1], kk, -11, 11, 2)
isTypicalError: If[(randomNum1 * randomNum2) ≤ 0, xmin ≤ x(P1) ∧ xmax ≟ x(P1) ∧ abs(f(xmin)) ≥ 9, xmin ≟ x(P1) ∧ xmax ≥ x(P1) ∧ abs(f(xmax)) ≥ 9] ∧ (¬correct)
E: (x(P1) + (Max[0, anim - 1] * (11 - x(P1))), 0)
F: (x(P1), 0)
i = Segment(F, E)
G: (x(P1) + (Max[0, anim - 1] * (-11 - x(P1))), 0)
j = Segment(G, F)
k = Tangent(AnimPointRight, f)
H: EndPoints(1)
I: EndPoints(2)

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)

Tool: circlePixels
circlePixels(A,pixelRadius,Corner1,Corner3,Corner5
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newCircle

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
newCircle = Circle(A, pointRadius)