I need to get a list of questions with CORRECT answers.
I found this topic:
https://moodle.org/mod/forum/discuss.php?d=169011
It lists this SQL statement:
select
quiz.name,
q.questiontext, qa.answer
from mdl_quiz as quiz,
mdl_question_answers as qa,
mdl_question as q
where
quiz.id in (select id from mdl_quiz where course=1974)and
qa.question=q.id and
fraction>0 and
question in
(select id
from mdl_question
where category=
(
select category
from mdl_question
where id = (select left(cast(questions as CHAR(10)),5)
from mdl_quiz
where id=quiz.id)
)
)
But the SQL statement generates the following error:
#1054 - Unknown column 'questions' in 'field list'
Since that original post was from 2011, is there a way to fix this statement or another way to do it?
Thanks