Checking Answer for Interval Notation in LaTeX String that does not include infinity?

How should I change “\left[4,\infty\right)” that displays the interval [4,infinity) from

content: when input5.submitted and input5.latex="\left[4,\infty\right)" “Great job!”
when input5.submitted “Your domain is incorrect, try again.”
otherwise “Find the domain of the graph at left.”

to reflect the interval [-2,1]?

also to have (-infinity,0)U(0,infinity)

If you must use an exact string check, one thing you can do is type the correct answer into a math input, copy, and paste it into your CL.

Just a quick heads up that checking exact strings is less than ideal and can easily generate false negatives (imagine a student enters [-2, 1] instead of [-2,1]). Going to a choice, checkbox, or card sort might be a more reliable alternative here.

I’m trying to do the same thing. I copied the correct answer from a math input, but it still is recording as wrong both in the check and on the dashboard.

I know exact string check isn’t ideal, but there are only two real options in this case, so I feel like I can account for both of them.