How can I provide different responses to different answers

I have the coding to tell a student if an answer is correct or not, but if students rounded to the tenths instead of the hundredths place (which will be a very common error as the calculator that is embedded in the math input rounds to 6 digits), I want a response to tell them that they rounded incorrectly for that specific answer.

I don’t understand coding that well and usually copy and paste CL and then edit it to make it work for me. I’m guessing I would need to set a variable to that value or something, but I’m not really sure how to do it.

Also- I can’t figure out why my slides 7, 13 and 14 aren’t checking if they are correct in my teacher summary.

Here is my activity: Compound Interest Advanced Algebra • Activity Builder by Desmos
Slide 14

Thank you so much in advance!!!

Change your feedback to this. Note I changed the order a little, so you don’t need to keep using “and practice.submitted”.

content: "${feedback}"

feedback = 
  when not(practice.submitted) ""
  when practice.script.correct "Correct! Nice job!"
  when numericValue(`\round(${practice.numericValue},2)`)=14800.86 "Oops! You didn't round your answer correctly."
  otherwise  "Incorrect.  Try again!"

You’ll also need to have a correct: sink (or readOnly:true) for the first input if you want a checkmark on the dashboard.

1 Like

Thank you so much for that feedback!!! I forgot about the otherwise… of course!

I’m still trying to get the 14th slide to show a check mark, but when I add readOnly: true to the text inputs, it gives me the error "Could not find sink “readOnly”. How do I get it to not look at the text inputs and only look at the table to determine if it is correct and provide the checkmark on the dashboard?

Thank you again so much for your help!!

readOnly: true only works with components that can be corrected using a correct: sink. Text inputs and explain prompts cannot be auto graded, so it won’t work for those, and at best you will get a dot on the dashboard (or an X if something is incorrect).

I think you had an otherwise. It was just the result for unsubmitted responses. I like the above order because it cleans the code up a little more (i.e. not needing .submitted on numerous lines).