#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Empty all input boxes

$x=\vphantom{b}$

$b=$

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

°

\text{¿Cuánto vale x?} 

x

countMeasInt = 9
countAngType = 9
angTypeList = Shuffle(Sequence[Random[1, 2], t, 1, 100])
angType = Element(angTypeList, Mod[countAngType, Length[angTypeList]] + 1)
angList = Shuffle(Sequence[Random[14, If[angType ≟ 1, 75, 165]], t, 1, 100])
showsolution = false
K = (9, 8)
angMeasInt = Element(angList, Mod[countMeasInt, Length[angList]] + 1)
R = (0, 8)
circleGrid = Sequence(Rotate[R, n, K], n, 0, 360°, 5°)
A = RandomElement(circleGrid)
A'_{1} = Rotate(A, If[angType ≟ 1, 90°, 180°], K)
A' = Rotate(A, angMeasInt°, K)
solAng = Angle(A', K, A'_{1})
input1 = NaN
givenAng = Angle(A, K, A')
missingAng: If[angType ≟ 1, 90°, 180°] - givenAng
angSum: ((angType - 2) * 180)
inputSaved: {NaN, NaN}
input2 = NaN
inputCurrent: {input1}
countQuestion = 0
randomNum2 = Element(angTypeList, Mod[countQuestion, 15] + 1)
randomNum1 = Element(angList, Mod[countQuestion, 20] + 1)
validate = false
showanswer = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct2: input2 ≟ randomNum2
correct1: input1 ≟ missingAng / °
correct: correct1
showbuttons = true
typicalError1: 0
typicalError2: 0
helpTextHintTypicalError: "\text{Esos ángulos son " + (LaTeX[If[angType ≟ 2, "complementarios", "suplementarios"]]) + ".\\
¿Cuánto deben sumar las medidas\\de ángulos " + (LaTeX[If[angType ≟ 1, "complementarios", "suplementarios"]]) + "?}"
showhinttypicalerror: input1 ≟ 180 - givenAng / ° ∧ angType ≟ 1 ∨ input1 ≟ 90 - givenAng / ° ∧ angType ≟ 2
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent]
helpTextHint: "\text{Los ángulos son " + (LaTeX[If[angType ≟ 1, "complementarios", "suplementarios"]]) + ".}"
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: 178
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
angStart = Segment(K, A)
K' = Rotate(K, angMeasInt°, K)
angEnd = Segment(K', A')
K'_{1} = Rotate(K, If[angType ≟ 1, 90°, 180°], K)
angHint = Segment(K'_{1}, A'_{1})
textGivenAng: "" + (LaTeX[givenAng]) + ""
L1 = Midpoint(Segment[Rotate[K, givenAng / 2, K], Rotate[A, givenAng / 2, K]])
isTypicalError: input1 ≟ If[angType ≟ 1, 180° - givenAng, 90° - givenAng]
textAnswer: "\text{La medida del ángulo\\" + (LaTeX[If[angType ≟ 1, "complementario", "suplementario"]]) + " es \(x=" + (LaTeX[missingAng]) + "\).}"
textSolution: "\text{\bold{Posible solución}\\Las medidas de dos ángulos\\" + (LaTeX[If[angType ≟ 1, "complementarios", "suplementarios"]]) + " 
suman " + (LaTeX[If[angType ≟ 1, "90°", "180°"]]) + ".\\
Por eso calculamos \(" + (LaTeX[If[angType ≟ 1, "90°", "180°"]]) + "-" + (LaTeX[givenAng]) + "=" + (LaTeX[missingAng]) + "\).}"
textQuestionMark: "" + (LaTeX[If[¬showsolution, "x", ("" * solAng)]]) + ""
tabOrder: {textQuestion, textGivenAng, textQuestionMark, InputBox1, btnValidate, textHint, textSolution, textAnswer, btnNew}
c = Circle(K, 6)
B = Intersect(c, angEnd)
C = Intersect(c, angHint)
L2 = Midpoint(B, C)
boxAng = Angle(angStart, angHint)
xAng = Angle(A', K, A'_{1})
LAB = Midpoint(Segment[Rotate[K, missingAng / 2, K], Rotate[A', missingAng / 2, K]])
textCountCorrect: "\text{Correctos: " + (LaTeX[countCorrect]) + " }"
P1 = NaN
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correcto}$", "$\text{✕ " + (If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) + "}$"]]) + ""
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: 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)