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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.4.5
    • None
    • MOODLE_34_STABLE

      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.

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

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.