SQL of questions results table

SQL of questions results table

από Kristaps Muižnieks -
Αριθμός απαντήσεων: 1

Good day!


Our Moodle has a custom way to get quiz results for the second system - getting all quiz questions and user results directly from the database via SQL. Everything is fine until I'm getting a random question from categories within the test. The problem is SQL is currently getting each question separately since all students have different last random question. 

According to the report(using example picture):


There is a way to build this table.

There are all questions with their points even with random pick questions in the same question. Is there a way to get SQL queries for this table? Things I need are questions, max points, and user points. Yes, I have seen that people are pointing to moodle class within a report class, but I would like to prefer a query since I have this export outside of Moodle.

Thank you.

Μέσος όρος βαθμολογίας: -
Σε απάντηση σε Kristaps Muižnieks

Re: SQL of questions results table

από Tim Hunt -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers
The key bits of query you need to get the data about one quiz attempt is (part of) https://docs.moodle.org/dev/Overview_of_the_Moodle_question_engine#Detailed_data_about_an_attempt. I hope that is enough to get you started.