Well, I don’t know how you would do this.
I get a load of answers from a student as $_POST[‘G1’], $_POST[‘G2’] etc. I assign them to PHP variables $q1, $q2 etc.
I check them for empty answers and whitespace.
for ($i=1; $i <= 41; $i++) {
if (${"q$i"} == '') ${"q$i"} = 'X';
// get rid of possible white space with trim
$studentAnswers[] = trim(${"q$i"});
//echo ${"q$i"} . '<br>';
The correct answers are in a table called markingAnswers20BECW.
I read the correct answers into an array, then check each answer from the student against the correct answers or answer.
Then I save the student’s answers and score to a table called allstudentsAnswers20BE.
This all worked fine up to now!
EDIT
Strange tale to tell:
Tomorrow I have the 20EAP class again, I have them 2 times a week. We must have online class until October, because of the virus.
I uploaded the webpage for tomorrow.
I generate the php script to deal with the answers using Python. I just need to tell Python which class, how many variables, which week and how many points per answer.
1 second and the php is ready. I tried it at home, no problem.
So I uploaded tomorrow’s webpage and the php script, filled in the answers, 41 of them, and clicked “Send answers”, fully expecting trouble!
Nothing, everything OK, 100% correct, 100% score!
So I have no explanation for the problem above. But it seems to have gone away.
I will generate the problem script again and try, see if I get the same problem!!