Help with Parsing Standard Form Quadratic (Negative Coefficients and Special Cases)

Hi All!

I’m working on building my parsing skills and made huge progress today. But I came across how literal everything needs to be. I want students to enter in standard form quadratics and have the terms parsed out for an animation I’m working on. Below is what I have so far. Any help would be appreciated!

Parsing can be tricky, but there are some tools to help, like p.optional and p.anyOf. And also when you have a sum pattern, you can add in .allowNegativeTerms at the end. Here is an example for your use case: [Copy of] Parse Standard Quadratic • Activity Builder by Desmos Classroom

I made a slide that will allow terms 1 and 2 to have no coefficients (invisible 1’s)
(Slide 2)
Not sure if this is helpful to aid you in your understanding.

p.sum(
p.anyOf(p.product(number,p.exponent(x,two)),p.exponent(x,two)),
p.anyOf(p.product(number,x),x),
p.number)

(I also did not look at the other response..I guess that was done there as well…sorry)