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

error_qtype_match_subquestion_missing_in_db

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.8.8
    • Quiz
    • None
    • MOODLE_38_STABLE

      This is similar to issue: MDL-26442

      A client of ours reported a bug when attempting to either:

      • Duplicate a particular existing quiz
      • Backup then restore a specific quiz into new course (error only occurs on the second restore of the same backup file)

      Error shown to the browser is: error_qtype_match_subquestion_missing_in_db.
      This code relates to the process_match method of restore_qtype_match_plugin.class.php

      The problem in this instance is that the $this->questionsubcache array does not contain the question text. The value of $data->questiontext is  "<p>Self- rating of how important <a title="Physical attractiveness" href="$@QUIZVIEWBYID*419@$">physical attractiveness</a> of a romantic partner is to them<br></p>"

      While the relevant array item is the same except for the href="" url which contains a proper url, ending in /mod/quiz/view.php?id=419

      Because of this, the quiz question cannot be matched.

      I see the backup_quiz_activity_task::encode_content_links method to replace /mod/quiz/view.php?id=[0-9]+ with string $@QUIZVIEWBYID*$2@$ - but it appears the inverse of this should occur before the array is searched in process_match().

      I'm not sure how the client has got the data into this situation. However, if I create a backup of the activity then restore it into a local vanilla Moodle twice, I get the issue. If I then delete every question in my local Moodle quiz activity then restore the file, the issue persists.

      Here is the backup of the activity:
      https://drive.google.com/file/d/1cGxogd2U2kCpQJm1pYD-KwhuHLlrAezn/view?usp=sharing

      I'm not sure why this is happening, but this page advised me to report this here:
      https://docs.moodle.org/35/en/error/moodle/error_question_answers_missing_in_db

            Unassigned Unassigned
            steven.mccullagh Steven McCullagh
            Votes:
            2 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.