Databases: SQL for User-Question Information

Databases: SQL for User-Question Information

by Kyle DeFreitas -
Number of replies: 4

I am unable to find where the responses of the students to the individual question in a quiz or SCROM is stored.

Will like to extract it to another tool using SQL for analysis.

Average of ratings: -
In reply to Kyle DeFreitas

Re: Databases: SQL for User-Question Information

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Tim Hunt

Re: Databases: SQL for User-Question Information

by Kyle DeFreitas -

Thanks again this has been helpful, especially for Moodle 2.1+

However the system we using is moodle 2.0 because our provider cannot update their php version to 5.3.

So I note in the 2.1+ we can get the user who attempts the question in the question engine at question_attempt_steps, however there seems to be no parallel relationship in 1.9 and 2.0. The only relation I see with the user table if for who created and modified the actual question.

Should I then assume that analysis on user-question attempts/responses is not possible for < 2.1

Thanks

In reply to Kyle DeFreitas

Re: Databases: SQL for User-Question Information

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Your assumption is wrong.

question_attempt_steps.userid is not (necessarily) the student who attempted the question. It is the user who did this action to the question. (Think about manual grading essays to see the difference.)

In both cases, the student who attempted the quiz is in the quiz_attempts.userid column.

Did you try running this DB query: http://docs.moodle.org/dev/Question_database_structure#Following_what_happens_when_questions_are_attempted

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Databases: SQL for User-Question Information

by Kyle DeFreitas -

Much thanks for the help,

I was able to get the relationship I was looking for. The help is most appreciated.