\text{Click to start}

#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{This is the answer.}

$a=\vphantom{b}$

$b=$

Reset app

\text{Be sure your values use the same rule as the completed rows.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

\text{Complete the table following the same rule used in the first rows.} 

$\textsf{ANIMATE}$

\textsf\bold{Solution}\

$\textsf{SKIP ANIMATION}$

anim = 0 (slider from 0 to 3.5, step 0.01)
allRandomSeeds = RandomUniform(0, 0.99, 200)
numRandoms: 9
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1: 1 + floor((currentRandomSeeds(1) * 2)) + 2
chosenOperation = Element({"+", "-", "\times", "\div"}, randomNum1)
randomNum2: 1 + floor((currentRandomSeeds(2) * 10))
inp1: floor((currentRandomSeeds(3) * 10)) + If[randomNum1 ≟ 2, randomNum2, 0]
inp2: inp1 + 1 + floor((currentRandomSeeds(4) * 3))
inp3: inp2 + 1 + floor((currentRandomSeeds(5) * 3))
inp4: inp3 + 1 + floor((currentRandomSeeds(6) * 3))
inp5: inp4 + 1 + floor((currentRandomSeeds(7) * 3))
ins: ({inp1, inp2, inp3, inp4, inp5} * If[randomNum1 ≟ 4, randomNum2, 1])
out1 = Zip(kk + randomNum2, kk, ins)
out2 = Zip(kk - randomNum2, kk, ins)
out3 = Zip((kk * randomNum2), kk, ins)
out4 = Zip(kk / randomNum2, kk, ins)
outs = Element({out1, out2, out3, out4}, randomNum1)
animCount = 1
machineSize: 1.8
MoveMachine = (4.271331834811058, 4.1399809417921904)
shake = 0 (slider from 0 to 1)
D: MoveMachine + (0, machineSize) + (0.01 * (sin(((5 * pi) * shake)), sin((pi * shake))))
input2 = NaN
showInOut2 = If(currentRandomSeeds(9) ≥ 0.5, 0, 1)
input1 = NaN
showInOut1 = If(currentRandomSeeds(8) ≥ 0.5, 0, 1)
onboarding = false
inputSaved: {NaN, NaN}
inputCurrent: {input1, input2}
B = (5.000341064524864, 5.69392166828734)
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct1: input1 ≟ If[showInOut1 ≟ 1, ins(4), outs(4)]
correct2: input2 ≟ If[showInOut2 ≟ 1, ins(5), outs(5)]
correct: correct1 ∧ correct2
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent] ∧ (¬onboarding)
helpTextHint: "\textsf{Think about whether multiplication or division could be used to \\take an input of " + (LaTeX[ins(1)]) + " and result in an output of " + (LaTeX[outs(1)]) + ".\\Test that for the other rows."
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: 350
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
pulsingSpeed: 8
pulsing = 0.8 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
A = (4.591072725036432, 5.892161020227049)
C = (4.917208433066277, 6.084005554362252)
pulsingObject = sectorPixels(A, B, C, haloPixels + 40, Corner[1], Corner[3], Corner[5])
displayAngle = sectorPixels(A, B, C, 40, Corner[1], Corner[3], Corner[5])
layoutOnboarding = PointToPixels(Corner[onboardingDisplayText, 2], Corner[1], Corner[3], Corner[5])
onboardingX: 400
onboardingY: 148
onboardingCase: 2
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
isTypicalError: ¬correct
MoveBand = (3.906827219954176, 4.171955030814725)
E: MoveBand + (3, 0)
MoveGL = (4.348005700287093, 4.837016082483428)
hGL: y = y(MoveGL)
vGL: x = x(MoveGL)
vGL' = Translate(vGL, Vector[(Vector[Corner[1], Corner[2]] / 800 * 16)])
F: MoveMachine + (0.01 * (sin(((11 * pi) * shake)), sin(((5 * pi) * shake))))
G: MoveMachine + (machineSize, 0) + (0.01 * (sin(((7 * pi) * shake)), sin(((3 * pi) * shake))))
Cor1 = (1.8093269800759793, 3.7626866913262917)
Cor3 = (6.93797085929035, 6.972885229188688)
text1: "\fbox{a" + (LaTeX[chosenOperation]) + "" + (LaTeX[randomNum2]) + "}"
H: (5.09807, 5.85)
text2 = Text(text1, H, true, true, 0, 1)
AnimPoint1: (4 + anim, 4.8)
AnimPoint2: (5, 4.7 + (3 / 4 * (anim - 1)))
AnimPoint3 = If(anim ≤ 2.5, (5, 5.45), (5 + (2 * (anim - 2.5)), 5.45 - ((anim - 2.5)^(0.2) * (5.45 - 4.8))))
AnimPoint = Element({AnimPoint1, AnimPoint2, AnimPoint3, AnimPoint3}, floor(anim) + 1)
text3: "\fbox{" + (LaTeX[If[anim ≤ 2.3, Text[ins(animCount)], ""]]) + "" + (LaTeX[If[2 ≤ anim ≤ 2.3, (chosenOperation * randomNum2), anim > 2.3, Text[outs(animCount)]]]) + "}"
text4 = Text(text3, AnimPoint, true, true, 0, 0)
speedShake: 6
speedAnim: 1
AnimPointDrop: (5.1, 5.45 - (anim - 2) / 2)
text5 = Text((chosenOperation * randomNum2), AnimPointDrop, true, true, 0, 0)
showmachine: showsolution ∨ validate ∧ correct
a(x) = x ≥ x(Corner[2]) - (16 / 800 * x(Corner[2] - Corner[1]))
animEnd: anim ≟ 3.5 ∧ animCount ≟ 6
boldIns: {false, false, false, showInOut1 ≟ 1, showInOut2 ≟ 1}
boldOuts: {false, false, false, showInOut1 ≠ 1, showInOut2 ≠ 1}
insText = Zip(((If[kk, "\bold{", "{"] * nn) * "}"), kk, boldIns, nn, ins)
outsText = Zip(((If[kk, "\bold{", "{"] * nn) * "}"), kk, boldOuts, nn, outs)
table = TableText(Append["\textsf{Input}", Zip[Text[kk], kk, ({inp1, inp2, inp3, inp4, inp5} * If[randomNum1 ≟ 4, randomNum2, 1])]], Append["\textsf{Output}", Zip[Text[kk], kk, outs]], "c_|v", 100, 46)
tableSol = TableText(Take[insText, 1, Min[animCount, 5]], Sequence[chosenOperation, ii, 1, Min[animCount, 5]], Sequence[randomNum2, ii, 1, Min[animCount, 5]], Sequence["=", ii, 1, Min[animCount, 5]], Take[outsText, 1, Min[animCount, 5] - If[anim ≤ 2.5, 1, 0]], "v,c", 10, 46)
hGL' = Translate(hGL, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)])

Tool: PointToPixels
PointToPixels(InputPoint,Corner1,Corner3,Corner5)
Input: InputPoint, Corner1, Corner3, Corner5
Output: OutputPixels

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

Tool: sectorPixels
sectorPixels(Midpoint,B,C,pixelRadius,Corner1,Corner3,Corner5
Input: A, B, C, pixelRadius, Corner1, Corner3, Corner5
Output: newSector

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
BPrime: A + (pointRadius * UnitVector[B - A])
newSector = CircleSector(A, BPrime, C)

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)