Not Allowing Some Forms of Latex


I have built a factoring slide that has students enter in a factored for of a given expression. The build of this slide is, I’m sure, a bit messy. It allows 4 difference scenarios that can be weighted to the teachers desire for repeated practice.

My issue is that students could just copy and paste the given expression into the math input and a *1 on one of the terms and it will allow this to happen.

I have made the correctness check be a function check, so it will allow any equivalent function.

Is there a way to make sure their answer (function) is in factored form some how?

I think I have a messy work around by using countNumberUsage and using the terms from the standard form expression. If they show up in the factored form, then an error message will prompt to keep it in factored form.

I kept the middle term of standard for to be the trigger for keeping solutions in factored form

One way around that could be to check that each term is a linear expression. After parsing, run each term through xyLine and check for validity.

Hi Jay!

Besides the documentation, is there an example of how to parse within factored form? Would this be a nested parse of some sort?

-TJ French

Oh I see, you’re not using patterns at all. Patterns are still largely undocumented, unfortunately, as they’re still in the “use at your own risk” phase.

This will likely handle what you’re looking for: Factoring | Components • Activity Builder by Desmos

1 Like

Thanks for the feedback Jay! I’ll keep trying to find parsing/patterns resources. And thanks for the activity Mike. Looks like you are using patterns in some way. I’ll dive deep into what you’ve created! Looks like it’s just what I need

If you go to desmos’s YouTube channel, there are several videos on patterns that are really helpful.

Here is an update on the slide. Used patterns to check if the solution was a product containing an “x” term. Looks like it is doing the trick!

Thanks for the help, I’ll continue to be on the lookout for patterns tutorials!