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

Need to implement the bit in question_move_questions_to_category that handles datasets

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9, 2.2.1
    • Fix Version/s: DEV backlog
    • Component/s: Questions
    • Labels:
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE

      Description

      This is only possible after MDL-10899 is fixed. It introduces a new function question_move_questions_to_category($questionids, $newcategory) in questionlib.php, which currently has a comment // TODO Deal with datasets.

      Datasets on calculated questions can either be private to this question, in which case question_dataset_definitions.category = 0, or they can be available for sharing between all questions in a category, in which case question_dataset_definitions.category points to question_categories.id.

      This bug is about what to do with question_dataset_definitions.category when a question using that dataset is moved to another category. There are several cases for each dataset that is used by one of the questions we are moving:

      1. if question_dataset_definitions.category == 0, do nothing.

      2. if question_dataset_definitions.category != 0, but all the questions that use this particular dataset are in the list of questions being moved. In this case, just update question_dataset_definitions.category to point to the new category.

      3. if question_dataset_definitions.category != 0, and there are questions that will remain in the old category that share this dataset with questions that are moving. This is the hard case.

      In think in case 3. we should automatically create a copy of the dataset in the new category.

      Does this sound like the right plan?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              timhunt Tim Hunt
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: