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

Warning of missing property in export of multitype questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5
    • Questions
    • MOODLE_405_STABLE
    • MDL-81952-403
    • MDL-81952-404
    • MDL-81952-main
    • Hide

      Prerequisites:

      1. In your Moodle installation enable all PHP error levels (including warnings), the typical set on a dev system.

      Test instructions:

      1. Login as admin/teacher in Moodle.
      2. Go to a course and in the course to the question bank.
      3. Create a new question from type cloze.
      4. Save the question and return to the list of questions.
      5. In the selector nav above choose "Export"
      6. Select "Moodle XML", choose the correct category where you have put your question and hit the "Export question to file" button.

      Before the patch of this MDL is applied:

      • The new page loads but soon after a splash screen with the error message from the description is shown. No file is downloaded.

      After the patch of this MDL is applied:

      • The new page loads and shortly after you see the XML file being downloaded.

       

      Proposal for a cloze question text, see comment below.

      Show
      Prerequisites: In your Moodle installation enable all PHP error levels (including warnings), the typical set on a dev system. Test instructions: Login as admin/teacher in Moodle. Go to a course and in the course to the question bank. Create a new question from type cloze. Save the question and return to the list of questions. In the selector nav above choose "Export" Select "Moodle XML", choose the correct category where you have put your question and hit the "Export question to file" button. Before the patch of this MDL is applied: The new page loads but soon after a splash screen with the error message from the description is shown. No file is downloaded. After the patch of this MDL is applied: The new page loads and shortly after you see the XML file being downloaded.   Proposal for a cloze question text, see comment below.

      When exporting a cloze question inside a category from the question bank a warning is issued (using PHP 8.2):

      Undefined property: stdClass::$categoryobjectStack frames (7)
      6 Whoops\Exception\ErrorException
      …/question/type/multianswer/questiontype.php:149

      5 default_error_handler
      …/question/type/multianswer/questiontype.php:149

      4 qtype_multianswer get_question_options
      …/question/editlib.php:109

      3 get_questions_category
      …/question/format.php:937

      2 qformat_default exportprocess
      …/lib/questionlib.php:1815

      1 question_pluginfile
      …/lib/filelib.php:5140

      0 file_pluginfile…/pluginfile.php:44

      This is probably because subquestion parts have a parent id and therefore do not exist independent from the parent. Only the parent needs the category.

       

            strobotta Stephan Robotta
            strobotta Stephan Robotta
            Mathew May Mathew May
            Tim Hunt Tim Hunt
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h

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