Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7501

Wrong function to return question types in question format: Word table

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.5
    • Fix Version/s: None
    • Labels:
      None
    • Affected Branches:
      MOODLE_34_STABLE

      Description

      I get an error with this test vendor/bin/phpunit "qformat_wordtable_export_test" question/format/wordtable/tests/wordtableformat_test.php but i don't have qtype_multichoiceset plugin in my system.

      ...EDebugging: Invalid get_string() identifier: 'pluginnamesummary' or component 'qtype_multichoiceset'. Perhaps you are missing $string['pluginnamesummary'] = ''; in /lang/en/qtype_multichoiceset.php?

      In moodle/question/format/wordtable/format.php (ln 548) this is the code to give this error :

      // Add All-or-Nothing MCQ question type strings if present.
      if (is_object(question_bank::get_qtype('multichoiceset', false))) {
      $textstrings['qtype_multichoiceset'] = array('pluginnamesummary','showeachanswerfeedback');
      }

      The question_bank::get_qtype('multichoiceset', false) always return an object even if you use question_bank::get_qtype('blablabla', false) . So no matter the result it's still an object.

      I think it's better way to use to check if an qtype is installed

      $qtypes = question_bank::get_all_qtypes();

      and after checked if exist in array.

        Attachments

          Activity

            People

            Assignee:
            campbeeo@tcd.ie Eoin Campbell
            Reporter:
            ligned David Ligne
            Participants:
            Component watchers:
            Eoin Campbell
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: