#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

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

\text{}

#eeeeee

#2E006758

#2EB00020

$\text{Rounded Number =}$

allRandomSeeds = RandomUniform(0, 0.99, 200)
tempInputNum = NaN
countQuestion = 0
numRandoms: 6
maxRandIndex: Mod[(countQuestion * numRandoms) + numRandoms - 1, Length[allRandomSeeds] - numRandoms] + 1
currentRandomSeeds = If(maxRandIndex > numRandoms, Take[allRandomSeeds, maxRandIndex - numRandoms, maxRandIndex], Take[allRandomSeeds, 1, numRandoms])
placeIndex = If(countQuestion ≟ 0, 4, floor((currentRandomSeeds(1) * 3)) + 4)
roundingIndexList = Sequence(k, k, 1, placeIndex - 1)
roundingTestNumber = If(currentRandomSeeds(2) < 0.1, round(((currentRandomSeeds(2) + 0.1) * 10^(placeIndex))), round((currentRandomSeeds(2) * 10^(placeIndex))))
roundingIndex: floor((currentRandomSeeds(3) * Length[roundingIndexList])) + 1
roundedTestNumber: (round(roundingTestNumber / 10^(roundingIndex)) * 10^(roundingIndex))
roundingPlace = Element({"tens", "hundreds", "thousands", "ten thousands", "hundred thousands"}, roundingIndex)
roundingNumber = If(roundedTestNumber ≟ roundingTestNumber, roundingTestNumber + 10^(roundingIndex - 1), roundingTestNumber)
digitList = Sequence(floor(Mod[roundingNumber / 10^(placeIndex - k), 10]), k, 1, placeIndex)
roundingDigit: digitList(placeIndex - roundingIndex)
textComparison = If(digitList(placeIndex - roundingIndex + 1) ≥ 5, "greater than or equal to", "less than")
textDigitList = Zip(If[B ≟ placeIndex - roundingIndex, (("\textbf{" * A) * "}"), (("" * A) * "")], A, digitList, B, Sequence[k, k, 1, placeIndex])
textNumBolded: "\text{" + (LaTeX[Sum[textDigitList]]) + "}"
roundedNumber: (round(roundingNumber / 10^(roundingIndex)) * 10^(roundingIndex))
textSolutionExplaination: "\text{The digit in the " + (LaTeX[roundingPlace]) + " place of " + (LaTeX[textNumBolded]) + " is " + (LaTeX[roundingDigit]) + ".\\Since the digit after is " + (LaTeX[textComparison]) + " 5, this can be rounded to " + (LaTeX[roundedNumber]) + ".}"
showhint = false
labelFrequency = If(showhint, 2, 10)
numBefore = If(showhint, 4, 0)
boldIndex: {numBefore / labelFrequency + 1, numBefore / labelFrequency + 5 + 1}
numAfter = If(showhint, 2, 0)
numTicks: numBefore + 11 + numAfter
rightEndPoint: (9.5, 0)
numMaxLoc: x(rightEndPoint)
leftEndPoint: (0.5, 0)
numMinLoc: x(leftEndPoint)
segLength: (numMaxLoc - numMinLoc) / (numTicks - 1)
allLabelLocations = Sequence(k, k, numMinLoc, numMaxLoc, (segLength * labelFrequency))
currentViewIndex = 3
lowerNumber: (floor(roundingNumber / 10^(currentViewIndex)) * 10^(currentViewIndex))
StartingViewIndex = Element(Remove[roundingIndexList, {roundingIndex}], 1 + floor((currentRandomSeeds(3) * (Length[roundingIndexList] - 1))))
inputNum = NaN (slider from -5 to 500000)
pixelsTop: 24
pixelsBottom: 16
pixelsLeft: 16
pixelsRight: 16
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
inputPoint = (0, 0)
correct: inputNum ≟ roundedNumber
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
layoutY: 24 + 24 + 24 + 16 + 29
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
inputSaved: {NaN}
inputCurrent: {tempInputNum}
enableBtnValidate: inputCurrent ≠ inputSaved ∧ Length[inputCurrent] ≟ Length[RemoveUndefined[inputCurrent]]
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
pulsingSpeed: 8
pulsing = 0.4 (slider from 0 to 1, step 0.1)
onboardingCase: 4
onboardingX: 225
onboardingY: 130
InputBox1 = Textfield(inputNum)
isTypicalError: false
numMaxNumber: lowerNumber + ((10 + numAfter) * 10^(currentViewIndex - 1))
numMinNumber: lowerNumber - (numBefore * 10^(currentViewIndex - 1))
roundingLocation: ((roundingNumber - numMinNumber) / (numMaxNumber - numMinNumber) * (numMaxLoc - numMinLoc)) + numMinLoc
largeTickLocations = If(showhint, Sequence[k, k, numMinLoc, numMaxLoc, (segLength * 2)], Sequence[k, k, numMinLoc, numMaxLoc, (segLength * 10)])
allLabels = Sequence(lowerNumber + (k * 10^(currentViewIndex - 1)), k, (-numBefore), 10 + numAfter, labelFrequency)
numberLine = Segment(leftEndPoint - (0.5, 0), rightEndPoint + (0.5, 0))
numberPoint: (roundingLocation, 0)
largeTicks = Zip(Segment[(A, -0.16), (A, 0.16)], A, largeTickLocations)
smallTickLocations = If(showhint, Sequence[k, k, numMinLoc + segLength, numMaxLoc - segLength, (segLength * 2)], Sequence[k, k, numMinLoc + segLength, numMaxLoc - segLength, segLength])
smallTicks = Zip(Segment[(A, -0.12), (A, 0.12)], A, smallTickLocations)
correctArrow = If(lowerNumber ≟ roundedNumber, Segment[leftEndPoint - (0, 1), leftEndPoint - (0, 0.6)], Segment[rightEndPoint - (0, 1), rightEndPoint - (0, 0.6)])
allTickLocations = Sequence(k, k, numMinLoc, numMaxLoc, segLength)
regularHintLabelIndex = Remove(Sequence[k, k, 1, (numTicks + 1) / 2, 1], boldIndex)
correctSolutionIndex = If(lowerNumber ≟ roundedNumber, 1, 2)
greenSolutionLabel = Zip(Text["\hspace{7}" + (A), (B, -0.12), true, true, 0, -1], A, Zip[Element[allLabels, k], k, {correctSolutionIndex}], B, Zip[Element[allLabelLocations, k], k, {correctSolutionIndex}])
incorrectSolutionIndex = If(lowerNumber ≟ roundedNumber, 2, 1)
regularSolutionLabel = Zip(Text["\hspace{7}" + (A), (B, -0.12), true, true, 0, -1], A, Zip[Element[allLabels, k], k, {incorrectSolutionIndex}], B, Zip[Element[allLabelLocations, k], k, {incorrectSolutionIndex}])
labelLocationsBold = Zip(Element[allLabelLocations, A], A, boldIndex)
labelLocationsStandard = Remove(allLabelLocations, labelLocationsBold)
regularHintLabels = Zip(Text["\hspace{7}" + (A), (B, -0.12), true, true, 0, -1], A, Zip[Element[allLabels, k], k, regularHintLabelIndex], B, labelLocationsStandard)
labelPoint = Text((("" * roundingNumber) * ""), numberPoint + (0, 0.1), true, true, 0, 1)
roundedLocation: ((roundedNumber - numMinNumber) / (numMaxNumber - numMinNumber) * (numMaxLoc - numMinLoc)) + numMinLoc
solutionPoint: (roundedLocation, 0)
numberPointSolution: numberPoint
labelPointSolution = Text((("" * roundingNumber) * ""), numberPoint + (0, 0.1), true, true, 0, 1)
boldHintLabels = Zip(Text["\hspace{7}" + (A), (B, -0.20), true, true, 0, -1], A, Zip[Element[allLabels, k], k, boldIndex], B, labelLocationsBold)
largestTicks = Zip(Segment[(A, -0.23), (A, 0.23)], A, labelLocationsBold)
textSolution: "\textsf{\bold{Solution}}\\ \\ \\ \\ \\ \\\phantom{1} \\ \phantom{1}\\ \phantom{1}\\ \\ \\ \\ \\ \\ \\ \\ \\ " + (LaTeX[textSolutionExplaination]) + ""
textQuestion: "\textsf{Round \math{" + (LaTeX[roundingNumber]) + "} to the nearest " + (LaTeX[roundingPlace]) + " place.}"

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: 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)

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)