I don’t think you’ll be able to reliably distinguish between students typing pi and them typing in lots of pi correct to a large number of decimal places.
Or you could do something a little risky with some code like this
correct: this.latex = "\\pi"
But this is not very robust because if they put in spaces or even type “pi + 0” it will fail.