#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$a=\vphantom{b}$

$b=$

Reset app

\text{Make sure the coefficient is a number between 1 and 10.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Try rewriting both numbers so that they have the same power of 10.}

#eeeeee

#2E006758

#2EB00020

\text{Perform the operation and write your answer using scientific notation. } 

\vphantom{n}\cdot10

allRandomSeeds = RandomUniform(0, 0.99, 200)
onboarding = false
inputSaved: {{"\", "c", "d", "o", "t", "1", "0", "^", "{", "?", "}"}}
input1 = NaN
input2 = NaN
inputNumber: (input1 * 10^(input2))
textInput: "" + (LaTeX[Text[input1, false]]) + "\cdot10^{" + (LaTeX[input2]) + "}"
inputTextList = Zip(UnicodeToLetter[n], n, TextToUnicode[textInput])
inputCurrent: {inputTextList}
power: {-5, -4, -3, -2, -1, 1, 2, 3, 4, 5}
countQuestion = 0
numRandoms: 10
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
baseOptions = Join({Sequence[-9.9, -1, 0.1], Sequence[1, 9.9, 0.1]})
randomNum2: abs(Element[baseOptions, 1 + floor((currentRandomSeeds(5) * Length[baseOptions]))])
randomExponent1 = Element({-5, -4, -3, -2, -1, 1, 2, 3, 4, 5}, 1 + floor((currentRandomSeeds(2) * 10)))
possibleExponent2 = KeepIf(abs(n - randomExponent1) < 3 ∧ n ≠ randomExponent1, n, {-5, -4, -3, -2, -1, 1, 2, 3, 4, 5})
randomExponent2 = Element(possibleExponent2, 1 + floor((currentRandomSeeds(3) * Length[possibleExponent2])))
num2: (randomNum2 * 10^(randomExponent2))
randomNum1 = Element(baseOptions, 1 + floor((currentRandomSeeds(4) * Length[baseOptions])))
num1: (randomNum1 * 10^(randomExponent1))
randomOp: 1 + floor((currentRandomSeeds(1) * 2))
correctNumber: num1 + (If[randomOp ≟ 1, 1, -1] * num2)
powerBool = Zip(10^(n) < abs(correctNumber) < 10^(n + 1), n, power)
answerPower: power(IndexOf[true, powerBool])
answerCoeff: round(correctNumber / 10^(answerPower), 5)
expDif: abs(randomExponent1 - randomExponent2)
correctText: "" + (LaTeX[answerCoeff]) + "\cdot10^{" + (LaTeX[answerPower]) + "}"
correctTextList: Zip[UnicodeToLetter[n], n, TextToUnicode[correctText]] \ {" "}
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct: correctTextList ≟ inputTextList
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
borderBox = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}])
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
layoutY: 448
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 194
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ Defined[inputNumber] ∧ inputCurrent ≟ RemoveUndefined[inputCurrent] ∧ (¬onboarding)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
count = 2
onboardingCase: 1
onboardingX: 337
onboardingY: 150
useOnboarding: false
layoutCase: 1
layoutHintSolnY: 250
layoutHintSolnX: 11
layoutFeedbackX: layoutX + Element[{If[correct ∨ tries ≟ 3, -5, 126], -5}, layoutCase]
layoutFeedbackY: layoutY + Element[{If[correct, 6, 1], If[correct, 6, If[tries ≟ 3, 1, 51]]}, layoutCase]
textNum1: "" + (LaTeX[randomNum1]) + "\cdot 10^{" + (LaTeX[randomExponent1]) + "}"
textNum2: "" + (LaTeX[randomNum2]) + " \cdot 10^{" + (LaTeX[randomExponent2]) + "}"
textOpSign: If[randomOp ≟ 1, "+", "-"] + ""
textOpWord: If[randomOp ≟ 1, "sum", "difference"] + ""
textCaptionSize: "" + (LaTeX[textNum1]) + " " + (LaTeX[textOpSign]) + " " + (LaTeX[textNum2]) + " "
PointSize: (2, 5)
PointCornerSize = Corner(textCaptionSize, 4)
vectorSize: PointSize - PointCornerSize
dimensions: {1.2774410243333376, 2.934163708929425, 7.305765298037565, 6.707504540596336}
pixelW: (dimensions(3) - dimensions(1)) / 800
pixelH: (dimensions(4) - dimensions(2)) / 500
widthCaption: abs(x(Corner[textCaptionSize, 3]) - x(Corner[textCaptionSize, 1]))
heightCaption: abs(y(Corner[textCaptionSize, 3]) - y(Corner[textCaptionSize, 1]))
PointCaption: ((dimensions(3) + dimensions(1)) / 2, dimensions(4) - (60 * pixelH)) + (((-widthCaption)) / 2, 0) + vectorSize
textCaption: "" + (LaTeX[textCaptionSize]) + ""
isTypicalError: inputNumber ≟ correctNumber ∧ inputTextList ≠ correctTextList
textAnswer: "\text{" + (LaTeX[correctText]) + "}"
textSolution: "\textsf{\bold{Possible Solution Methods}}\\
\begin{array}{llll}
\multicolumn{2}{l}\textsf{Method 1}&\multicolumn{2}{l}\textsf{Method 2}\\
\multicolumn{2}{l}\textsf{Write both numbers with the same exponent.}&\multicolumn{2}{l}\textsf{Write both numbers in decimal form.}\\
\phantom{=}\;" + (LaTeX[randomNum1]) + "\cdot10^{" + (LaTeX[randomExponent1]) + "}" + (LaTeX[textOpSign]) + "" + (LaTeX[randomNum2]) + "\cdot10^{" + (LaTeX[randomExponent2]) + "}&&\phantom{=}\;" + (LaTeX[randomNum1]) + "\cdot10^{" + (LaTeX[randomExponent1]) + "}" + (LaTeX[textOpSign]) + "" + (LaTeX[randomNum2]) + "\cdot10^{" + (LaTeX[randomExponent2]) + "}\\
=" + (LaTeX[randomNum1]) + "\cdot10^{" + (LaTeX[randomExponent1]) + "} " + (LaTeX[textOpSign]) + " " + (LaTeX[(randomNum2 * 10^(randomExponent2 - randomExponent1))]) + "\cdot10^{" + (LaTeX[randomExponent1]) + "}&&=" + (LaTeX[num1]) + "" + (LaTeX[textOpSign]) + "" + (LaTeX[num2]) + "\\
=" + (LaTeX[randomNum1 + ((If[randomOp ≟ 1, 1, -1] * randomNum2) * 10^(randomExponent2 - randomExponent1))]) + "\cdot10^{" + (LaTeX[randomExponent1]) + "}&&=" + (LaTeX[correctNumber]) + "\\" + (LaTeX[If[1 ≤ abs(randomNum1 + ((If[randomOp ≟ 1, 1, -1] * randomNum2) * 10^(randomExponent2 - randomExponent1))) < 10, "", "=" + correctText]]) + "&&=" + (LaTeX[correctText]) + "\\


\end{array}"
tabOrder: {textQuestion, textCaption, InputBox1, text10, InputBox2, showhint, textCountCorrect, btnValidate, textSolution, textAnswer, btnNew}
l1: {"\", "c", "d", "o", "t", "1", "0", "^", "{", "?", "}"}

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)