New to CL: feedback using sqrt as an input

I’m trying to get some feedback for when the answer to the question is 3sqrt(2). I was able to get the “checkmark” to appear in my dashboard, but on the “feedback” note, I am not able to have the correct feedback appear.

Here is the coding for the feedback note:

problem = input6
answer= “3\sqrt{2}
studentAnswer = problem.latex
content: when (studentAnswer=answer and problem.submitted)“Your answer is correct. Move on to the next slide.”
when (problem.submitted)“Please try again”
otherwise""

For this question, I want the student to enter exactly 3sqrt(2).

Try using backticks (next to the 1 key) for answer instead of quotation marks if you haven’t already. Also, looks like maybe you’re missing a space before all your opening quotation marks. You can share your activity for more accurate assistance.

Since trying a latex match isn’t preferred, you could try to use a pattern match.

problem = input6

answer = patterns.product(p.number.satisfies("x=3"), patterns.radical(patterns.number.satisfies("x=2"))).strictOrder.matches(problem.latex)

content: when answer and problem.submitted "Your answer is correct. Move on to the next slide."
when problem.submitted "Please try again"
otherwise ""
1 Like