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

Corrupt question error message improvement

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      I often have issues with the relationship between questions and their answers breaking down, when trying to import a quiz from one course into another.

      The error message usefully mentions the question's database ID, but could easily go a little further to provide a link for editing the question.

      The following SQL (adapted from https://moodle.org/mod/forum/discuss.php?d=340262) provides such a link.

       

      SELECT
      Concat('../question/question.php?courseid=', c.id, '&id=', q.id) AS question_bank_link
      FROM mdl_question q
      LEFT JOIN mdl_question_categories qc ON qc.id = q.category
      LEFT JOIN mdl_context ctx ON ctx.id = qc.contextid
      LEFT JOIN mdl_course_modules cm ON cm.id = ctx.instanceid AND ctx.contextlevel = 70
      LEFT JOIN mdl_course c ON (ctx.contextlevel = 50 AND c.id = ctx.instanceid) OR (ctx.contextlevel = 70 AND c.id = cm.course)
      LEFT JOIN mdl_question_answers qa on qa.question = q.id

      WHERE q.id = [questionid]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mcook Matthew Cook
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: