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

Quiz Duplication With Carriage Return Results in a Fatal Error

XMLWordPrintable

    • PostgreSQL
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      NOTE where I say '^M' you must insert a carriage return character into the field, on my OS this is achieved when I type ctrl-m

      1/ Create a new quiz with default settings
      2/ Add a multiple choice question to the quiz

      • Question Name: 'Duplication Problems'
      • Choice 1:
        Answer: 'An answer with this: ^M newline'
        Grade: 100%
      • Choice 2:
        Answer: 'Another answer'
        Grade: 0%
        3/ Go to course page and press the x2 button
        4/ Continue with duplicate of quiz

      Expected result
      -----------------
      Quiz is Duplicated

      Actual Result
      -------------
      error/error_question_answers_missing_in_db

      Show
      NOTE where I say '^M' you must insert a carriage return character into the field, on my OS this is achieved when I type ctrl-m 1/ Create a new quiz with default settings 2/ Add a multiple choice question to the quiz Question Name: 'Duplication Problems' Choice 1: Answer: 'An answer with this: ^M newline' Grade: 100% Choice 2: Answer: 'Another answer' Grade: 0% 3/ Go to course page and press the x2 button 4/ Continue with duplicate of quiz Expected result ----------------- Quiz is Duplicated Actual Result ------------- error/error_question_answers_missing_in_db

      When attempting to duplicate a quiz using the x2 button the duplication fails. I thought this might be MDL-29432, but it doesn't seem to match any of the rules in that bug.

      When I attempt to replicate the issue on my local machine by backing up and restoring the whole course this works fine and I can't replicate the issue. I have access to the live data which might be useful to replicate and fix this issue.

      error/error_question_answers_missing_in_db
       
      More information about this error
       
      Stack trace:
      line 159 of /backup/moodle2/restore_qtype_plugin.class.php: restore_step_exception thrown
      line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_plugin->process_question_answer()
      line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
      line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
      line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
      line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
      line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
      line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
      line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
      line ? of unknownfile: call to progressive_parser->end_tag()
      line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
      line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
      line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
      line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
      line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 302 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 90 of /course/modduplicate.php: call to restore_controller->execute_plan()

            stronk7 Eloy Lafuente (stronk7)
            poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            David Monllaó David Monllaó
            Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

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