Is it possible to view the questions that a student had for a quiz? A teacher made a quiz with random questions and now he would like to see the questions his students were asked. I know a teacher can view questions for one student at a time but what about the entire class? Can this be done be querying the database?
There is no easy way to do this inside Moodle.
The way the selection of random questions used in the quiz is stored in the database is really horrible, and I would love to change it one day, but doing so would be a huge cahange, so I keep putting it off until later.
In the quiz, different types of report are plugins, so if you can work out the right database query, it should then be quite easy to wrap it up in some PHP code and make a nicely formatted report for teachers to see.
The following SQL may help you get started. The ON condition on that last join is what I mean by really horrible.
The way the selection of random questions used in the quiz is stored in the database is really horrible, and I would love to change it one day, but doing so would be a huge cahange, so I keep putting it off until later.
In the quiz, different types of report are plugins, so if you can work out the right database query, it should then be quite easy to wrap it up in some PHP code and make a nicely formatted report for teachers to see.
The following SQL may help you get started. The ON condition on that last join is what I mean by really horrible.
SELECT * FROM m_quiz_attempts qa JOIN m_question_sessions sess ON qa.uniqueid = sess.attemptid JOIN m_question_states st ON st.id = sess.newgraded JOIN m_question randq ON randq.id = sess.questionid AND randq.qtype = 'random' JOIN m_question actualq ON st.answer LIKE 'random' || actualq.id || '-%';Development:Quiz_database_structure may help too.