1

#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

f

g

$\math{k}=$

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}

$\math{h}=$

$\text{Some string input}$

x

y

\textsf{Enter the values for }h \textsf{ and }k.

your function

f(x)

g(x)

allRandomSeeds = RandomUniform(0, 0.99, 200)
inputSaved: {"", "", ""}
inputDefined: Sum[Zip[A ≠ "?" ∧ ReplaceAll[A, " ", ""] ≠ "", A, {stringA, stringB}]] ≟ 2
validA = true
validB = true
inputCurrent: {stringA, stringB, stringC}
inputA = NaN
inputB = NaN
numRandoms: 2
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1: 1 + floor((currentRandomSeeds(1) * 20))
onboarding = false
randomNum2: randomNum1 + 2 + floor((currentRandomSeeds(2) * 10))
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
allH = Shuffle(Sequence[t, t, -5, 5, 1] \ {0})
numH = Element(allH, Mod[countQuestion, Length[allH]] + 1)
allK = Shuffle(Sequence[t, t, -3, 3, 1] \ {0})
numK = Element(allK, Mod[countQuestion, Length[allK]] + 1)
allA = Shuffle({-3, -2, 2, 3})
allB = Shuffle(Sequence[t, t, 2, 8, 1])
numA = Element(allA, Mod[countQuestion, Length[allA]] + 1)
numB = Element(allB, Mod[countQuestion, Length[allB]] + 1)
given(x) = (numA * numB^(x))
final = Translate(given, Vector[(numH, numK)])
textFinal: "" + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^{" + (LaTeX[Polynomial[x - numH]]) + "}" + (LaTeX[If[numK > 0, "+", "-"]]) + "" + (LaTeX[abs(numK)]) + ""
textSolution: "\textsf{\bold{Solution}}\\
\textsf{The equation of the new function is}\\
g(x)=" + (LaTeX[textFinal]) + ""
InputBoxB = Textfield(inputB)
inputATemp = NaN
correct1: inputATemp ≟ numH
inputBTemp = NaN
correct2: inputBTemp ≟ numK
choice1: "g(x)=h(" + (LaTeX[numB]) + ")^{x}+k"
choice2: "g(x)= " + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^{h}+k"
choice3: "g(x)=" + (LaTeX[numA]) + "( " + (LaTeX[numB]) + ")^{x -h}+k"
choice4: "g(x)=(" + (LaTeX[numA]) + ")^{h}  ( " + (LaTeX[numB]) + ")^{x}+k"
ddMenu: {"$\textsf{Choose the form of the \textcolor{#3A6ED6}{new function}. }$", choice1, choice2, choice3, choice4}
is = SelectedIndex(ddMenu)
isTemp = NaN
correctDD: isTemp ≟ 4
correct: correct1 ∧ correct2 ∧ correctDD
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
helpTextHint1: "\text{Check the form of your function" + (LaTeX[If[correct1 ∧ (¬correct2), " and \\the vertical shift.", (¬correct1) ∧ correct2, " and\\the horizontal shift.", (¬correct1) ∧ (¬correct2), " and", "."]]) + "}\\
\text{" + (LaTeX[If[(¬correct1) ∧ (¬correct2), "the horizontal and vertical shifts."]]) + ""
helpTextHint2: "\text{Check the " + (LaTeX[If[correct1 ∧ (¬correct2), "vertical shift.", (¬correct1) ∧ correct2, "horizontal shift.", "horizontal and"]]) + "}\\
\text{" + (LaTeX[If[(¬correct1) ∧ (¬correct2), "vertical shifts.", ""]]) + "}"
helpTextHint: "" + (LaTeX[If[¬correctDD, helpTextHint1, correctDD, helpTextHint2]]) + ""
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: 178
layoutX: 16
layoutAppSize = Corner(5)
validC: is ≠ 1
inputValid: Sum[{validA, validB, validC}] ≟ 3
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputDefined ∧ inputValid
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)
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))
P1: (-10.9, -10.9)
peep, p1, f, g, h = Polygon(P1, Mirror[P1, yAxis], Mirror[P1, (0, 0)], Mirror[P1, xAxis])
fakeX = Segment((-10.8, 0), (10.8, 0))
fakeY = Segment((0, -10.8), (0, 10.8))
aniSli = 0 (slider from 0 to 2, step 0.1)
speed: 2
horTrans = If(aniSli < 1, Translate[given, Vector[((aniSli * numH), 0)]], Translate[given, Vector[(numH, 0)]])
verTrans = Translate(horTrans, Vector[(0, ((aniSli - 1) * numK))])
GI: (0, given(0))
GIH = If(aniSli < 1, Translate[GI, Vector[((aniSli * numH), 0)]], Translate[GI, Vector[(numH, 0)]])
GIV = Translate(GIH, Vector[(0, ((aniSli - 1) * numK))])
HVect = Vector(GI, GIH)
VVect = Vector(GIH, GIV)
ao = Asymptote(verTrans)
transVec = Vector(GI, GIV)
textStudFun2: "" + (LaTeX[inputA]) + "(" + (LaTeX[numB]) + ")^x" + (LaTeX[If[inputB > 0, ("+" * inputB), inputB < 0, ("" * inputB), ""]]) + ""
textStudFun3: "" + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^{" + (LaTeX[inputA]) + "}" + (LaTeX[If[inputB > 0, ("+" * inputB), inputB < 0, ("" * inputB), ""]]) + ""
textStudFun4: "" + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^{" + (LaTeX[Polynomial[x - inputA]]) + "}" + (LaTeX[If[inputB > 0, ("+" * inputB), inputB < 0, ("" * inputB), ""]]) + ""
textStudFun5: "" + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^x" + (LaTeX[If[inputB > 0, ("+" * inputB), inputB < 0, ("" * inputB), ""]]) + ""
textStudFun: "g(x)=" + (LaTeX[If[is ≟ 1, "", is ≟ 2, textStudFun2, is ≟ 3, textStudFun3, is ≟ 4, textStudFun4, textStudFun5]]) + ""
isTypicalError: false
A = (-18.501048556594508, 6.019765320573812)
G = (-18.12695790771416, 6.139124282029831)
I = (-25.713407381226656, -0.24936248412705536)
xComp = Segment(GI, GIH)
yComp = Segment(GIH, GIV)
altText: "\text{The graph of the function \(f(x)=" + (LaTeX[given]) + "\) is displayed. The play button starts an animation that translates the given function.}"
textGiven: "" + (LaTeX[numA]) + "(" + (LaTeX[numB]) + ")^x"
textQuestion: "\textsf{The function }\[f(x)=" + (LaTeX[textGiven]) + "\] \textsf{ is given.}\\
\textsf{Push the PLAY button to translate it.} "
studF = If(is ≟ 1, x, is ≟ 2, (inputA * numB^(x)) + inputB, is ≟ 3, (numA * numB^(inputA)) + inputB, is ≟ 4, (numA * numB^(x - inputA)) + inputB, (numA^(inputA) * numB^(x)) + inputB)
tabOrder: {textQuestion, btnPlay, ddMenu, textInstruct, InputBoxA, InputBoxB, btnValidate, textHint, textSolution, btnNew}
H: (x(G) + 2, y(G))
J: (x(I) + 2, y(I))
K: (-16.80802, y(I))
L: (x(K) + 2, y(K))
B: (x(A) + 2, y(A))
labelStud: "y=" + (LaTeX[If[is ≟ 1, x, is ≟ 2, (inputA * numB^(x)) + inputB, is ≟ 3, (numA * numB^(inputA)) + inputB, is ≟ 4, (numA * numB^(x - inputA)) + inputB, (numA^(inputA) * numB^(x)) + inputB]]) + ""
PLG = Intersect(final, If[numA < 0, y = -10, y = 11], (1.951438025871231, -10))
PLS = Intersect(studF, If[3 ≤ is ≤ 5 ∧ numA < 0 ∨ is ≟ 2 ∧ inputA < 0, y = -10, y = 11], (11, 11))
PLF: Intersect[given, x = -10, (-10, -3.30763433758404E-8)] + (0, 1.5)

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)