Prevent students from using the calculator for math input

I am creating an escape room for students practicing decimal calculation. I want to check their answer before allowing them to go to the next step. With the math input, all they need to do is rewrite the math problem and it lets them go on. How do I stop that? The first answer is 86.03. How do I only get that and check that it is correct? Thanks!

You can use the countNumberUsage tool.
I’m not sure what type of input you are using to check answers, but this is what it could look like for checking to make sure the number 11 is in the answer once for a table input:
I honestly am not sure about decimals, but I’m guessing that your cl would look something like:
Hope this helps.

I am so new at this. Right now I have it in a math input. Should I use a text input instead? If so, how do I check to see if the number is correct.

Here is the link. Just look at page 3. (I am copying and editing an escape room I used earlier.)

Oops. Wrong link. Here is the right link.

I found what I was looking for:

error = not(isBlank(this.latex) or isDefined(this.numericValue)) or countNumberUsage(this.latex) > 1
disableEvaluation: true
errorMessage: when error “Enter a number” otherwise “”
warning: when error “Enter a number” otherwise “”

1 Like

In your math input component use this:

disableEvaluation: true

This is stop desmos from doing the calculation for them.

I have the same question as what was asked originally. When I put in disableEvaluation:true then it still tells the students that their answer is correct.
For example, I want them to simply 5 cubed and if they write 5 to the 3rd power in the answer box and hit submit, it says it is correct. What else can I do?
Thank you!

For this particular case, you have different options. You could use countNumberUsage. This code checks to see if there is one number submitted and that number needs to be 125.

correct: countNumberUsage(this.latex,125)=1 and countNumberUsage(this.latex)=1

Here is an example that uses patterns to check for 125 being correct:

correct: patterns.number.parse(this.latex).numericValue=125

You could also use and errorMessage to see if a student is attempting to enter a power:

pattern = patterns.exponent(patterns.number,patterns.number)
isMatch = pattern.matches(this.latex)

errorMessage: when isMatch "Please evaluate the expression" otherwise ""

I’d advise strongly against the second suggestion and suggest pattern matching if need be instead of countNumberUsage. Checking that it matches a number (or number adjacent) would work here.

I need to remember patterns! I edited the previous post to include a couple pattern match ideas and removed the other suggestion.

I was playing with this for a different activity, and realized something that you all seem to have, but if not, I’ll point it out. (It seems like Beth was talking about this).

When you disable Evaluation, students will not see their expression evaluated. However, that doesn’t prevent the expression from being marked correct if you ONLY check against a numeric value.

For example, if your target is 125, even if you have disableEvaluation set to true, if a student enters 100+25 (or 5^3) and all you do is check if the numericValue of the input is 125, they’ll be marked correct.

You could just see if the latex is 125… this.latex = “125”

As noted previously, we strongly discourage the use of string matches for determining correctness. @ctlusto sums it up pretty well in this post from 2018 Comparing latex values - #2 by ctlusto

1 Like

Thanks. That pushed me to look more into patterns. Is this the extent of the documentation to this point?


Edit: I realized that to see that types, I could just go into CL and type “patterns.”

Thanks for your patience :slight_smile: