Hidding Answers after submitting

How can I hide an answer that’s been submitted that is an expression and not a number? Students are multiplying binomials and their answers will be trinomials.

This is what I use when the answer is just a number.
hidden: btn1.pressCount > 0

I don’t know what the CL is for an expression.

I have it set up so that all of their answers will be “locked in” after they hit a submit button.

I didn’t even know this was a thing. I don’t see anything in the documentation for hidden.

This makes me nervous, because there is no way to “undo” if a student accidentally hits submit (or presses enter) while still working on their response. An alternative might be to include a note that says “This is your ${N}th response”.

To check if something is an expression, you might try to make a simpleFunction out of it and evaluate that at a couple inputs you’d expect to be different. If you get the same value, the input was probably a constant.

Input CL:
eq = simpleFunction(this.latex, "x") # the "x" is not needed, but if the expression uses a different variable this is where you'd change it.
v1 = eq.evaluateAt(3.14)
v2 = eq.evalauteAt(13.4)
isProbablyConstant = (v1 = v2)
isProbablyExpression = not(isProbablyConstant)

I’ve done where a correct answer gets locked in, so students don’t accidentally delete it in a table. I’ve often limited the number of times a student can check if they’re correct or not. They could hit their limit, but still change an answer afterward.