Math input when answer contain parentheses

Hey! We want the correct answer to be 2(7) but this answer contains parentheses and messes with the code. How do we set this to be the correct answer?

If you know numbers than create variables

b=7``` and write it as latex:
```${a}\left(${b}\right)```
This should do what you want

Where is the 2 in that latex? I see that b=7 but we are teaching that 2(7) is 2 times 7. I could just be missing the point, but can you clarify?

Iā€™m guessing you may have used quotation marks. If you change to backticks, that should work better.
Computation is a more stable way of checking, though can be more complex:

check=this.numericValue=14 and countNumberUsage(this.latex,2)=1
and countNumberUsage(this.latex,7)=1
correct: check

The above would check that it evaluates to 14, that there is one 2, and that there is one 7. Note that other acceptable answers would be 7(2), 7*2, and 2*7, so if you specifically want parentheses, latex matching may be the way to go.

1 Like

it should be a=2 and b=7.
Then you can play with variables as you like.
{a}\left({b}\right)

if you use just ( and ) then they will not size with your expression.