$\text{NEW PROBLEM}$

✓ 

Slide to animate

$\text{✓ Correct}$

$\text{SHOW SOLUTION}$

\text{\textbf\color{#C75000}{Hint}\\Move the solid point \to the solution position.}

$\text{SHOW SOLUTION}$

#B00020

#006758

\text{Slide to animate}

\text{Drag to adjust model}

fracPairs = Shuffle({{1 / 2, 3 / 4}, {3 / 4, 1 / 2}, {1 / 2, 2 / 3}, {2 / 3, 1 / 2}, {1 / 3, 1 / 2}, {1 / 2, 1 / 3}, {1 / 4, 3 / 5}, {3 / 5, 1 / 4}, {2 / 5, 1 / 3}, {1 / 3, 2 / 5}, {2 / 3, 3 / 4}, {3 / 4, 2 / 3}, {1 / 2, 3 / 5}, {3 / 5, 1 / 2}, {2 / 5, 1 / 4}, {1 / 4, 2 / 5}})
wholePairs = Shuffle({{1, 2}, {2, 1}, {1, 1}, {1, 2}, {3, 1}, {2, 3}, {1, 3}, {1, 1}, {2, 1}, {2, 2}, {1, 2}, {2, 1}, {1, 3}, {3, 1}, {2, 1}, {2, 2}})
PAnchor: (0, 0)
moveArea = Polygon({PAnchor + (1, -1), PAnchor + (5, -1), PAnchor + (5, -5), PAnchor + (1, -5)})
PMove = PointIn(moveArea)
currIndex = 11
fracB: fracPairs(currIndex, 2)
fracA: fracPairs(currIndex, 1)
wholeA: wholePairs(currIndex, 1)
numA: wholeA + fracA
correctHorizontal: x(PMove) ≟ numA
wholeB: wholePairs(currIndex, 2)
numB: wholeB + fracB
correctVertical: y(PMove) ≟ (-numB)
productAB: (numA * numB)
solnOffset: (-Min[2, (ceil(productAB) - 4) / 2])
denomB = Denominator(fracB)
denomA = Denominator(fracA)
tolerance: 1 / ((2 * Min[denomA, denomB]))
correct: correctVertical ∧ correctHorizontal
validate = false
showMe = false
showsolution: correct
PReference = If(showsolution, (numA, (-numB)), PMove)
wholeAB: floor(productAB)
fracAB: productAB - wholeAB
numCompositeWholes: wholeAB - (wholeA * wholeB)
spacer: 0.3
PAnchor2: (x(PAnchor) + solnOffset, -5.5)
numerA = Numerator(fracA)
numerB = Numerator(fracB)
numCols: (wholeA * denomA) + numerA
numRows: (wholeB * denomB) + numerB
startPositions = RemoveUndefined(Flatten[Sequence[Sequence[If[i ≥ (wholeA * denomA) ∨ j ≥ (wholeB * denomB), (i / denomA, ((-j)) / denomB) + PAnchor], i, 0, numCols - 1], j, 0, numRows - 1]])
endPositionTemplate = Flatten(Sequence[Sequence[(i / denomA, ((-j)) / denomB) + PAnchor2 + (((wholeA * wholeB) * (1 + spacer)), 0), i, 0, denomA - 1], j, 0, denomB - 1])
numBlocks = Sequence(If[A ≤ numCompositeWholes, (denomA * denomB), ((fracAB * denomA) * denomB)], A, 1, numCompositeWholes + 1)
endPositionsWithExtras = Flatten(Sequence[Zip[Translate[A, ((K * (spacer + 1)), 0)], A, endPositionTemplate], K, 0, Length[numBlocks] - 1])
allEndPositions = Sequence(endPositionsWithExtras(A), A, 1, Sum[numBlocks])
num1Latex: "" + (LaTeX[wholeA]) + "" + (LaTeX[FractionText[fracA]]) + ""
num2Latex: "" + (LaTeX[wholeB]) + "" + (LaTeX[FractionText[fracB]]) + ""
productABLatex: (("" * wholeAB) * If[wholeAB ≠ productAB, FractionText[fracAB], ""])
initialized = false
studentArea = Polygon({PAnchor, (x(PAnchor), y(PReference)), PReference, (x(PReference), y(PAnchor))})
smallBoxTemplate = Polygon({(0, 0), (1 / denomA, 0), (1 / denomA, -1 / denomB), (0, -1 / denomB)})
allSmallBoxes = Zip(Translate[smallBoxTemplate, A], A, startPositions)
sliderSoln = 0 (slider from 0 to 1)
startUnitPositions = Flatten(Sequence[Sequence[(i, (-j)), i, 0, wholeA - 1], j, 0, wholeB - 1])
unitBoxTemplate = Polygon({(0, 0), (1, 0), (1, -1), (0, -1)})
unitEndPositions = Sequence(PAnchor2 + ((i * (1 + spacer)), 0), i, 0, (wholeA * wholeB) - 1)
allUnitBoxes = Zip(Translate[unitBoxTemplate, Vector[PAnchor, A]], A, startUnitPositions)
PCorner: (ceil(x(PReference)), floor(y(PReference)))
gridWholeVertical = Sequence(Segment[(x(PAnchor) + A, y(PAnchor)), (x(PAnchor) + A, y(PCorner))], A, 0, x(PCorner), 1)
gridPartsVertical = Sequence(Segment[(x(PCorner) - 1 + A, y(PCorner)), (x(PCorner) + A - 1, y(PAnchor) + If[x(PMove) < 1, -1, 0])], A, 0, 1, 1 / Denominator[fracA])
gridPartsHorizontal = Sequence(Segment[(x(PAnchor) + If[y(PMove) < -1, 0, 1], y(PCorner)) + (0, A), (x(PCorner), y(PCorner)) + (0, A)], A, 0, 1, 1 / Denominator[fracB])
speed: 1
smallBoxes = Zip(Translate[A, Vector[(sliderSoln * Vector[B, C])]], A, allSmallBoxes, B, startPositions, C, allEndPositions)
smallOutlines: smallBoxes
unitBoxes = Zip(Translate[A, Vector[(sliderSoln * Vector[B, C])]], A, allUnitBoxes, B, startUnitPositions, C, unitEndPositions)
unitOutlines: unitBoxes
tries = 0
PMoveShadow = (1, -1)
gridWholeHorizontal = Sequence(Segment[(x(PAnchor), y(PCorner) + A), (x(PCorner), y(PCorner) + A)], A, y(PAnchor) - y(PCorner), 0, -1)
AnchorNum2 = Midpoint(PAnchor, (x(PAnchor), y(PReference)) + (-1, 0))
AnchorNum1: Midpoint[PAnchor, (x(PReference), y(PAnchor))] + (0, 1)
eqnOffset: ((wholeAB - 2.3 + If[fracAB > 0, 1, 0]) * (1 + spacer) / 2)
SolnPoint: (numA, (-numB))
pMoveX: "\vphantom{\dfrac{1}{2}}" + (LaTeX[floor(x(PMove))]) + " " + (LaTeX[If[IsInteger[x(PMove)], "", FractionText[x(PMove) - floor(x(PMove))]]]) + " "
pMoveY: "\[\vphantom{\frac{1}{2}}" + (LaTeX[floor((-y(PMove)))]) + "" + (LaTeX[If[IsInteger[y(PMove)], "", FractionText[(-y(PMove)) - floor((-y(PMove)))]]]) + "\]"
solnOutline = Circle(SolnPoint, 0.2)
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correct}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + "}"
layoutX: 100
layoutY: 200
onboarding = true
pulsing = 0.3 (slider from 0 to 1, step 0.1)
pulsingSpeed: 8
pulsingPoint = circlePixels(PMove, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
denomAns: (denomA * denomB)
textAnswer: "\[" + (LaTeX[num1Latex]) + "\times" + (LaTeX[num2Latex]) + "=" + (LaTeX[wholeAB]) + "" + (LaTeX[If[fracAB > 0, (((("\dfrac{" * (fracAB * denomAns)) * "}{") * denomAns) * "}"), ""]]) + "\]"
textQuestion: "\textsf{Make a model for the product }\[" + (LaTeX[num1Latex]) + "\times" + (LaTeX[num2Latex]) + "\]."

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)