How do I code so that students receive feedback (green check or red x) when checking two boxes? Box 4 and box 5 are correct and this coding is not working- nothing happens when boxes are checked:
correct:
(this.isSelected(4) and this.isSelected(5) and not(this.isSelected(1) or this.isSelected(2) or this.isSelected(3)))
In my opinion the default behaviour should be the opposite way around: if you want something to be checked for correctness, opt in to that.
You are far, far from alone in asking about this and it’s not explained in the documentation.
So here is my next problem- it shows the x on the dashboard preview, but it does not show it on the student screen preview. Is there anything I can do for my students to get immediate feedback? Or should I tackle this kind of question differently altogether?
Somewhat differently. You need to add something somewhere on the screen to indicate to students what happened. This might be in a Note component.
Name your checkbox to something like answers(doesn’t matter what) so that you can refer to it. Then inside answers change the code to something like:
allGood = (this.isSelected(4) and this.isSelected(5) and not(this.isSelected(1) or this.isSelected(2) or this.isSelected(3))) correct: allGood
Then in your Note component you can add something like:
feedback = when answers.script.allGood "correct" otherwise ""
And import that feedback variable into your note content.
By the way this is made easier if you use an Answer Key for the Checkbox component as you can set up your correctness scheme directly there if you want.
answers= D and E
correct: answers
warning: when (A OR B OR C) or not(D or E)AND not(this.submitted) “This isn’t submitted” otherwise “”
My attempt works, except for when students choose D, E (both correct) and additional (wrong) answers, they still get the message that they are correct. How can I fix this? I am so sorry, but I am completely new to coding in desmos and I am willing to learn!