Math Input with Parenthesis

I have all the buttons/code correct - I have tested it. Buttttt, I need it to mark a cell correct if a student types (2x)^5 not just 2x^5. But when I put parenthesis around the 2x, my code no longer works.

Here is what I have so far.

Doesn’t Work with This:
cellSuffix(1,5): when this.cellContent(1,2)=β€œ1” and this.cellContent(1,3)="(2x)^{5}" and (this.cellContent(1,4)="" or this.cellContent(1,4)="(3y)^{0}") and button15.pressCount>=1 β€œ:smiley:” otherwise β€œ:grey_question:”

Works with This:
cellSuffix(1,5): when this.cellContent(1,2)=β€œ1” and this.cellContent(1,3)=β€œ2x^{5}” and (this.cellContent(1,4)="" or this.cellContent(1,4)=β€œ3y^{0}”) and button15.pressCount>=1 β€œ:smiley:” otherwise β€œ:grey_question:”

My activity: Week 17: Homework on Pascal's Triangle & Binomial Theorem β€’ Activity Builder by Desmos
It is on slide 13. Thank you!

Try using backticks (by the 1 key) instead of quotation marks. You can also type what you want into a desmos graph and copy/paste it into CL to have it auto-format.

You may also want to look into evaluative methods like:

#For (2x)^{5}
f3=simpleFunction(this.cellContent(1,3))
check3= f3.evaluteAt(1)=32 and f3.evaluateAt(0.5)=1
1 Like