Check Area Input from a Graph that can be Manipulated

I have to call it. I spent the better part of the day looking for an activity that checks area, but all the graphs I can find are static. Or, the graph can be manipulated, but the check happens when the graph is moved in a certain way. I want to take graphs like these and have the students be able to check the area each time they change the graph.

This was the best I could come up with, but I am embarrassed it shows how little I have been able to figure out.

in = input
value = numericValue("${graph.number(“A_{rea}”)}")

when in.timeSinceSubmit() > 0 “${result}\n\n\Change the graph to try another.” otherwise “Find the area of the triangle.”
result = when in.lastValue(“correct”) = 1 “Correct!” otherwise “Hm. Try again.”

Here is my take on the triangle one. Just needed a bit of tweaking of how the input value was taken into the graph, and checked. I didn’t really look at the trapezoid one, but you should be able to tweak the code in a similar way. Let me know if you have any questions about how I did it. I’m a fan of doing the checking in the graph and then pulling out a “check value” to compare in the “correct” statement of the component.

1 Like

Thank you so much!! Once I see the first one done, I can usually figure out how to adapt it.

1 Like