Viewing Question Text

Viewing Question Text

di Mike Keyes -
Numero di risposte: 1
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?
Media dei voti: -
In riposta a Mike Keyes

Re: Viewing Question Text

di Tim Hunt -
Immagine Core developers Immagine Documentation writers Immagine Particularly helpful Moodlers Immagine Peer reviewers Immagine Plugin developers
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. triste

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.