Segue o comando SQL que lista todos as questões que compõe o banco de questão das enquetes
Versões da enquete que foi testado:
- Maio/2017 - 2017050101
- Dezembro/2013 - 2013122200
Filtro apenas na tabela de banco de questão mdl_questionnaire_question
SELECT qq.id,qq.survey_id,qq.name,qq.type_id,qq.result_id,qq.length,qq.precise,qq.position,qq.content,qq.required,qq.deleted,qq.dependquestion,qq.dependchoice FROM mdl_questionnaire_question qq WHERE qq.id > 0
Filtro com junção na tabela de enquete e tipo de questões
SELECT qq.id,qq.survey_id AS mdlsurveyid,qs.name AS surveyname,qs.title AS surveytitle,qq.name,qq.type_id AS typedefaultid,qt.id AS mdltypeid,qt.type AS typename,qt.has_choices AS typehaschoices,qt.response_table AS typeresponsetable,qq.result_id,qq.length,qq.precise,qq.position,qq.content,qq.required,qq.deleted,qq.dependquestion,qq.dependchoice FROM mdl_questionnaire_question qq LEFT JOIN mdl_questionnaire_survey qs ON qs.id=qq.survey_id LEFT JOIN mdl_questionnaire_question_type qt ON qt.typeid= qq.type_id WHERE qq.id > 0