Slots and DB Questions ID

Slots and DB Questions ID

by Carlo Martini -
Number of replies: 3

Hello,
Given a function (like those in /mod/quiz/rendered.php) using the $slots variable (that is the questions for a quiz attempt) how can I get the original database ID of the questions?

(The questions may be random)

Average of ratings: -
In reply to Carlo Martini

Re: Slots and DB Questions ID

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The question is random. e.g. there is no mod/quiz/rendered.php. Understanding Moodle's DB structure is important, so you are right to try to do that.
In reply to Tim Hunt

Ri: Re: Slots and DB Questions ID

by Carlo Martini -
Hello Tim,
Sorry, I wrote "rendered.php" but it was "renderer.php".

Anyway, by studying https://github.com/moodle/moodle/blob/master/mod/quiz/attemptlib.php I was able to get the data I needed through API and thus didn't need the database ID of the questions anymore. Thank you anyway for the reply.
In reply to Carlo Martini

Re: Ri: Re: Slots and DB Questions ID

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Great! Well done for working it out, and generally it is better to use the API when you can.