Is there a way to get a grey check mark for a math input with multiple possibilities?

Hi, I searched through the boards but couldn’t find what I was looking for. I’m looking for a student to enter a quadratic equation in math input. I want to get a grey check mark if they use y =; f(x) =, or just the expression. So is there a way to get a grey check mark if they entered
f(x) = x^2 or y = x^2 or just x^2? Or can I only get a checkmark for one of these possibilities? Thanks!

Hi! One option would be something like:

answer = firstDefinedValue(parseEquation(input).rhs, input.latex)
correct: simpleFunction(answer).evaluateAt(1.2) = 1.44 # OR correct: answer = `x^2`

Then if students enter something like y= or f(x)= only the expression after the equal sign is considered. If there’s no equal sign, the whole input is considered. I hope that helps!

PS - The first correctness option I entered checks the function by evaluating it at a random input just in case a student entered the function in an unexpected format like 1x^2 that doesn’t exactly match x^2.

Thank you for the reply. I got warnings on them both. It didn’t find a latex argument and said something about a component with a really long code after it. Then the correct part wouldn’t work because the answer part wouldn’t work. I’m not really sure what a parseEquation refers to. I tried looking through the CL documentation but it didn’t seem like what I was looking for. Here’s a picture of what I have. Unfortunately I don’t really understand much of the CL language and the tutorials help but don’t have exactly what I’m looking for.

Sorry, I had a couple errors in my initial reply - I should have taken the time to test it out first!

(1) Where I typed input, it should say this since you are putting the check for correctness inside the math input component (this just means “the component this script is inside of”)
(2) It should have been parseEquation(this.latex).rhs instead of parseEquation(this).rhs

The parseEquation(this.latex).rhs is basically saying, if a student enters an equation, only look at the right-hand side. So if I type y=x^2 or f(x)=x^2, only look at the x^2.

I hope that clarifies a bit - I’m happy to try and rephrase or go more in depth if not. Here’s a simplified version of the activity you described:

This is perfect! Thank you so much!

Have a good week, Kori

1 Like