Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9785 Improve Flexibility of Question Category Sharing and Permissions
  3. MDL-9788

Seperate Questions into Different Category Hierarchies in Different Context Levels

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Questions, Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      http://docs.moodle.org/en/Development:Plan_to_Improve_Flexibility_of_Question_Category_Sharing_and_Permissions#Seperate_Questions_into_Different_Category_Hierarchies_in_Different_Context_Levels

      Seperate Questions into Different Category Hierarchies in Different Context Levels
      ---------------------------------------------------------------------------------------------------------------

      Remove 'publish' field from question_categories table 'course' field will become 'contextid' and will be of INT type pointing to the 'context' table.

      Calculate equivalent context
      --------------------------------------

      Contents of the new context table will depend on the old contents of 'publish' and 'course' if publish is 1 then we make the context the site context. If it is 0 then we make the context the context for the course indicated in the 'course' field.

      Change in How Categories Are Shared
      -----------------------------------------------------

      Previously you could share a category anywhere in your Course's question bank category hierarchy at the site level. Now we have decided that we'll have seperate hierarchies for categories at each context level. So we need code on db upgrade to check that all parent categories referred to in the question_categories 'parent' field are in the same context. If they are not then this category becomes a new top level category.

      So if a question category hierarchy in a course is as below :

      • Default
        o Science
        + Physics (shared)
      1. Momentum and Dynamics

      The Physics course will get moved to the site context since it is shared and the question category hierarchies will then be as follows :

      Course Level

      • Default
        o Science
        + Momentum and Dynamics

      Site Level

      • Physics

      If a childs parent is gone then it get's put in the grandparent category, if no grandparent, then grand grand parent etc. We'll search up the category hierarchy till we reach a category that is still in the same context level or we reach the top level and use that as a parent.

      When changing the tree, we'll preserve the existing ordering as defined by the sortorder fields.

        Attachments

          Activity

            People

            Assignee:
            jamiesensei Jamie Pratt
            Reporter:
            jamiesensei Jamie Pratt
            Tester:
            Nobody
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08