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.

I am trying to have students work backwards to describe a function notation. I want them to input f(a) into a table in cell (2,1). I have tried following the suggestions on this thread but it doesn’t seem to work for my table. Here is my code I am trying to fix (first row is OK) and here is my activity (slide 33) https://teacher.desmos.com/activitybuilder/custom/6399a42083cd23d3fb4e503e

cellContent(1,3):

when this.cellContent(1,2)=β€œ-3t+5” or this.cellContent(1,2)=β€œ5-3t” or this.cellContent(1,2)=" -3t+5"and btn5.timeSincePress()>0 β€œ:white_check_mark:”
when btn5.timeSincePress()>0 β€œ:x:”
otherwise β€œβ€

cellContent(2,3):

when this.cellContent(2,1)=β€œ{f}\left({a}\right)” and btn5.timeSincePress()>0 β€œ:white_check_mark:”
when btn5.timeSincePress()>0 β€œ:x:”
otherwise β€œβ€

There’s no slide 33. I don’t think you’ve published your draft.