Separating Questions from Quiz-How does this affect the database?

Separating Questions from Quiz-How does this affect the database?

by N Hansen -
Number of replies: 6
Gustav-I have looked at your documentation for separation of questions from quizzes but it all seems to be with regards to the php end of things. I cannot find anything about how this change will affect the quiz-related tables in the database. I use the flashcard module which itself relies on the mdl_quiz_match table as the source of its data. I want to make sure it will work in 1.6 but that would depend on database changes. Are there any? If so, perhaps an overview of what they are would be helpful for people.
Average of ratings: -
In reply to N Hansen

Re: Separating Questions from Quiz-How does this affect the database?

by Gustav W Delius -

Other Moodle code should not access the tables in the database directly but should instead use the functions defined in lib/questionlib.php and the methods from the question type classes. If your module needs functionality which is not provided for by the currentlly existing functions and methods then these could be extended.

To see how other modules can use the Moodle questions you could take a look at the questiondemo module in contrib/questiondemo.

In reply to Gustav W Delius

Re: Separating Questions from Quiz-How does this affect the database?

by N Hansen -
I see...OK, I'll take a look at the flashcard module once I start testing 1.6 and if there are any problems will try and modify the code. I'm just concerned because the flashcard developer seems to have gone AWOL and so I don't expect any sort of update from him.
In reply to N Hansen

Flashcard module

by Gustav W Delius -
The new question engine in Moodle was created exactly so that it would be easy to write modules that use questions, like a flashcard module for example. If the developer of the existing flashcard module is gone it may be simpler to write a new one from scratch than trying to modify the existing one. For an example of how simple the code is for rendering and scoring questions take a look at the questiondemo module in cvs:/contrib/questiondemo.
In reply to Gustav W Delius

Re: Flashcard module

by Matt Campbell -
With my rather pitiful attempts, I've been working on using the questiondemo model and can't get past the following error:

Error: Missing subquestions for this question!

Warning
: array_keys(): The first argument should be an array in /var/www/moodle2/lib/moodlelib.php on line 6174


I took the model, replaced the 'questiondemo' changes with 'flashcard' and made a few other changes, then placed the javascript in at the right place (I think!)  But with the java or without it, I continue to get the above error.

I've attached my latest attempt at this.

Thanks,
Matt