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

impossible to duplicate a quiz when Course question bank contains matching questions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.2.6, 2.3.3, 2.4
    • 2.2.7, 2.3.4
    • Questions, Quiz
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      Note: I suggest to first try to reproduce the problem without applying the patch because I think that as the problem may be OS dependant we first need to ensure that the problem is happening on the test configuration to be sure it is fixed after applying the patch !!
      When both Moodle server and client are on a windows machine, the problem always happens.

      In a course with some questions create a match question containing a subquestion with several paragraphs (You can as the original reporter did for instance type some text and hit return to create an empty paragraph, but you can try other variations as long as there is several paragraphs in the subquestion text).
      Create a quiz in this course. You don't need to include the offending question in the quiz.
      Try to duplicate the quiz.
      Without the patch
      You get an error_question_match_sub_missing_in_db exception
      With the patch applied
      Duplication should not display any error.

      Show
      Note: I suggest to first try to reproduce the problem without applying the patch because I think that as the problem may be OS dependant we first need to ensure that the problem is happening on the test configuration to be sure it is fixed after applying the patch !! When both Moodle server and client are on a windows machine, the problem always happens. In a course with some questions create a match question containing a subquestion with several paragraphs (You can as the original reporter did for instance type some text and hit return to create an empty paragraph, but you can try other variations as long as there is several paragraphs in the subquestion text). Create a quiz in this course. You don't need to include the offending question in the quiz. Try to duplicate the quiz. Without the patch You get an error_question_match_sub_missing_in_db exception With the patch applied Duplication should not display any error.

    Description

      when trying to duplicate a quiz
      debug mode max DEVELOPER
      if the course's question bank contains Matching questions, error:
      even if the quiz being duplicated does NOT contain any matching questions!
      example with course containing just one matching question:
      // question: 43 name: match countries and capitals
      ::match countries and capitals::[html]<p>match countries and capitals</p>{
      =<p>France</p> -> Paris
      =<p>the US</p>\n<p> </p> -> Washington
      =<p>Italy</p>\n<p> </p> -> Roma
      }

      ------------------
      error/error_question_match_sub_missing_in_db

      More information about this error
      Debug info:
      Error code: error_question_match_sub_missing_in_db
      $a contents: stdClass Object
      (
      [id] => 8
      [code] => 407836914
      [questiontext] => <p>the US</p>
      <p> </p>
      [questiontextformat] => 1
      [answertext] => Washington
      )
      Stack trace:

      line 144 of \question\type\match\backup\moodle2\restore_qtype_match_plugin.class.php: restore_step_exception thrown
      line 131 of \backup\util\plan\restore_structure_step.class.php: call to restore_qtype_match_plugin->process_match()
      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 163 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 315 of \backup\controller\restore_controller.class.php: call to restore_plan->execute()
      line 101 of \course\modduplicate.php: call to restore_controller->execute_plan()

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              rezeau Joseph Rézeau
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Rajesh Taneja Rajesh Taneja
              Safat Shahin, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Jan/13