#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Calcula el cambio unitario en cada caso.}

#eeeeee

#2E006758

#2EB00020

${\bgcolor{white}\footnotesize{\mathsf{%v}}}$

Horas

\textbf{Coche A}

\textbf{Coche B}

$\bgcolor{white}{\footnotesize{\mathsf{%v}}}$

Primero

boxRatio: 0.37
px16 = PixelsToDistance(16, Corner[1], Corner[3], Corner[5])
boxPixelWidth: (800 - (5 * 16)) / 4
dimensions: {-2.550087249284866, -300.78689434965705, 37.706954623727974, 200.4107237410629}
pixelsH: (dimensions(4) - dimensions(2)) / 500
pixelsW: (dimensions(3) - dimensions(1)) / 800
boxWidth: (boxPixelWidth * pixelsW)
xStarts = Sequence(dimensions(1) + px16 + (n * (boxWidth + px16)), n, 0, 4)
px1Height: (dimensions(4) - dimensions(2)) / 500
car1Box = makeBox((xStarts(1), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2))))
countQuestion = 0
randomSpeeds = Shuffle(Sequence[Random[1, 2], n, 1, 100])
randomSpeed = Element(randomSpeeds, Mod[countQuestion, 100] + 1)
textRandomSpeed = If(randomSpeed ≟ 1, "más rápido", "más lento")
randomRates1 = Shuffle(Sequence[(Random[4, 12] * 5), n, 1, 100])
randomRate1 = Element(randomRates1, Mod[countQuestion, 100] + 1)
minX: 40 / randomRate1
maxX: 105 / randomRate1
selectedIndex = 0
randomRates4 = Shuffle(Sequence[(Random[4, 12] * 5), n, 1, 100])
randomRates3 = Shuffle(Sequence[(Random[4, 12] * 5), n, 1, 100])
randomRates2 = Shuffle(Sequence[(Random[4, 12] * 5), n, 1, 100])
randomRates2Lim = KeepIf(n ≠ randomRate1, n, randomRates2)
randomRate2 = Element(randomRates2Lim, Mod[countQuestion, Length[randomRates2Lim]] + 1)
randomRates3Lim = KeepIf(n ≠ randomRate1 ∧ n ≠ randomRate2, n, randomRates3)
randomRate3 = Element(randomRates3Lim, Mod[countQuestion, Length[randomRates3Lim]] + 1)
randomRates4Lim = KeepIf(n ≠ randomRate1 ∧ n ≠ randomRate2 ∧ n ≠ randomRate3, n, randomRates4)
randomRate4 = Element(randomRates4Lim, Mod[countQuestion, Length[randomRates4Lim]] + 1)
maxIndex = IndexOf(Max[{randomRate1, randomRate2, randomRate3, randomRate4}], {randomRate1, randomRate2, randomRate3, randomRate4})
minIndex = IndexOf(Min[{randomRate1, randomRate2, randomRate3, randomRate4}], {randomRate1, randomRate2, randomRate3, randomRate4})
correctIndex = If(randomSpeed ≟ 1, maxIndex, minIndex)
randomList2 = Shuffle(Sequence[15])
randomList1 = Shuffle(Sequence[20])
randomNum2 = Element(randomList2, Mod[countQuestion, 15] + 1)
randomNum1 = Element(randomList1, Mod[countQuestion, 20] + 1)
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correct: selectedIndex ≟ correctIndex
showbuttons = true
helpTextHintTypicalError: "\text{Asegúrate de buscar el coche \textbf{" + (LaTeX[textRandomSpeed]) + "}
.}"
showhinttypicalerror = false
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16 + 36 + 16 + 8
pixelsTop: 24 + 16 + 8
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)}])
layoutY: 448
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 220 + 24 + 30
layoutAppSize = Corner(5)
inputCurrent: {selectedIndex}
inputSaved: {0}
enableBtnValidate: inputCurrent ≠ inputSaved
graphArea = Polygon({(-4.5, 105), (5.9, 105), (5.9, -10), (-4.5, -10)})
car1Equation(x) = If[0 ≤ x ≤ maxX, (randomRate1 * x)]
randomPointsX1 = Shuffle(Sequence[Random[1, 5], n, 1, 100])
randomPointsX1Lim = KeepIf(minX ≤ n ≤ maxX, n, randomPointsX1)
randomPointX1 = Element(randomPointsX1Lim, Mod[countQuestion, Length[randomPointsX1Lim]] + 1)
PointRandomX1: (randomPointX1, car1Equation(randomPointX1))
randomPointsX2 = Flatten(Sequence[Shuffle[Sequence[1, 20]], n, 1, 5])
randomPointsX2Lim = Sort(If[3 < Mod[(3 * (countQuestion + 1)), 100] < 100, Take[randomPointsX2, Mod[(3 * countQuestion), 100] + 1, Mod[(3 * (countQuestion + 1)), 100]], Mod[(3 * (countQuestion + 1)), 100] ≟ 0, Last[randomPointsX2, 3], Join[{Last[randomPointsX2, 3 - Mod[(3 * (countQuestion + 1)), 100]], First[randomPointsX2, Mod[(3 * (countQuestion + 1)), 100]]}]])
randomPointsY2: (randomPointsX2Lim * randomRate2)
randomPointsX4 = Shuffle(Sequence[Random[2, 20] / 2, n, 1, 100])
randomPointX4 = Element(randomPointsX4, Mod[countQuestion, 100] + 1)
randomPointY4: (randomPointX4 * randomRate4)
labelY = VerticalText("Millas")
randomPointsX1Lim_1 = KeepIf(n ≠ randomPointX1, n, randomPointsX1Lim)
randomPointX1_1 = Element(randomPointsX1Lim_1, Mod[countQuestion, Length[randomPointsX1Lim_1]] + 1)
PointRandomX1_1: (randomPointX1_1, car1Equation(randomPointX1_1))
linesAlignment = Sequence(x = dimensions(1) + (n * abs(dimensions(3) - dimensions(1)) / 4), n, 1, 4)
yAxisSeg = Segment((0, 00), (0, 105))
xAxisSeg = Segment((0, 0), (5.9, 0))
xTrackStart: dimensions(1) + (40 * (dimensions(3) - dimensions(1)) / 800)
xTrackEnd: dimensions(3) - (16 * pixelsW)
textTable2List = Zip(n + "\vphantom{|}&" + (m) + "\vphantom{|}\\\hline", n, randomPointsX2Lim, m, randomPointsY2)
PointBottomCases = Corner(labelX, 1)
yTrackStart: y(Vertex[car1Box, 4]) - (24 * px1Height)
yTrackEnd: dimensions(2) + ((pixelsBottom + 16 + 36 + 8) * px1Height)
trackPolygon = Polygon({(xTrackStart, yTrackStart), (xTrackStart, yTrackEnd), (xTrackEnd, yTrackEnd), (xTrackEnd, yTrackStart)})
trackLines = Sequence(Segment[(xTrackStart, yTrackEnd + (n * (yTrackStart - yTrackEnd) / 4)), (xTrackEnd, yTrackEnd + (n * (yTrackStart - yTrackEnd) / 4))], n, 1, 3)
carStart = Sequence((xTrackStart + 1, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4)
animationSlider = 0 (slider from 0 to 1, step 0.001)
carEnd = Sequence((xTrackEnd + 3, yTrackEnd + (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4)
distanceToTravel: (xTrackEnd + 3 - (xTrackStart + 1)) / 20
randomRates: {randomRate1, randomRate2, randomRate3, randomRate4}
movingPoints = Zip(k + (((distanceToTravel * animationSlider) * n), 0), k, carStart, n, randomRates)
carRibbonPoints = Sequence((xTrackEnd - 10, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4)
yTrackHeight: yTrackStart - yTrackEnd
finishBoxHeight: yTrackHeight / 16
finishBoxWidth: finishBoxHeight / 10.9
finishLineBlack = Sequence(Sequence[Polygon[{(xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + 1 + k) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + 1 + k) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + k) * finishBoxHeight))}], n, 0, 7], k, 0, 1)
finishLineWhite = Sequence(Sequence[Polygon[{(xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) - k + 1) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + 2 - k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + 2 - k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) - k + 1) * finishBoxHeight))}], n, 0, 7], k, 0, 1)
places: {"Cuarto", "Tercero", "Segundo", "Primero"}
randomRatesSorted = Sort(randomRates)
indexPlace = Zip(IndexOf[n, randomRatesSorted], n, randomRates)
PointSizeA = (29.403939737419073, 40.27732890677906)
textHeight: abs(y(Corner[textSize, 3]) - y(Corner[textSize, 1]))
PointSizeA_{start} = Corner(textSize, 4)
pointSizeA = Vector(PointSizeA_{start}, PointSizeA)
PointPositions: carRibbonPoints + (0, textHeight / 2) + (0, y(pointSizeA))
car2Box = makeBox((xStarts(2), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2))))
car3Box = makeBox((xStarts(3), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2))))
car4Box = makeBox((xStarts(4), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2))))
correctCar = Element({"Coche A", "Coche B", "Coche C", "Coche D"}, correctIndex)
car1Selected: car1Box
car2Selected: car2Box
car3Selected: car3Box
car4Selected: car4Box
finished: ¬(false ∈ Zip[x(n) ≥ xTrackEnd + 1.2, n, movingPoints])
speed: 1
CarSpeedPoints = Sequence((xTrackEnd - 5.8, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4)
SpeedPositions: CarSpeedPoints + (0, textHeight / 2) + (0, y(pointSizeA))
ySolutions: {y(PointRandomX1), randomPointsY2(1), randomRate3, randomPointY4}
xSolutions: {x(PointRandomX1), randomPointsX2Lim(1), 1, randomPointX4}
incorrectIndex = If(randomSpeed ≟ 1, minIndex, maxIndex)
isTypicalError: selectedIndex ≟ incorrectIndex
xNums = Sequence(Text[n, (n - 0.175, -2.5), true, true], n, 0, 5)
CarPointA = (7.5141732189683434, -113.98748982697705)
pixelRatio: pixelsH / pixelsW
CarPointB: CarPointA + (2, 0)
CarRatioD = (-4.619183115952054, -1.0807843837649513)
CarRatioE = (1.2735307331429926, -1.0807843837649513)
CarRatioF = Corner(picRatio, 4)
carYRatio: y(CarRatioF - y(CarRatioD))
carXRatio: x(CarRatioE) - x(CarRatioD)
heightToWidth: carYRatio / carXRatio
CarPointC: CarPointA + (0, ((2 * heightToWidth) * pixelRatio))
vectorCars = Zip(Vector[Midpoint[CarPointA, CarPointC], n], n, movingPoints)
carAMoving = Translate(carAGreen, vectorCars(1))
carCMoving = Translate(carCPurple, vectorCars(3))
carDMoving = Translate(carDOrange, vectorCars(4))
carBMoving = Translate(carBRed, vectorCars(2))
xAxisSegs = Sequence(Segment[(n, 0), (n, -1.5)], n, 0, 5)
yNums = Sequence(Text[(20 * n), ((-If[n < 5, 1.1, 1.3]), (20 * n) + 4), true, true], n, 1, 5)
car1UnSelected: car1Box
car2UnSelected: car2Box
car3UnSelected: car3Box
car4UnSelected: car4Box
car1Color = If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 1, "#008475", selectedIndex ≟ 1, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 1, "#B00020", selectedIndex ≟ 1, "#6557D2", "#252525")
car2Color = If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 2, "#008475", selectedIndex ≟ 2, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 2, "#B00020", selectedIndex ≟ 2, "#6557D2", "#252525")
car3Color = If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 3, "#008475", selectedIndex ≟ 3, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 3, "#B00020", selectedIndex ≟ 3, "#6557D2", "#252525")
car4Color = If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 4, "#008475", selectedIndex ≟ 4, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 4, "#B00020", selectedIndex ≟ 4, "#6557D2", "#252525")
textABCD: "\textcolor{" + (LaTeX[car1Color]) + "}{A}\\\vspace{0.65cm}\textcolor{" + (LaTeX[car2Color]) + "}{B}\\\vspace{0.65cm}\textcolor{" + (LaTeX[car3Color]) + "}{C}\\\vspace{0.65cm}\textcolor{" + (LaTeX[car4Color]) + "}{D}"
trackBorder = PolyLine({(xTrackEnd, yTrackStart), (xTrackStart, yTrackStart), (xTrackStart, yTrackEnd), (xTrackEnd, yTrackEnd)})
textCarAPlace: "\text{\textcolor{" + (LaTeX[car1Color]) + "}{" + (LaTeX[places(indexPlace(1))]) + "}}"
textCarCPlace: "\text{\textcolor{" + (LaTeX[car3Color]) + "}{" + (LaTeX[places(indexPlace(3))]) + "}}"
textCarDPlace: "\text{\textcolor{" + (LaTeX[car4Color]) + "}{" + (LaTeX[places(indexPlace(4))]) + "}}"
textCarDSpeed: "\text{\textcolor{" + (LaTeX[car4Color]) + "}{" + (LaTeX[randomRate4]) + "\text{ mph}}"
textCarCSpeed: "\text{\textcolor{" + (LaTeX[car3Color]) + "}{" + (LaTeX[randomRate3]) + " \text{ mph}}"
textCarBSpeed: "\text{\textcolor{" + (LaTeX[car2Color]) + "}{" + (LaTeX[randomRate2]) + " \text{ mph}}"
textCarASpeed: "\text{\textcolor{" + (LaTeX[car1Color]) + "}{" + (LaTeX[randomRate1]) + " \text{ mph}}"
textCarBPlace: "\text{\textcolor{" + (LaTeX[car2Color]) + "}{" + (LaTeX[places(indexPlace(2))]) + "}"
FeedbackA = (7.5141732189683434, -160.48748982697708)
FeedbackB: FeedbackA + (1.5, 0)
FeedbackC: FeedbackA + (0, (1.5 * pixelRatio))
PointsValidation = Zip(Vertex[n, 3], n, {car1Box, car2Box, car3Box, car4Box})
correctVect = Vector(FeedbackB, PointsValidation(correctIndex))
incorrectVect = Vector(FeedbackB, PointsValidation(selectedIndex))
correctPic = Translate(picCheck, correctVect)
incorrectPic = Translate(picCross, incorrectVect)
finishOutline = Polygon({(xTrackEnd - (1 * finishBoxWidth), yTrackEnd), (xTrackEnd - (3 * finishBoxWidth), yTrackEnd), (xTrackEnd - (3 * finishBoxWidth), yTrackStart), (xTrackEnd - (1 * finishBoxWidth), yTrackStart)})
yAxisSegs = Sequence(Segment[(0, (10 * n)), (-0.1, (10 * n))], n, 0, 9)
labelBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"
textAnswer: "\text{" + (LaTeX[correctCar]) + " es el " + (LaTeX[textRandomSpeed]) + ".}"
textCar4: "\text{\begin{array}{c} \textbf{Coche D}\\\\\begin{array}{l}Este coche viaja\\" + (LaTeX[randomPointY4]) + " millas\\en " + (LaTeX[randomPointX4]) + " horas.\end{array}\end{array}}"
textCountCorrect: "\text{Correctos al primer intento: " + (LaTeX[countCorrect]) + " }"
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correcto}$", "$\text{✕ " + (If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) + "}$"]]) + ""
textTable: "" + (LaTeX[TableText[{"\textbf{Horas}", "\textbf{Millas}"}, "c", 70, 20]]) + "\\" + (LaTeX[TableText[{randomPointsX2Lim, randomPointsY2}, "vc_|", 70, 28]]) + ""
textSolution: "\text{\bold{Posible solución}\\
El cambio unitario es la pendiente" + (LaTeX[If[correctIndex ≠ 3, " (distancia/tiempo)", ""]]) + ". El " + (LaTeX[correctCar]) + " viaja a \[" + (LaTeX[If[correctIndex ≠ 3, "\dfrac{" + (ySolutions(correctIndex)) + "}{" + (xSolutions(correctIndex)) + "}=", ""]]) + " " + (LaTeX[randomRates(correctIndex)]) + "\] mph.}"
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Pista}\\" + (LaTeX[If[showhint, helpTextHint + " ", ""]]) + "" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError, ""]]) + "}"
textQuestion: "\text{Selecciona el coche que se mueve \textbf{" + (LaTeX[textRandomSpeed]) + "} según las representaciones dadas.} "
textCar3: "\text{\begin{array}{c}
\textbf{Coche C}\\\\
\begin{array}{l}
Este coche viaja\\\[m\] millas en \[h\]\\horas según la\\ecuación\end{array}\\
{\normalsize{\mathbf{m=" + (LaTeX[randomRate3]) + "h}}}
\end{array}"
listTable: {Flatten[{"\vphantom{\frac{a}{b}}\textbf{Horas}", Zip[n + "\vphantom{|}", n, randomPointsX2Lim]}], Flatten[{"\textbf{Millas}", Zip[n + "\vphantom{|}", n, randomPointsY2]}]}

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: makeBox
makeBox(point, width,height)
Input: PointText1, boxWidth, boxHeight
Output: BoxText1

PointText2: PointText1 + (boxWidth, 0)
PointText3: PointText2 - (0, boxHeight)
PointText4: PointText1 - (0, boxHeight)
BoxText1 = Polygon({PointText1, PointText2, PointText3, PointText4})

Tool: PixelsToDistance
PixelsToDistance[ <Number>, <Point>, <Point>, <Point> ]
Input: InputPixels, Corner1, Corner3, Corner5
Output: OutputDistance

InputPixels: 5
xLeft: x(Corner1)
xRight: x(Corner3)
OutputDistance: (InputPixels / x(Corner5) * (xRight - xLeft))