Checking latex input {-1, -3, 1, 3}

Is there a way to mark a latex input {-1, -3, 1, 3} as correct? Order of numbers does not matter and can be different.

I think using this notation isn’t particularly supported. Latex matching is really the only way to check it and you’d need to check all 24 possible combinations. Wish I had a better answer. I think this is where many users wish we had some string manipulation capabilities.

Okay, I guess I can’t do that. If the latex input is 3 ordered pairs separated by a comma, example (1,2), (3,4), (5,6). Is there a way to parse out each of the ordered pairs. I do not want a table input.

I don’t think so, unless there’s something in pattern matching I’m not aware of. If rawExpression were still around you could fudge a list of points, but I don’t think there’s a way now.

Do you think countNumberUsage would work here? You should be able to check for one of each number and then four numbers total.

1 Like

Thank you so much for your responses. Would you be able to help me with this activity? I need help with the “hint” button on slide 7. I want the hint to appear after students select discrete or continuous. It is not appearing. If I include it as the first “when” statement in the note, error messages for domain and range do not appear. Not sure what to do.

Just move the when condition for the hint higher up the list - ie. make sure when hint2.pressCount>0 and mc5.submitted and mc5.script.ans appears before when mc5.submitted and mc5.script.ans.

Another alternative would be to have the hint as a separate note, that’s hidden: until hint2.pressCount>0.

I tried that, but the domain and range error checks don’t appear.

If you set the when condition after the domain and range checks but before the mc5.submitted and mc5.script.ans condition then the domain and range checks will show, but then the hint won’t show until you ‘unsubmit’ the answers.

Ultimately it is going to stop at the first ‘true’ condition and execute that, so the order needs to be very precise and probably not ever going to behave perfectly as you expect. Maybe in this case, the alternative I suggested - having the hint as a separate note that hides/unhides accordingly - would be the more flexible approach.

Thank you, I will add more note components.

This won’t quite work though because countNumberUsage won’t distinguish between positive and negative, so {1,3,1,3} would also be accepted.