Parsing Brackets

Is there a way to parse brackets to extract the ordered pair? The question is asking students to enter the domain of a graphed function in interval notation. The domain is [-5,6]. I don’t want to check for the correctness of the latex as it is likely that students may enter a space. I tried substituteLatexVariable with parseOrderedPair and FunctionCall to certain degrees but to no avail. Any idea?

Hey Monark! Thanks for posting!
Unfortunately, substitueLatexVariable would not work with brackets. You could try to treat it like a list to pull out the values of the domain. Maybe something like this.

1 Like

Thanks Clay! This is something new and interesting to learn. I also tried checking the latex and that works just fine but doing this soft parsing will leave the values undefined if the brackets are not used which will in turn help to identify that students have not entered brackets! Is there anything in works for using the “U” sign for union of two or more intervals? To more complicate things, is there any efficient way to check the interval notations with semi-open/closed intervals with union sign in it? Just pushing the limits!

Unfortunately, I don’t believe that there is any way to handle unions and mixed open/closed intervals without just checking the latex.
I added another screen to the previously shared link that may help eliminate some of the user error with entering the different versions of intervals. Again, won’t help with parsing, however it’s better than nothing.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.