Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31099

Better management of errors when an old (incompatible) question type is installed

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.1, 2.2
    • STABLE backlog
    • Questions
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      Carefully verify the compatibility of a plugin before installing it !

      Show
      Carefully verify the compatibility of a plugin before installing it !
    • Hide

      try to install a question type for Moodle 2.0 on a Moodle 2.1 server and visit the question type management page and the question creation page in a course to verify that these page display an error message about an incompatible question type installed rather than been broken

      Show
      try to install a question type for Moodle 2.0 on a Moodle 2.1 server and visit the question type management page and the question creation page in a course to verify that these page display an error message about an incompatible question type installed rather than been broken

    Description

      See this discussion : http://moodle.org/mod/forum/discuss.php?d=193138
      In Moddle version >= 2.1 (Question engine 2) when a question type not compatible with QE2 is installed when happend is :

      • question creation page is broken
      • admin question type management is broken
        As I said in the forum discussion :
        If debugging messages are not enabled you don't get any clue of what the problem is.

      Discussing with Moodle administrators, I also understood that for quite a lot of them they are aware of the "big gap" between Moodle 1.9 and 2.0;, but they don"t realize there is another "big gap" for the quiz module between Moodle 2.0 and 2.1 ! Of course, this should not happend if anybody did read Moodle release notes carefully but ...
      I have studied the problem and in fact the same thing is happening on both pages (admin/qtypes.php and question/edit.php?courseid=x)

      in both cases question_bank::get_all_qtypes call question_bank::get_qtype for the non compatible question type, wich result in including the question\type\xxxxxx\questiontype.php file (this file DO exist for old questions types so no error at that step) wich result in a fatal error :

      Fatal error: Class 'default_questiontype' not found on line xx

      This is because all questiontype.php files from old question types include a line like
      class xxxxx_qtype extends default_questiontype {
      and of course in QE2 there is no default_questiontype class defined !

      So I think it would be good to avoid this situation in throwing a coding exception.
      We should also verify that in that case a clean uninstall of the incompatible question type is possible.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jmvedrine Jean-Michel Vedrine
            Safat Shahin, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: