I am trying to create an activity that allows students to examine a graph of a system of linear inequalities and write the corresponding inequalities in Math Input boxes. Once the students have written their inputs, I would like to be able to render a graph from those input boxes that allow the students to compare the graphs of their inequalities to the original graph. I have tried using the simpleFunction tag to complete the task, but it does not simple to work for inequalities. I have pasted the activity below. If anyone can please help with this process, I would greatly appreciate it.
In the graph itself, you can have f(x,y)>0
(you might also want to set up f(x,y)=y-x
or similar, so you can style the inequality to your liking.
Then in the CL, you need:
function("f"): parseInequality(Inequality1.latex).differenceFunction(`x`,`y`)
In essence, this takes y>-4x-1
from the students’ input, creates the function f(x,y)=y-(-4x-1)
, then plots y-(-4x-1)>0
.
Thank you so much. This worked well. The only issue I have now is that when I did the two parseInequality lines, the submit button disappeared. The Submit button was the controller for all of my hidden objects. Do you know how to fix this?
No idea why your changes should have affected that - however, you can always force the showing of a Submit button by including showSubmitButton: true
in the CL for the Inequality2 Math Input