Interval Notation for a Union

I am in over my head, knowing very little about CL. But. My students are learning to write intervals of increase/decrease or positive/negative values for polynomial functions, and I am building a Desmos activity that will check their answers. When the answer is a single interval, such as (-3,-1), I have no problem. On a math input screen, I used

correct = input1.submitted and input1.latex = “\left(-3,-1\right)”
correct: correct

and answers checked perfectly. But a problem occurs when I need a union of two or more intervals, such as (-3,-1)U(5,6). I tried using

correct = input7.submitted and input7.latex = “\left(0,1\right)\bigcup\left(5,6\right)”
correct: correct

and having students just cut and paste a U symbol that I provided in the activity. It didn’t check correctly. I also tried \cup. Then I tried to insert the word or as follows

correct = input7.submitted and input7.latex = “\left(0,1\right)or\left(5,6\right)”
correct: correct

but it was recognized as latex (?) and when students enter a space before and after the word, it doesn’t check correctly.

How can I get the pasted U symbol to check correctly? I want students to enter answers in the format (-3,-1)U(5,6). Thanks for helping a newbie!

I ran into this issue with non-linear inequalities, and I ended up using multiple choice for this. The code is a little heavy, but you should be able to adapt it using the hide answers table.

Thank you! I actually viewed your activity earlier today while searching for answers. I love the idea of using buttons and will have to try adapting the CL.

I copied your Interval Notation button screen and tried to adapt it to solve the quadratic:
-(x+3)(x+8)≥0. The “correct” message never pops up but the show correctness button at the top does show students when they do and do not have correct answers. I tried to change the code but it was way over my head. Any suggestions?

On the second screen you will have to change the hiddenAnswers component to the following:
a -8
b -3
multipleChoice 1
c (type any number)
d (type any number)
Inequality: -(x+3)(x+8)>=0
Union 0

Note the values for c and d don’t matter since for your inequality a union isn’t necessary.
It will show a :white_check_mark: next to
Your Interval Notation Answer:

But the :white_check_mark:Correct won’t necessarily show up on the graph clearly. You would have to Edit the Graph and change Line 33 to something that would work for you. (I attached a picture of Line 33, you would probably have to change the Center (0,-1) and divide the width and height by 2.