Correct check for expanding brackets expression

Hi there,

I’m doing a lesson on expanding brackets and just want the students to be able to put in a correct answer and get a tick appear (they are young they like to know they are right)

For examples my first question is 2(x+4) so the answer will be 2x+8, I have it currently set up as a math input but I’m not sure what to type in the CL to get a tick for them entering 2x+8?

I am completely brand new to this so my first reaction was just to type in correct: 2x+8, which obviously didn’t work.

Any help would be greatly appreciated.

You were close! I have been encouraged multiple times on this support site NOT to check that a string is correct, but I believe this is an instance where it is warranted. Try this with backticks (above the Tab key):

correct: this.latex=`2x+8`

Amazing! Thank you so much!!

I think there are very few instances where latex matching doesn’t work since the backtick feature was added, but for those who are pickier the other methods are more foolproof. I think more often than not it’s increased complexity that causes problems (e.g. fractions, exponents, roots) when trying to match strings/latex.