Moodle
  1. Moodle
  2. MDL-21367

Make parent category visible if an item within it is made visible

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26554

      Description

      Currently a teacher can go to the "Categories and Items" page and hide a category containing assessment items. All of the items will be hidden which makes sense. The teacher can then manually make some of the items visible and the category remains invisible.

      This conflict of an invisible category containing a visible item leads to some strange behaviour. The invisible category means the item won't be displayed to students on the user report but it appears that the visible, yet not displayed, item is still included in aggregation calculations. To fix that the teacher needs to show the category which then automatically shows everything else in that category so they then have to go through and hide everything but the one item they originally marked visible. Plus it's just generally illogical to to have a visible item in an invisible category.

      When an item is made visible that should propagate up to its category.

        Activity

        Hide
        Andrew Davis added a comment -

        Here's a 1.9 patch that solves this for review.

        Show
        Andrew Davis added a comment - Here's a 1.9 patch that solves this for review.
        Hide
        Petr Škoda added a comment -

        I think this would create problems in several areas, instead in 2.0 we should create separate flag for hiding in grade_category,
        so my -5 for 1.9.x

        Show
        Petr Škoda added a comment - I think this would create problems in several areas, instead in 2.0 we should create separate flag for hiding in grade_category, so my -5 for 1.9.x
        Hide
        Andrew Davis added a comment -

        So we would have two hidden related flags. One indicating the item/category has been hidden/shown directly by the user. One indicating the item/category has been hidden/shown as a result of a parent being hidden or a child being shown. Two fields called something like hidden and indirectly hidden.

        That would be kind of cool actually. Within a category you could show some items and hide others then hide the category. Later when you show the category the items would "remember" whether or not they were hidden or not prior to the category being hidden.

        Can you explain more about problems this could cause as Im not sure what you mean?

        Show
        Andrew Davis added a comment - So we would have two hidden related flags. One indicating the item/category has been hidden/shown directly by the user. One indicating the item/category has been hidden/shown as a result of a parent being hidden or a child being shown. Two fields called something like hidden and indirectly hidden. That would be kind of cool actually. Within a category you could show some items and hide others then hide the category. Later when you show the category the items would "remember" whether or not they were hidden or not prior to the category being hidden. Can you explain more about problems this could cause as Im not sure what you mean?
        Hide
        Petr Škoda added a comment -

        In short any change in 1.9.8 that would be changed again 2.0 creates unnecessary problems and confusion for our users. Also some things might become suddenly visible which is something that is definitely not good for stable branch.

        Show
        Petr Škoda added a comment - In short any change in 1.9.8 that would be changed again 2.0 creates unnecessary problems and confusion for our users. Also some things might become suddenly visible which is something that is definitely not good for stable branch.
        Hide
        Andrew Davis added a comment - - edited

        good point. we should probably avoid subtle behaviour changes in 1.9.8 then again in 2. Ill bring this up with Martin as to what should be done.

        I'm proposing we leave this as is in 1.9 then implement it properly in moodle 2 with 2 hidden flags. 1 flag for directly being hidden and another indicating that the item has inherited being hidden. That way items can remember whether or not they were hidden or visible when their category is made visible.

        Show
        Andrew Davis added a comment - - edited good point. we should probably avoid subtle behaviour changes in 1.9.8 then again in 2. Ill bring this up with Martin as to what should be done. I'm proposing we leave this as is in 1.9 then implement it properly in moodle 2 with 2 hidden flags. 1 flag for directly being hidden and another indicating that the item has inherited being hidden. That way items can remember whether or not they were hidden or visible when their category is made visible.
        Hide
        Martin Dougiamas added a comment - - edited

        I can't see real problems in this. There won't be any unexpected changes in hiding because it only happens when the user manually unhides something. Calculations are always looking at the actual hidden flag on the items (and will always do so) so nothing will change there by itself.

        In 1.9.8 we should implement this so that the category grade_item (only) gets un-hidden whenever any other item in the category gets unhidden. This will also make the "eye" on the category open as well (as a side effect) only because it has to use the same flag.

        In 2.0 we should implement this so that the category grade_item AND the category itself get unhidden. This will behave exactly the same as 1.9.8. The difference to 1.9.8 will only be when someone chooses to then hide the category grade_item (total) - in this case the category itself will not be changed at all (which is much better), thanks to MDL-19704

        My +10 to go ahead.

        Show
        Martin Dougiamas added a comment - - edited I can't see real problems in this. There won't be any unexpected changes in hiding because it only happens when the user manually unhides something. Calculations are always looking at the actual hidden flag on the items (and will always do so) so nothing will change there by itself. In 1.9.8 we should implement this so that the category grade_item (only) gets un-hidden whenever any other item in the category gets unhidden. This will also make the "eye" on the category open as well (as a side effect) only because it has to use the same flag. In 2.0 we should implement this so that the category grade_item AND the category itself get unhidden. This will behave exactly the same as 1.9.8. The difference to 1.9.8 will only be when someone chooses to then hide the category grade_item (total) - in this case the category itself will not be changed at all (which is much better), thanks to MDL-19704 My +10 to go ahead.
        Hide
        Andrew Davis added a comment -

        Turns out the flag you were talking about Petr has already been added. In fact it was added by me. Im not sure what I was thinking. the second flag idea I was talking about is a bad idea.

        Show
        Andrew Davis added a comment - Turns out the flag you were talking about Petr has already been added. In fact it was added by me. Im not sure what I was thinking. the second flag idea I was talking about is a bad idea.
        Hide
        Andrew Davis added a comment -

        committed in 1.9 and trunk.

        Show
        Andrew Davis added a comment - committed in 1.9 and trunk.
        Hide
        Elena Ivanova added a comment -

        Sorry, I am a little confused with the logic here.
        So, I have a hidden category with hidden items, then I unhide one items and it will trigger the whole category to be unhidden too?
        Ops..
        What if I do not want my student to know about that category, or its name, or that I even put the items in some category?
        e.g. Compare visible courses in hidden categories scenario. If you allow that for an install, and then have a visible course in the hidden category, it will not show your category all of a sudden. Just the course.
        I, personally, would expect that students will also see just the unhidden grade, but not my category.

        Show
        Elena Ivanova added a comment - Sorry, I am a little confused with the logic here. So, I have a hidden category with hidden items, then I unhide one items and it will trigger the whole category to be unhidden too? Ops.. What if I do not want my student to know about that category, or its name, or that I even put the items in some category? e.g. Compare visible courses in hidden categories scenario. If you allow that for an install, and then have a visible course in the hidden category, it will not show your category all of a sudden. Just the course. I, personally, would expect that students will also see just the unhidden grade, but not my category.
        Hide
        Andrew Davis added a comment -

        With these changes if you have a hidden item in a hidden category and you unhide the item then the item and the category become visible. The other items in the category remain hidden.

        Previously what happened on the user report was that if you unhid an item, as its category was still hidden, it wouldnt be displayed at all but it would be included in calculations.

        "What if I do not want my student to know about that category, or its name, or that I even put the items in some category? "
        I'm not sure how to handle that. I dont think you were ever able to show grade items in hidden categories. We could add a setting similar to the "allow visible courses in hidden categories" setting you described.

        Show
        Andrew Davis added a comment - With these changes if you have a hidden item in a hidden category and you unhide the item then the item and the category become visible. The other items in the category remain hidden. Previously what happened on the user report was that if you unhid an item, as its category was still hidden, it wouldnt be displayed at all but it would be included in calculations. "What if I do not want my student to know about that category, or its name, or that I even put the items in some category? " I'm not sure how to handle that. I dont think you were ever able to show grade items in hidden categories. We could add a setting similar to the "allow visible courses in hidden categories" setting you described.
        Hide
        Elena Ivanova added a comment -

        Yep, I understand that the other items will remain invisible.
        My gap in logic lays the fact that child item influences the parent category.
        I would (myself, again) think that it obvious that if the parent is hidden, and I want to unhide the child, then I need to move the child out of the parent category. Not that the child would just go and overrule the parent settings.
        "I dont think you were ever able to show grade items in hidden categories." - correct. I am just thinking outloud about options

        Show
        Elena Ivanova added a comment - Yep, I understand that the other items will remain invisible. My gap in logic lays the fact that child item influences the parent category. I would (myself, again) think that it obvious that if the parent is hidden, and I want to unhide the child, then I need to move the child out of the parent category. Not that the child would just go and overrule the parent settings. "I dont think you were ever able to show grade items in hidden categories." - correct. I am just thinking outloud about options

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: