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

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 1.9, 2.2.1
    • Questions
    • MOODLE_19_STABLE, MOODLE_22_STABLE

      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?

            Unassigned Unassigned
            timhunt Tim Hunt
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.