Soni
December 9, 2020, 1:39pm
#1
Hello!

I want my students to input expressions that are simplified (using GCF for example), and then be able to check it themselves.

I can see what to insert in the code to check if the answer is an equation, or a number, but how do I do this for an expression?

For example, the q I give them is to simplify 48x-16…the answer I want them to write is 16(3x-1), and then check to see if they are correct.

TIA!!!

You can use `simpleFunction()`

to turn an expression into a function, then evaluate as you would an equation. Is that what you mean? If you want to see that it’s simplified, you’ll want to find some threads that discuss countNumberUsage.

Here’s one:

Thanks. I’m not actually part of the Desmos team, just a user who enjoys the coding puzzles and helping people out.
First, you can use countNumberUsage to identify specific expressions. (See post 6 in this thread).
Second, if you have equivalent expressions, you could just create a function that is the difference of the two. Being equivalent, any value of x should evaluate to zero.
Say you want a student to simplify exp1 in a math input.
exp1=`4x-2x+5`
f= simpleFunction("${exp1} - (${this.la…