I'd like to use PHP to grade a quiz. I have a quiz that, upon submission, delivers an array of answers. They're all True/False so the array is something like
array([0] => T, [1] => F, [2] => F)
And then I have an answer key, something like
array([0] => T, [1] => F, [2] => T)
I need to go through each answer so I can not only calculate the percentage correct, but also display the correct answers for questions that were missed if and only if the number of missed questions is fewer than 20%.
So my question is, should I be doing some kind of foreach loop to go through each, or would it be tidier to use some kind of array comparison function, and if so, which?