General developer forum

how to link mdl_question to mdl_quiz in SQL

 
Picture of Chen PENG
how to link mdl_question to mdl_quiz in SQL
 
Greetings folks,


I am new to Moodle world I want to know how to  link mdl_question to mdl_quiz in SQL.

I need to filter qtype in mdl_question table in order to get  any quiz contain essay type question.


Thanks in advance


 
Average of ratings: -
Picture of Chen PENG
Re: how to link mdl_question to mdl_quiz in SQL
 

I have solved it myself smile. it should link through mdl_quiz_slots.


Thanks


select q.* from mdl_question q

join mdl_quiz_slots qs

on qs.questionid = q.id

join mdl_quiz qz

on qz.id = qs.quizid

where qz.id=820

 
Average of ratings: -