Self Checking Activities

I was wondering if there is a way to code a formula into the activity builder?
I want to create a functions self checking activity where the students pick any input number and then they will use the given equation to find the output. Desmos will then say that it is correct or not because it can evaluate the answer the student put in.

I know how to create a basic self checking activity by coding what the specific answer has to be however, I was wondering if it was possible to create if there is not one specific answer.

I hope this question makes sense

For example:
Students are given the expression 2x+4
The student picks any random x value will then plug their chosen number into the above expression and will get their y
I want to code 2x+4 into the activity that way it does not matter what x the students pick, desmos will be able to check to see if they got the correct answer

You can create functions in a few ways, but simpleFunction will suit your purpose. If I understand correctly, you want students to evaluate y for their chosen x. It will be helpful to choose if you want them to use a table or a few inputs.
Below would be in a table with two columns (x and y):

#Your desired function. You need to specify the variable if x is not used.
cellSuffix(1,2): when isBlank(this.cellContent(1,2)) or cellHasFocus (1,2) ""
                 when this.cellNumericValue(1,2)=f.evaluateAt(this.cellContent(1,1)) "✅"
                 otherwise "❌"
#If you want to limit to one row:
maxRows: 1

You can repeat the cellSuffix code for more rows, by repeating with the next row number.

There may be some inaccuracy with comparing the answers for fractions with non-terminating decimal equivalents, but there are ways around that if you need it.