Self-correcting expressions

I’m trying to create some feedback for my students as they work on adding polynomials. As they enter in each equation, I would like for them to get some feedback whether that answer is correct/not correct. I’m new to coding and after hours of trying to figure it out on my own, I’m at a total loss!

The correct answers should be:

a) x^2 + 2x - 8

b) x^3 + 3x^2 + 9

c) x^3 + 2x^2 - 5x + 14

I used a graph to evaluate each at multiple values.