SQL of questions results table

SQL of questions results table

by Kristaps Muižnieks -
Number of replies: 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.

Average of ratings: -