# Not Allowing Some Forms of Latex

**URL:** <https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [May 19, 2023, 12:47pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915 "2023-05-19T12:47:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TJ\_French](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/tj_french/32/2993_2.png) [@TJ\_French](https://cl.desmos.com/u/TJ_French)\
**Post date:** [May 19, 2023, 12:47pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/1 "2023-05-19T12:47:58Z")

</div>

Hello!

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?**

> **[CL Question • Activity by TJ French](https://classroom.amplify.com/activity/64677018bc5b96a006cf01d3)**
>
> by TJ French

---

<div class="post-metadata">

**Author:** ![French](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/french/32/4354_2.png) [@French](https://cl.desmos.com/u/French)\
**Post date:** [May 19, 2023, 3:01pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/2 "2023-05-19T15:01:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [May 19, 2023, 6:10pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/3 "2023-05-19T18:10:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![French](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/french/32/4354_2.png) [@French](https://cl.desmos.com/u/French)\
**Post date:** [May 19, 2023, 7:48pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/4 "2023-05-19T19:48:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [May 20, 2023, 12:09am UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/5 "2023-05-20T00:09:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)\
**Post date:** [May 20, 2023, 12:57am UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/6 "2023-05-20T00:57:15Z")

</div>

This will likely handle what you’re looking for: [Factoring | Components • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/6367055b8e0c77785b29b62c?collections=636705478e0c77785b29b628)

---

<div class="post-metadata">

**Author:** ![TJ\_French](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/tj_french/32/2993_2.png) [@TJ\_French](https://cl.desmos.com/u/TJ_French)\
**Post date:** [May 20, 2023, 6:37pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/7 "2023-05-20T18:37:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Daniel\_Wekselgreene](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_wekselgreene/32/1819_2.png) [@Daniel\_Wekselgreene](https://cl.desmos.com/u/Daniel_Wekselgreene)\
**Post date:** [May 20, 2023, 8:48pm UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/8 "2023-05-20T20:48:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TJ\_French](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/tj_french/32/2993_2.png) [@TJ\_French](https://cl.desmos.com/u/TJ_French)\
**Post date:** [May 22, 2023, 3:26am UTC](https://cl.desmos.com/t/not-allowing-some-forms-of-latex/4915/9 "2023-05-22T03:26:33Z")

</div>

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!

> **[CL Question • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/64677018bc5b96a006cf01d3)**
>
> by Timothy French

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