I am trying to write a simple code where 3 answers are recorded out of 6 possible answers. The 3 answers inputted should be checked to either be correct or incorrect (return 1 for correct and 0 for incorrect). Upon 3 answers being submitted, the routine should be forced to end.
I have attached my current code and the keyboard component. I am unsure as how to stop the routine from immediately ending when only 1 possible answer is submitted.
I am still having issues with the section for “end routine”. I have 6 options total possible (1,2,3,4,5,6) and 3 out of the 6 are correct. In this case the three correct are 2,4,5. I want to write some code that will check and return the amount of correct responses. So if out of 3 responses, only 1 is correct, “1” is returned. If 2 responses out of 3 are correct, “2” is returned, and if all 3 responses are correct, “3” is returned. The code on lines 17-18 works well when all 3 responses selected are correct, but I am having trouble writing some simple code for when only 1, or when only 2 out of the 3 responses are correct. Is there a simpler way of writing this code without having to write out each possible permutation?