#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Empty all input boxes

$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{Drag to start}

$AT=\vphantom{b}$

\text{Describe the applet here}

$\text{Some string input}$

\text{Calcula el área total del prisma regular\representado a la derecha.} 

\textsf{Desplegar el desarrollo plano}

\text{unidades cuadradas}

\textsf{La medida de la altura se ha redondeado\
al centésimo.}

countQuestion = 0
Case: Mod[countQuestion, 2] + 1
numRandoms: 2
allRandomSeeds = Sequence(Random[0, 99] / 100, A, 1, 200)
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1 = If(countQuestion ≟ 0, 1, 1 + floor((currentRandomSeeds(1) * 4)))
exactTriHeight: sqrt(randomNum1^(2) - (randomNum1 / 2)^(2))
triHeight: round(sqrt(randomNum1^(2) - (randomNum1 / 2)^(2)), 2)
randomNum2 = If(countQuestion ≟ 0, 3, Max[1 + floor(((currentRandomSeeds(2) * 3) * randomNum1)), (1 / 2 * randomNum1)])
expected = Element({(2 * randomNum1^(2)) + ((4 * randomNum1) * randomNum2), (randomNum1 * triHeight) + ((3 * randomNum1) * randomNum2)}, Case)
exactAnswer = If(Case ≟ 1, expected, (randomNum1 * exactTriHeight) + ((3 * randomNum1) * randomNum2))
input1 = NaN
showhint = false
poly1 = Polygon({(0, 0), (1, 0), (1, 1), (0, 1)})
poly2 = Polygon({(0, 0), (1, 0), (cos(60°), sin(60°))})
Cor1: (-3.41064, -3.41064, -3.54495)
Cor2: (4.41064, 4.41064, 5.87828)
graphHeight: randomNum2 / randomNum1
showGraphHint = false
prism2, B, C, D, face1, face3, face2, faceBCD, edge1, edge2, edge3, edgeBC, edgeCD, edgeBD = Prism(poly2, graphHeight)
fold = 0 (slider from 0 to 1)
inputSaved: {""}
prism1, I, J, K, L, face8, face10, face11, face9, faceIJKL, edge8, edge9, edge10, edge11, edgeIJ, edgeJK, edgeKL, edgeIL = Prism(poly1, graphHeight)
inputStrings: {""}
inputCurrent: inputStrings
inputValid: {false}
inputOK: Sum[inputValid] ≟ Length[inputValid] ∧ (¬Defined[IndexOf["?", inputStrings]])
input2 = NaN
onboarding = false
correct1: input1 ≟ randomNum1
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
textSolution: "\textsf{\bold{Posible solución}}\\\\ " + (LaTeX[If[Case ≟ 1, 4, 3]]) + " \times (l \times a) + 2 \times " + (LaTeX[If[Case ≟ 1, "b^2", "\left(\frac{1}{2}bh\right)"]]) + "  
\\= " + (LaTeX[If[Case ≟ 1, 4, 3]]) + "\times ( " + (LaTeX[randomNum1]) + " \times " + (LaTeX[randomNum2]) + ") + 2 \times " + (LaTeX[If[Case ≟ 1, (randomNum1 * "^2"), (((("\left(\frac{1}{2}\times" * randomNum1) * "\times") * triHeight) * "\right)")]]) + " \\= " + (LaTeX[expected]) + "  \text{ unidades cuadradas}"
InputBox2 = Textfield(input2)
correct2: input2 ≟ randomNum2
correct: abs(input1 - exactAnswer) ≤ 0.03
isTypicalError: input2 ≟ input1 + 1
showbuttons = true
showhinttypicalerror = false
helpTextHint: "\text{" + (LaTeX[If[showGraphHint, "Aquí hay un prisma con el área total de tu\\respuesta. Compáralo con el requerido.", "Halla el área de cada figura.\\Luego suma todas las áreas."]]) + "}"
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{Pista}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
layoutY: 160
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent]
pulsingSpeed: 8
pulsing = 0.6 (slider from 0 to 1, step 0.1)
onboardingCase: 1
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
solutionView: showanswer ∨ showsolution
InputBox1 = Textfield(input1)
altFeedback: "\text{" + (LaTeX[If[correct, (("Your answer is correct. Total number correct: " * countCorrect) * ". "), ("Your answer is not correct. " * If[tries < 3, "Try again. ", "Maybe next time. "])]]) + "}" + (LaTeX[If[showsolution, ("\\" * textSolution), If[showhint ∨ showhinttypicalerror, textHint, ""]]]) + ""
test = 23542
InputBox3 = Textfield(input3)
A = Intersect(inputOK = inputOK, inputOK = Sum[inputValid] ≟ Length[inputValid] ∧ (¬(Defined[IndexOf["?", inputStrings]] ∨ Defined[IndexOf["", inputStrings]])))
numInputBoxes: 1
initializeStrings = Sequence("", A, 1, numInputBoxes)
initializeValid = Sequence(false, A, 1, numInputBoxes)
net1, M, N, O, P, Q, R, S, T, U, V, W, Z, A_1, B_1, face12, face13, face14, face15, face16, face17, edge12, edge13, edge14, edge15, edge16, edge17, edge18, edge19, edge20, edge21, edge22, edge23, edge24, edge25, edge26, edge27, edge28, edge29, edge30 = Net(prism1, fold)
net2, E, C_1, D_1, E_1, F_1, G_1, H_1, I_1, J_1, K_1, face4, face18, face19, face20, face21, edge4, edge31, edge32, edge33, edge34, edge35, edge36, edge37, edge38, edge39, edge40, edge41, edge42, edge43 = Net(prism2, fold)
view = Vector((0.84 + (0.16 * fold); (0.32 * (1 - fold)) + (pi / 2 * fold); ((-pi)) / 2 + ((0.8 * pi / 2) * (1 - fold))))
speed: 1
AppSize: (x(CornerThreeD[-1, 9]) + x(Corner[5]), y(Corner[5]))
AppSizeGV1 = Corner(5)
heiHint = 19.5
prismHint1, F, G, H, L_1, face5, face7, face22, face6, face23, edge5, edge6, edge7, edge44, edgeFG, edgeGH, edge46, edge45 = Prism(poly1, heiHint)
prismHint2, M_1, N_1, O_1, face25, face27, face26, face24, edge47, edge48, edge49, edge50, edge52, edge51 = Prism(poly2, heiHint)
showformula = false
textFormula: "\textsf{Fórmula del área total de un prisma regular:}\\\\
\textsf{AT = \color{" + (LaTeX[colorPink]) + "}Área lateral \color{}}+ 2 \times \color{" + (LaTeX[colorBlue]) + "}\textsf{Área de la base}\\
\textsf{AT = }\textcolor{" + (LaTeX[colorPink]) + "}{" + (LaTeX[If[Case ≟ 1, 4, 3]]) + " \times(l \times a) }+ 2 \times \textcolor{" + (LaTeX[colorBlue]) + "}{" + (LaTeX[If[Case ≟ 1, "b^2", "\left(\frac{1}{2}bh\right)"]]) + " }"
labelBase = Text(randomNum1, (1.35 - fold, 0.4 - (0.2 * (1 - fold)), -0.3 + fold), true, true)
labelHei = Text(randomNum2, (1, ((((-graphHeight)) / 2 + 0.2) * fold) + ((1 - fold) * (-0.2)), ((graphHeight / 2 + 0.2) * (1 - fold))), true, true)
segHeightTri = Segment(K_1, Midpoint[E_1, F_1])
showHeight: Case ≟ 2 ∧ fold ≥ 0.75
labelTriHeight = Text(triHeight, K_1 + (0.2, 0.5), true, true)
poly3 = Polygon({0.5})
q1 = Polygon({Midpoint[Midpoint[E_1, F_1], E_1], Midpoint[E_1, F_1], Translate[Midpoint[E_1, F_1], Vector[(0.25 * Vector[Midpoint[E_1, F_1], K_1] / Length[segHeightTri])]], Translate[Midpoint[E_1, Midpoint[E_1, F_1]], Vector[(0.25 * Vector[Midpoint[E_1, F_1], K_1] / Length[segHeightTri])]]})
P_1 = Vertex(q1, 4)
tabOrder: {textQuestion, InputBox1, btnValidate, fold, btnShowFormula, textFormula, textHint, textSolution, btnNew}
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correcto}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) * "}")]]) + ""
labelBtnFormula: "\textsf{" + (LaTeX[If[showformula, "OCULTAR FÓRMULA", "MOSTRAR FÓRMULA"]]) + "}"
textCountCorrect: "\text{Correctos: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"

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)