Thanks for the replies!
@benanamen as this is only my school homework (and lately, because of the virus, online class) database, I am not too worried about being really strict.
@Strider64 Hope your blood pressure thing is working out! I can recommend exercise and diet and green tea. A South African friend, after he came to China, started drinking green tea and stopped taking blood pressure pills!
Well, I found a quick way to get all the column names: just click the SELECT button in the phpMyAdmin SQL tab, then just delete the things I don’t want! I can do what I want easily in Python, but I was hoping to do it directly in MySQL.
What I really want to do is: find every incorrect student answer, so I can quickly tell them what they got wrong, they can try again. Maybe I should start another question.
Trouble is, the answers are in the table markingAnswers20EAPCW. There is a column questionnr and the answers go in, (sorry benanamen again) columns like Week1, Week2 … Week 19 So all the correct answers are in 1 column.
I can easily get the correct answers:
SELECT questionnr, Week10_T FROM markingAnswers20EAPCW
WHERE Week10_T != ''
When the student clicks “send answers” PHP gets the correct answers, compares them with the student’s answers and marks them. Each time a student sends answers, PHP inserts a new row in allstudentsAnswers20EAPCW with all the answers, (sorry again benanamen) in columns like Answer1, … Answer75
So all the student’s answers are in 1 row!
Now I want to compare, not for all students, just occasionally, the correct answers and the student’s answers and filter out the wrong answers.
I just realized, I could save all wrong answers as they are marked in an array and write them to a wrong_answers_table.
However I would like to develop some MySQL query to do get the wrong answers when I want. I’m working on it.
In Python it is a lot easier, I can just get lists of tuples and compare them!