Complition conditioning

Complition conditioning

by Jose Velazquez-Torres -
Number of replies: 4

Hello everyone,

Im trying to make a plugin that add an grade complition condition to a quiz activity. I already have the information of the activity from the quiz table but the conditions are manage in the course_modules table. 


Is there a way that I could identify the quiz in the course_modules table with the information from the quiz table?



Average of ratings: -
In reply to Jose Velazquez-Torres

Re: Complition conditioning

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes.

Look in table mdl_modules for a record with name 'quiz' and note the 'id' value (I'll refer to this as the 'moduleid', below).

Look in table mdl_course_modules for a record with 'instance' = 'id from the quiz table' and 'module' = 'moduleid' (found above).
In reply to Davo Smith

Re: Complition conditioning

by Jose Velazquez-Torres -
That helps me identify wich one are the quizzes, but how I will identify each quiz? The ID seem to be different from the one in the quiz table
In reply to Jose Velazquez-Torres

Re: Complition conditioning

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Please re-read what I wrote above. I have already told you exactly how to identify which course module record matches each quiz record (match the instance field with the id from the quiz table).