$\mathsf{n=%v}$

1

#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{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{Simplify the expression by showing only positive exponents. } 

Organize

q3

\text{Drag into the blanks}

1 = arrow left, 2 = arrow right, 3 = arrow uo, 4 = arrow down

allRandomSeeds = RandomUniform(0, 0.99, 200)
countQuestion = 0
numOfRandoms: 5
ranindex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numOfRandoms)] * numOfRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, ranindex, ranindex + numOfRandoms - 1)
wid: 0.5
randomListExp1: Sequence[-3, 3] \ {0}
randomVar1: Sequence[97, 97 + 25] \ {101, 105, 111}
var1 = Element(randomVar1, floor((currentRandomSeeds(4) * Length[randomVar1])) + 1)
randomVar2: Sequence[97, 97 + 25] \ {var1, 101, 105, 111}
exp1 = Element(randomListExp1, floor((currentRandomSeeds(2) * 6)) + 1)
randomListExp2: Sequence[-3, If[exp1 ≥ 0, 0, 3]] \ {0}
hei: 0.4
var2 = Element(randomVar2, floor((currentRandomSeeds(4) * Length[randomVar2])) + 1)
var2Letter = UnicodeToLetter(var2)
var1Letter = UnicodeToLetter(var1)
case = If(currentRandomSeeds(1) ≤ 0.5, 1, 2)
exp2 = Element(randomListExp2, floor((currentRandomSeeds(3) * Length[randomListExp2])) + 1)
product: "" + (LaTeX[var1Letter]) + "^{" + (LaTeX[If[exp1 ≟ 1, "", Text[exp1]]]) + "}" + (LaTeX[var2Letter]) + "^{" + (LaTeX[If[exp2 ≟ 1, "", Text[exp2]]]) + "}"
quotient: "\frac{" + (LaTeX[var1Letter]) + "^{" + (LaTeX[If[exp1 ≟ 1, "", Text[exp1]]]) + "}}{" + (LaTeX[var2Letter]) + "^{" + (LaTeX[If[exp2 ≟ 1, "", Text[exp2]]]) + "}}"
expresionToShow: "" + (LaTeX[If[case ≟ 1, product, quotient]]) + "="
D: (-2.46, 2.01)
D': (0.35, y(D))
C = (-0.8999999999999999, 2.6)
C2: C - (0, hei)
C4: C + (wid, 0)
C3: C + (wid, (-hei))
q3, c, c2, c3, c4 = Polygon(C, C2, C3, C4)
qUP = Polygon({D', D' - ((3 * wid), 0), D' + ((-3 * wid), (-hei)), D' + (0, (-hei))})
B = (-1.5999999999999999, 2.6)
B4: B + (wid, 0)
B3: B + (wid, (-hei))
B2: B - (0, hei)
q2, b, b2, b3, b4 = Polygon(B, B2, B3, B4)
qDown = Translate(qUP, Vector[(0, -0.5)])
A = (-2.3, 2.6)
A2: A - (0, hei)
A4: A + (wid, 0)
A3: A + (wid, (-hei))
q1, a, a2, a3, a4 = Polygon(A, A2, A3, A4)
n = 0 (slider from -5 to 5, step 1)
productHint = TableText(Append[Sequence["a\hspace{15}\times", ii, 1, abs(n) - 1], "a"])
hintPower = TableText({(("a^{" * n) * "}")}, {"="}, If[n ≟ 0, {1}, If[n ≥ 0, {("1\hspace{15}\times" * productHint)}, {(("\frac{1}{" * productHint) * "}")}]], "v")
dragText1: "" + (LaTeX[var1Letter]) + "^{" + (LaTeX[If[abs(exp1) ≟ 1, "", Text[abs(exp1)]]]) + "}"
text3InReg1 = Defined(IndexOf[true, Zip[IsInRegion[VV, qUP], VV, Sequence[Vertex[q3, ii], ii, 1, 4]]])
correct3 = If(exp1 ≤ 0 ∧ (case ≟ 1 ∧ exp2 ≤ 0 ∨ case ≟ 2 ∧ exp2 ≥ 0), text3InReg1, true)
text1InReg1 = Defined(IndexOf[true, Zip[IsInRegion[VV, qUP], VV, Sequence[Vertex[q1, ii], ii, 1, 4]]])
text1InReg2 = Defined(IndexOf[true, Zip[IsInRegion[VV, qDown], VV, Sequence[Vertex[q1, ii], ii, 1, 4]]])
correct1 = If(exp1 ≥ 0, text1InReg1, text1InReg2)
dragText2: "" + (LaTeX[var2Letter]) + "^{" + (LaTeX[If[abs(exp2) ≟ 1, "", Text[abs(exp2)]]]) + "}"
text2InReg2 = Defined(IndexOf[true, Zip[IsInRegion[VV, qDown], VV, Sequence[Vertex[q2, ii], ii, 1, 4]]])
text2InReg1 = Defined(IndexOf[true, Zip[IsInRegion[VV, qUP], VV, Sequence[Vertex[q2, ii], ii, 1, 4]]])
correct2 = If(case ≟ 1, If[exp2 ≥ 0, text2InReg1, text2InReg2], If[exp2 ≥ 0, text2InReg2, text2InReg1])
InReg2: {}
InReg1: {}
inputSaved: {{}, {}}
input1 = NaN
input2 = NaN
inputCurrent: {InReg1, InReg2}
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct: correct1 ∧ correct2 ∧ correct3
isTypicalError: input2 ≟ input1 + 1
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
helpTextHint: "\text{Slide to explore exponents\\\vspace{92}" + (LaTeX[hintPower]) + "}"
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: 180
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 550 + 24
layoutAppSize = Corner(5)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
text3InReg2 = Defined(IndexOf[true, Zip[IsInRegion[VV, qDown], VV, Sequence[Vertex[q3, ii], ii, 1, 4]]])
regText1 = If(text1InReg2, 2, If[text1InReg1, 1, 0])
regText2 = If(text2InReg2, 2, If[text2InReg1, 1, 0])
regText3 = If(text3InReg2, 2, If[text3InReg1, 1, 0])
HomeLocations = Sequence((-2.3 + (ii * 0.7), 2.6), ii, 0, 2)
UsedLocations = Zip(Corner[TT, 4], TT, {dragText1, dragText2, dragText3})
TargetLocationsDown: {Vertex[qDown, 2], Vertex[qDown, 2] + (wid, 0), Vertex[qDown, 2] + ((2 * wid), 0)}
TargetLocationsUp: {Vertex[qUP, 2], Vertex[qUP, 2] + (wid, 0), Vertex[qUP, 2] + ((2 * wid), 0)}
Loc1 = If(regText1 ≟ 1, TargetLocationsUp(IndexOf[1, InReg1]), regText1 ≟ 2, TargetLocationsDown(IndexOf[1, InReg2]), HomeLocations(1))
Loc2 = If(regText2 ≟ 1, TargetLocationsUp(IndexOf[2, InReg1]), regText2 ≟ 2, TargetLocationsDown(IndexOf[2, InReg2]), HomeLocations(2))
Loc3 = If(regText3 ≟ 1, TargetLocationsUp(IndexOf[3, InReg1]), regText3 ≟ 2, TargetLocationsDown(IndexOf[3, InReg2]), HomeLocations(3))
num = If(Length[InReg1] ≥ 1, Zip[Element[{((("\hspace{" * If[ii ≟ InReg1(1), 0, -20]) * "}") * dragText1), ((("\hspace{" * If[ii ≟ InReg1(1), 0, -20]) * "}") * dragText2), ((("\hspace{" * If[ii ≟ InReg1(1), 0, -20]) * "}") * dragText3)}, ii], ii, InReg1], {})
den = If(Length[InReg2] ≥ 1, Zip[Element[{((("\hspace{" * If[ii ≟ InReg2(1), 0, -20]) * "}") * dragText1), ((("\hspace{" * If[ii ≟ InReg2(1), 0, -20]) * "}") * dragText2), ((("\hspace{" * If[ii ≟ InReg1(2), 0, -20]) * "}") * dragText3)}, ii], ii, InReg2], {})
box = 3
Cor1 = (-2.578581858971241, -0.8091106619273896)
Cor3 = (3.532425166616719, 3.0469129369672805)
denText = TableText(If[Length[den] ≥ 1, If[Length[den] ≥ 2, Remove[den, {"\hspace{-20}1", "\hspace{0}1"}], den], {1}])
numText = TableText(If[Length[InReg1] ≥ 1, If[Length[InReg1] ≥ 2, Remove[num, {"\hspace{-20}1", "\hspace{0}1"}], num], {1}])
ans = If(Length[InReg2] ≟ 0 ∨ InReg2 ≟ {3}, If[Length[InReg1] ≥ 1, numText, ""], (((("\frac{" * If[Length[InReg1] ≥ 1, numText, ""]) * "}{") * denText) * "}"))
expectedNum: ((If[exp1 ≥ 0, (var1Letter * If[exp1 ≟ 1, "", ("^" * exp1)]), ""] * If[case ≟ 1 ∧ exp2 ≥ 0 ∨ case ≟ 2 ∧ exp2 ≤ 0, (var2Letter * If[abs(exp2) ≟ 1, "", ("^" * abs(exp2))]), ""]) * If[exp1 ≤ 0 ∧ (¬(case ≟ 1 ∧ exp2 ≥ 0 ∨ case ≟ 2 ∧ exp2 ≤ 0)), "1", ""])
expectedDen: (If[exp1 ≤ 0, (var1Letter * If[exp1 ≟ -1, "", ("^" * abs(exp1))]), ""] * If[case ≟ 2 ∧ exp2 ≥ 0 ∨ case ≟ 1 ∧ exp2 ≤ 0, (var2Letter * If[abs(exp2) ≟ 1, "", ("^" * abs(exp2))]), ""])
textAnswer: "" + (LaTeX[If[case ≟ 1, product, quotient]]) + " = " + (LaTeX[If[expectedDen ≠ "", "\frac{", ""]]) + "" + (LaTeX[expectedNum]) + "" + (LaTeX[If[expectedDen ≠ "", (("}{" * expectedDen) * "}"), ""]]) + ""
dragText1Pos = Text(dragText1, Midpoint[A, A3], true, true, 0, 0)
dragText2Pos = Text(dragText2, Midpoint[B, B3], true, true, 0, 0)
dragText3Pos = Text(dragText3, Midpoint[C, C3], true, true, 0, 0)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ Length[InReg1] ≥ 0
text1: "=" + (LaTeX[ans]) + ""
text3 = Text(text1, (0, 0), true, true, 1, 0)
f: y = y(D)
box1InMovement: ¬Defined[IndexOf[A, Join[{HomeLocations, TargetLocationsUp, TargetLocationsDown}]]]
box2InMovement: ¬Defined[IndexOf[B, Join[{HomeLocations, TargetLocationsUp, TargetLocationsDown}]]]
box3InMovement: ¬Defined[IndexOf[C, Join[{HomeLocations, TargetLocationsUp, TargetLocationsDown}]]]
qupActive: true ∈ Zip[Element[{box1InMovement, box2InMovement, box3InMovement}, kk], kk, InReg1]
qdownActive: true ∈ Zip[Element[{box1InMovement, box2InMovement, box3InMovement}, kk], kk, InReg2]
textSolution: "\textsf{\bold{Possible Solution}}\\
\hspace{-8}" + (LaTeX[TableText[{"\textsf{Variables with negative exponents\\in the numerator move to the\\denominator and vice versa.\\Variables with positive exponents\\do not move.}"}]]) + "
\hspace{100}\Large{" + (LaTeX[textAnswer]) + "}"
onboarding_{1}: true
onboardingX_{1}: 310
onboardingY_{1}: 100
onboardingCase_{1} = 1
OnboardingTextOffset_{1} = onboardingTextOffset(Corner[onboardingText_{1}, 1], Corner[onboardingText_{1}, 3], onboardingCase_{1}, Cor1, Cor3, (800, 500))
onboardingDisplayText_{1}: "\text{\vphantom{Og}" + (LaTeX[onboardingText_{1}]) + "}"
onboarding = true
pulsingSpeed: 8
pulsing = 0.8 (slider from 0 to 1, step 0.1)
pulsingObject = expandQuad(A, A2, A3, A4, (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject2 = expandQuad(B, B2, B3, B4, (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject3 = expandQuad(C, C2, C3, C4, (7 * pulsing), Cor1, Cor3, (800, 500))
equationToShow = TableText({expresionToShow, "\hspace{-20}\frac{\phantom\LARGE{p^{5}h^{-3}}\hspace{33}}{\phantom\LARGE{p^{5}h^{-3}}}", ("\hspace{-20}" * text3)}, "rcl", 180, 150)

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: PixelsToPoint (command PixelsToPoint1)
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: PointToPixels
PointToPixels(Corner1,Corner3,Corner5,InputPoint)
Input: Corner1, Corner3, Corner5, InputPoint
Output: OutputPixels

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

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: onboardingTextOffset (command onboardingTextOffset1)
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: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)