Button reveals note

I’ve been trying to figure this out and I don’t have enough practice.

When my students press a button, I want the answer to be reveal in a note regardless of what they put.

How can I do that?

There are many ways to do this and it depends on the context of the problem type. Here’s an example where the student answers something in a math input component. This code would go in the note component.

content: when input.submitted "This is the problem.\n\nThe answer is 42."
otherwise "This is the problem."

This code assumes the math input component has a name “input.”