moodle 2.1 question engine :: renderer info

Re: moodle 2.1 behaviour for regexp question type

by Tim Hunt -
Number of replies: 7
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is about making sure that two different plugins do not try to define a DB table with the same name. The way to do that is to say that the tables for each plugin must start with the internal plugin name. In this case that is qtype_regex.

I know that, historically, question types have used tables with names starting question_, but we should change that. You will not that in Moodle 2.1, the essay question type uses a table called qtype_essay_options.

Some time, I will rename all the core question type tables to match the new naming scheme, but I am going to wait until they say something like "to upgrade to Moodle 2.3, you must already have Moodle 2.2", because that gives us a clean break in the upgrade process at which to make the change.

To make your plugin obey the rules, you should just have to:

  1. Search-and-replace question_regex -> qtype_regex_options where it is the table name.
  2. Write an upgrade step in db/upgrade.php to rename the existing table.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: moodle 2.1 behaviour for regexp question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks Tim,

I'll do that,

Joseph

In reply to Joseph Rézeau

Re: moodle 2.1 behaviour for regexp question type

by Oleg Sychev -
Picture of Core developers Picture of Plugin developers

By the way, Joseph, did you publish any articles (or book, or whatever except Internet sites) on you question type? I would like to add references on them to my articles when comparing our questions...

In reply to Oleg Sychev

Re: moodle 2.1 behaviour for regexp question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Sorry, Oleg, I do not have anything published in Journals about the regexp question type. But I used a similar type of question with analysis of the student's response when I was writing my PhD thesis. My thesis (in French) can be found:

Joseph

In reply to Joseph Rézeau

Re: moodle 2.1 behaviour for regexp question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

The latest version of the regexp question type, with "help" feature based on question behaviour is now available from the new Moodle plugins repository here:

http://moodle.org/plugins/view.php?plugin=qtype_regexp

and the two associated question behaviours from here:

http://moodle.org/plugins/view.php?plugin=qbehaviour_regexpadaptivewithhelp

and

http://moodle.org/plugins/view.php?plugin=qbehaviour_regexpadaptivewithhelpnopenalty

Looking forward to tester's remarks, bug reports, suggestions, etc.

Note.- Needs Moodle 2.1.2 version 2011070102.03

In reply to Tim Hunt

Re: moodle 2.1 behaviour for regexp question type

by Jean-Michel Védrine -

Hello Tim,

This is rather bad news for people working on a lot of question types because it means we must spend some time on perfectly working plugins just to satisfy this new rule and I don't beleive the issue of "2 plugins using the same table name starting with "question_" has anything real !

In reply to Jean-Michel Védrine

Re: moodle 2.1 behaviour for regexp question type

by Jean-Michel Védrine -

Tim,

Is this rule about qtype tables names also valid for Moodle 2.0 questiosn types ?

If yes I have some trouble to find a way that upgrade works from all 2.0 versions (both with question_ and qtype_ names) to all 2.1 versions (both with question_ and qtype_ names) ?

Of course $dbman->table_exists can be used, but even with that, if people using a 2.0 version with qtype_ names try to upgrade to a 2.1 version with question_ names it will make a big havoc !!

I see no perfect solution.

 

In reply to Jean-Michel Védrine

Re: moodle 2.1 behaviour for regexp question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We should probably get them to relax the rules for qtype plugins. If you file a MDLSITE bug in the tracker, I will vote for it.