\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.}

$Ratio=$

$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

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

#f5e0d2

#E2DFF8

#d2e4e2

#008475

#C75000

#5145A8

\text{Please enter your ratio as a fraction.}

countQuestion = 0
applesNums_{1} = Shuffle(Sequence[20])
questionCount_{1}: countQuestion
applesNum = Element(applesNums_{1}, Mod[questionCount_{1}, Length[applesNums_{1}]] + 1)
orangesNums_{1} = Shuffle(Sequence[25 - applesNum])
orangesNum = Element(orangesNums_{1}, 1)
corrects: {applesNum / orangesNum, orangesNum / applesNum, applesNum / (orangesNum + applesNum), orangesNum / (orangesNum + applesNum)}
allRandomSeeds = RandomUniform(0, 0.99, 200)
applesPos_{1} = Sample(Sequence[36], applesNum, false)
orangesPos_{1} = Sample(Sequence[36] \ applesPos_{1}, orangesNum, false)
numRandoms: 2
input1: NaN
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1: 1 + floor((currentRandomSeeds(1) * 4))
onboarding = false
inputSaved: {NaN, NaN}
input2 = NaN
inputCurrent: {input1}
B = (5.000341064524864, 5.69392166828734)
randomNum2: randomNum1 + 2 + floor((currentRandomSeeds(2) * 10))
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct2: input2 ≟ randomNum2
correct1: input1 ≟ Element[corrects, randomNum1]
correct: correct1
isTypicalError: input2 ≟ input1 + 1
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: "\text{Count the number of " + (LaTeX[If[Mod[randomNum1, 2] ≟ 0, "oranges", "apples"]]) + ", then count the number of " + (LaTeX[If[randomNum1 ≟ 1, "oranges", randomNum1 ≟ 2, "apples", "pieces of fruit"]]) + ".}"
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: 322 - 8 - 12
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 162
layoutAppSize = Corner(5)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
pulsingSpeed: 8
pulsing = 0.3 (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])
box_{1} = Polygon({(0, 0), (10, 0), (10, 4), (0, 4)})
positions_{1} = Flatten(Sequence[Sequence[(0.5 + CLIPBOARDmagicSTRINGkk, 4 - (0.5 + CLIPBOARDmagicSTRINGjj)), CLIPBOARDmagicSTRINGkk, 0, 9], CLIPBOARDmagicSTRINGjj, 0, 4])
totalNum_{1} = NaN
Cor1 = (-2.4079473684210533, -4.17437894736842)
Cor3 = (12.407947368421054, 5.104694736842107)
MoveGL_{1} = (10.500400921052634, -0.8895868631578931)
vGL_{1}: x = x(MoveGL_{1})
hGL_{1}: y = y(MoveGL_{1})
vGL'_{1} = Translate(vGL_{1}, Vector[(Vector[Corner[1], Corner[2]] / 800 * 16)])
vGL'_{2} = Translate(vGL_{1}, Vector[(Vector[Corner[1], Corner[2]] / 800 * 64)])
pic1'_{1} = Dilate(pic1_{1}, 0.11)
l1_{1} = Zip(Translate[pic1'_{1}, Vector[positions_{1}(CLIPBOARDmagicSTRINGkk)]], CLIPBOARDmagicSTRINGkk, applesPos_{1})
pic2'_{1} = Dilate(pic2_{1}, 0.11)
l2_{1} = Zip(Translate[pic2'_{1}, Vector[positions_{1}(CLIPBOARDmagicSTRINGkk)]], CLIPBOARDmagicSTRINGkk, orangesPos_{1})
anim1 = 0 (slider from 0 to applesNum, step 1)
CentersApples = Zip(positions_{1}(kk), kk, Sort[Take[applesPos_{1}, 1, applesNum]])
l1 = Zip(Text[kk, PP, true, true, 0, 0], kk, Sequence[anim1], PP, CentersApples)
CentersOranges = Zip(positions_{1}(kk), kk, Sort[Take[orangesPos_{1}, 1, orangesNum]])
anim2 = 0 (slider from 0 to orangesNum, step 1)
l2 = Zip(Text[kk, PP, true, true, 0, 0], kk, Sequence[anim2], PP, CentersOranges)
word1 = If(Mod[randomNum1, 2] ≟ 0, "oranges", "apples")
word2 = If(randomNum1 ≟ 1, "oranges", randomNum1 ≟ 2, "apples", "pieces of fruit")
canbesimplified: Numerator[Element[corrects, randomNum1]] ≠ If[Mod[randomNum1, 2] ≟ 0, orangesNum, applesNum] ∨ Denominator[Element[corrects, randomNum1]] ≟ 1
text1: "\text{ = }\frac{\bold{" + (LaTeX[If[Mod[randomNum1, 2] ≟ 0, (((("\textcolor{" * colorOrange) * "}{") * orangesNum) * "}"), (((("\textcolor{" * colorGreen) * "}{") * applesNum) * "}")]]) + "}}{\bold{" + (LaTeX[If[randomNum1 ≟ 1, (((("\textcolor{" * colorOrange) * "}{") * orangesNum) * "}"), randomNum1 ≟ 2, (((("\textcolor{" * colorGreen) * "}{") * applesNum) * "}"), ("" * (applesNum + orangesNum))]]) + "}}" + (LaTeX[If[canbesimplified, (" = " * FractionText[Element[corrects, randomNum1]]), ""]]) + ""
hGL'_{1} = Translate(hGL_{1}, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)])
speedAnim1: 30 / applesNum
speedAnim2: 30 / orangesNum
textQuestion: "\text{What is the ratio of " + (LaTeX[If[Mod[randomNum1, 2] ≟ 0, "oranges", "apples"]]) + " to " + (LaTeX[If[randomNum1 ≟ 1, "oranges", randomNum1 ≟ 2, "apples", "total pieces of fruit"]]) + "?} "
textSolution: "\text{\bold{\textcolor{#006758}{Possible Solution}}}\\
\text{Number of apples = " + (LaTeX[(If[anim1 ≟ applesNum, (((("\bold\textcolor{" * colorGreen) * "}{") * applesNum) * "}. Number of oranges = "), ""] * If[anim2 ≟ orangesNum, (((("\bold\textcolor{" * colorOrange) * "}{") * orangesNum) * "}."), ""])]) + "}
\text{" + (LaTeX[If[anim2 ≟ orangesNum ∧ randomNum1 ≥ 3, ((((((((((" Total pieces of fruits = \bold\textcolor{" * colorGreen) * "}{") * applesNum) * "} + \bold\textcolor{") * colorOrange) * "}{") * orangesNum) * "} = \bold{") * (orangesNum + applesNum)) * "}. ")]]) + "}\\\text{" + (LaTeX[If[anim2 ≟ orangesNum, ((((((((((("Ratio of " * word1) * " to ") * word2) * " = \frac{Number of ") * word1) * "}{") * "Number of ") * word2) * "}") * text1) * "."), ""]]) + "}"
tabOrder: {textQuestion, InputBox1, btnValidate, textHint, textSolution, btnNew}
inputAsString = Text((InputBox1 * ""), false)
colon = Defined(IndexOf[":", inputAsString])

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)

Tool: centerText
centerText(sizeStr,textStr)
Input: sizeStr, textString
Output: centeredLatex

this is dynamic centered text

centeredLatex: (((("\begin{tabular}\hspace{" * sizeStr) * "}\\") * textString) * "\end{tabular}")