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

Faulty question linking on repeated course/activity import

XMLWordPrintable

    • MOODLE_401_STABLE
    • Hide
      1. Create a course hereinafter referred to as the "source course"
      2. Create a quiz activity inside the source course
      3. Create a true/false question inside the quiz (note that the question category is under the course context by default)
      4. Create another course hereinafter referred to as the "destination course"
      5. Import the source course into the destination course
      6. Edit the question via the "Questions"-tab within the quiz in the destination course. eg. append "edited from within quiz in destination course, first import"
      7. View the question in the "Questions"-tab within the quiz in the source course and observe that the question did not change. This is expected!
      8. Import the source course into the destination course again
      9. Edit the question via the "Questions"-tab (not the "Question bank"-tab) within the newly imported quiz in the destination course. eg. append "edited from within quiz in destination course, second import"
      10. View the question in the "Questions"-tab within the quiz in the source course and observe that the question has changed according to the edit in the destination course. This is unexpected!

      I also verified the unexpected linking with the following code line inserted to question/bank/editquestion/questions.php:

      debugging("Question category details on question id $id... id: $category->id, contextid: $category->contextid, parent: $category->parent, name: $category->name, info: $category->info", DEBUG_ALL); 

      Show
      Create a course hereinafter referred to as the "source course" Create a quiz activity inside the source course Create a true/false question inside the quiz (note that the question category is under the course context by default) Create another course hereinafter referred to as the "destination course" Import the source course into the destination course Edit the question via the "Questions"-tab within the quiz in the destination course. eg. append "edited from within quiz in destination course, first import" View the question in the "Questions"-tab within the quiz in the source course and observe that the question did not change. This is expected! Import the source course into the destination course again Edit the question via the "Questions"-tab (not the "Question bank"-tab) within the newly imported quiz in the destination course. eg. append "edited from within quiz in destination course, second import " View the question in the "Questions"-tab within the quiz in the source course and observe that the question has changed according to the edit in the destination course. This is unexpected! I also verified the unexpected linking with the following code line inserted to question/bank/editquestion/questions.php: debugging( "Question category details on question id $id... id: $category->id, contextid: $category->contextid, parent: $category->parent, name: $category->name, info: $category->info" , DEBUG_ALL);

      Questions in a quiz are linked to a wrong question bank/context when a quiz activity or a whole course (with a quiz activity) is imported a second time in a destination course. While on a first import all questions in question banks not sharing a parent context with the destination get duplicated, on subsequent imports the question in the newly imported quiz activity are linked against the original question bank in the context of the original (source) activity/course. This causes some trouble:

      • The relation to the source course/activity is not obvious because it is nowhere shown. Just the question category name is shown to the user but which is not unique (exists in source and destination context).
      • Therefore, edits to questions in the destination leads to (probably undesired) changes in the source course/activity without knowing! This makes the bug a major problem in my opinion.
      • Permission for a user to interact with the questions in the destination course depending on permission given in the source course.

      The first two points are related to MDL-69306 and the third point is related to MDL-14802.

      I would expect that questions in quizzes from subsequent imports to be linked to the already duplicated questions in the question bank of the destination context like it is done during the first import.

            Unassigned Unassigned
            jojoob Johannes Burk
            Votes:
            8 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.