Student feedback on slide

I’m looking to have a slide let students know when they have entered the correct coordinates into a math input on a slide. I wanted to write the code to have it display “Yes, you’ve got it” when they enter the correct coordinates or “Please try again” when they enter them incorrectly. I got most of the coding correct using what I saw on another activity that someone else created, but I don’t know why I’m getting this error (see screenshot). I also should mention that I really know 100% understand what the coding is saying, but I get it a little. Thanks for your help!script

You didn’t close the string on your second when statement. You need a closing " at the end.

The contextual highlighting is really helpful. Purple is strings, red is logic statements, black is variables/objects/properties/functions, green is sinks/sources, orange is LaTeX, and grey is comments.

There should also be a period between Input1 and latex. It’s also better to use backticks (same key as ~ by the 1) for comparing latex instead of quotes.

a= `(6,2)`
content: 
when isBlank(Input1.latex) ""
when Input1.latex=a "Yes, you got it!"
otherwise "Please try again."

Yeah, LaTeX comparison is more robust. Still have to put in answers with x-2 and (x-2) though.

But then you can generate a simpleFunction() and compare some test points with evaluateAt().

Man, I :two_hearts: desmos.

1 Like

Thank you! I got it! I don’t have much of an idea of what I’m doing but every time I try I learn a little more! Thankful for this community of people who can help in a pinch!

Thanks for this thread. I am using it in an activity for my Alg 2 class. I have it working except that as soon as I start typing the msg “Please Try again” pops up. Once I have the correct answer the msg then changes to “Yes, you got it.” How do I get the screen to wait until I am done typing the answer before giving the feedback? Thanks Burton

For inputs:

content: when not(input.submitted) ""
         when correctCondition "Correct"
        otherwise "Incorrect"

For table cells:

when isBlank(table.cellContent(1,2)) or cellHasFocus(table.cellContent(1,2)) ""
when correctCondition "Correct!"
otherwise "Incorrect"

There are other ways, but I like these

Got it to work. Thank you. B

1 Like