Moodle
  1. Moodle
  2. MDL-14478

Hidden courses in hidden categories are not visible to assigned teachers

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Teachers cannot see hidden courses in hidden categories in the course listings.

      To reproduce:

      1. Create a hidden category
      2. Create a hidden course
      3. Assign a teacher to the course
      4. Log in as the assigned teacher - the course does not appear on the front page course listing, the user's profile page, or the user's myMoodle page.

      Note that if the user does a search for the course, it will show up, and it is accessible. It looks like there was partial fix by MDL-13900. However, I think it is still a problem that the user must search for the hidden course in order to find it in the first place.

      Using 1.9 + (Build: 20080410). Also reproduced on demo.moodle.org, 1.9 + (Build: 20080414)

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Eloy Lafuente (stronk7) added a comment -

            Hi Ann,

            if I'm no wrong, the default behaviour is to HIDE courses below hidden categories (no matter if the course is hidden or no). By default, hidden categories prevent courses below it to be showed (but to admins, obviously). And that's what you are reporting here, if I'm not wrong.

            Anyway there are TWO possible solutions to change this default (and correct) behaviour:

            1) Enable "allowvisiblecoursesinhiddencategories" in Admin->FrontPage->Front Page settings. By having it enabled, you'll allow users (alll) to see visible courses below hidden categories. And editing-teaches will be also able to see invisible courses below hidden categories (because they have the 'course:viewhiddencourses' capability allowed at course level.

            2) Keep the "allowvisiblecoursesinhiddencategories" setting disabled but override the 'category:visibility' permission for the role you want to be able to see hidden categories and assign that role to the desired users at category level. That way, you'll have category-users able to see courses if the category is hidden.

            Alternative 1) is for all the categories in the site (and simpler) and alternative 2) allows fine-tuning by category, but implies assigning roles at category level (more complex and prone to errors).

            But current behaviour (hide ALL courses below hidden categories) is correct IMO.

            I guess Martin will read this and clarify everything... ciao

            PS: I've been paying with the all settings and capabilities above using different roles and everything seems to work consistently under 1.9.

            Show
            Eloy Lafuente (stronk7) added a comment - Hi Ann, if I'm no wrong, the default behaviour is to HIDE courses below hidden categories (no matter if the course is hidden or no). By default, hidden categories prevent courses below it to be showed (but to admins, obviously). And that's what you are reporting here, if I'm not wrong. Anyway there are TWO possible solutions to change this default (and correct) behaviour: 1) Enable "allowvisiblecoursesinhiddencategories" in Admin->FrontPage->Front Page settings. By having it enabled, you'll allow users (alll) to see visible courses below hidden categories. And editing-teaches will be also able to see invisible courses below hidden categories (because they have the 'course:viewhiddencourses' capability allowed at course level. 2) Keep the "allowvisiblecoursesinhiddencategories" setting disabled but override the 'category:visibility' permission for the role you want to be able to see hidden categories and assign that role to the desired users at category level. That way, you'll have category-users able to see courses if the category is hidden. Alternative 1) is for all the categories in the site (and simpler) and alternative 2) allows fine-tuning by category, but implies assigning roles at category level (more complex and prone to errors). But current behaviour (hide ALL courses below hidden categories) is correct IMO. I guess Martin will read this and clarify everything... ciao PS: I've been paying with the all settings and capabilities above using different roles and everything seems to work consistently under 1.9.
            Hide
            Daniel Schimrik added a comment -

            Hello Eloy,

            I think the current solution in Moodle is not really consistent. With the current weekly-moodle 1.9+ (Build: 20080423) you have the following situation:

            If you have a hidden category, inside a hidden course, and a teacher assigned to this course, the teacher:

            1. cannot see this course in mymoodle
            2. cannot see this course in the course list
            3. can search for this course
            4. can access this course (by searching or by id)

            This 4 things happen if you did not touch the default roles and you have "allowvisiblecoursesinhiddencategories" disabled (default).

            Me as teacher would prefer to see all courses (also in mymoodle, course list) I am a teacher in, regardless if the category is hidden.

            You wrote: "But current behaviour (hide ALL courses below hidden categories) is correct IMO. "
            If it should be that way, than these kind of courses should not be accessible nor be visible in any way.

            regards, Daniel

            Show
            Daniel Schimrik added a comment - Hello Eloy, I think the current solution in Moodle is not really consistent. With the current weekly-moodle 1.9+ (Build: 20080423) you have the following situation: If you have a hidden category, inside a hidden course, and a teacher assigned to this course, the teacher: 1. cannot see this course in mymoodle 2. cannot see this course in the course list 3. can search for this course 4. can access this course (by searching or by id) This 4 things happen if you did not touch the default roles and you have "allowvisiblecoursesinhiddencategories" disabled (default). Me as teacher would prefer to see all courses (also in mymoodle, course list) I am a teacher in, regardless if the category is hidden. You wrote: "But current behaviour (hide ALL courses below hidden categories) is correct IMO. " If it should be that way, than these kind of courses should not be accessible nor be visible in any way. regards, Daniel
            Hide
            Ann Adamcik added a comment -

            Yes, there is definitely an inconsistency as Daniel noted. If course teachers have access to hidden courses, they should also be able to see those courses in their course listings. If it is decided that teachers really shouldn't see hidden courses in hidden categories, then they probably shouldn't be able to search for and access those courses.

            We are using hidden categories to hide all the courses in a term from students after the term is over. We do want the instructors assigned to the courses to continue to have access. In 1.8.x, it works as expected. In 1.9, we'd have to go through and hide each course in the category. (About 5000+ courses each term!)

            Show
            Ann Adamcik added a comment - Yes, there is definitely an inconsistency as Daniel noted. If course teachers have access to hidden courses, they should also be able to see those courses in their course listings. If it is decided that teachers really shouldn't see hidden courses in hidden categories, then they probably shouldn't be able to search for and access those courses. We are using hidden categories to hide all the courses in a term from students after the term is over. We do want the instructors assigned to the courses to continue to have access. In 1.8.x, it works as expected. In 1.9, we'd have to go through and hide each course in the category. (About 5000+ courses each term!)
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Hi Daniel,

            then... inconsistency is in 3 & 4 above correct? i.e. search and access to course need to be prevented (fixed), yup? If so, could we treat them as separated bugs (linked to this as related) ?

            and Ann,

            you can use old approach in all your site by simply enabling the "allowvisiblecoursesinhiddencategories" setting in Front Page settings. That will allow teachers to access those hidden courses under hidden categories

            Or alternatively, you can assign the 'category:visibility' permission to your teachers in the invisible category context to achieve same result but per category (instead of globally).

            BTW why do you say that you need to mark all them as hidden manually? Such mark is added to courses automatically when you hide the category... or am I losing anything?

            Comments will be welcome.

            Show
            Eloy Lafuente (stronk7) added a comment - Hi Daniel, then... inconsistency is in 3 & 4 above correct? i.e. search and access to course need to be prevented (fixed), yup? If so, could we treat them as separated bugs (linked to this as related) ? and Ann, you can use old approach in all your site by simply enabling the "allowvisiblecoursesinhiddencategories" setting in Front Page settings. That will allow teachers to access those hidden courses under hidden categories Or alternatively, you can assign the 'category:visibility' permission to your teachers in the invisible category context to achieve same result but per category (instead of globally). BTW why do you say that you need to mark all them as hidden manually? Such mark is added to courses automatically when you hide the category... or am I losing anything? Comments will be welcome.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Raising this to Major. Need to confirm that this in the intended behaviour. Ping!

            Show
            Eloy Lafuente (stronk7) added a comment - Raising this to Major. Need to confirm that this in the intended behaviour. Ping!
            Hide
            Daniel Schimrik added a comment -

            Hello Eloy,

            yes, inconsistency is in 3 & 4. Such courses should not be visible by searching and not be accessible. To make 2 different bugs from that seems to be a good idea.

            I also checked your proposal with "allowvisiblecoursesinhiddencategories". In mymoodle the hidden courses in hidden categories do appear. There is only a little problem:
            I cannot see hidden courses in hidden categories under the course list (http://mydomain/course/index.php).

            regards, Daniel

            Show
            Daniel Schimrik added a comment - Hello Eloy, yes, inconsistency is in 3 & 4. Such courses should not be visible by searching and not be accessible. To make 2 different bugs from that seems to be a good idea. I also checked your proposal with "allowvisiblecoursesinhiddencategories". In mymoodle the hidden courses in hidden categories do appear. There is only a little problem: I cannot see hidden courses in hidden categories under the course list ( http://mydomain/course/index.php ). regards, Daniel
            Hide
            Ann Adamcik added a comment -

            There is already a separate bug linked to this. See MDL-13900. It looks like it was decided there that the behavior should be the same as in 1.8 - i.e. that hidden courses in hidden categories should be accessible to those those with moodle/course:viewhiddencourses capability in the course context. My assertion here is is that if that decision was the correct one, then those courses should also show up in the user's course listing.

            Show
            Ann Adamcik added a comment - There is already a separate bug linked to this. See MDL-13900 . It looks like it was decided there that the behavior should be the same as in 1.8 - i.e. that hidden courses in hidden categories should be accessible to those those with moodle/course:viewhiddencourses capability in the course context. My assertion here is is that if that decision was the correct one, then those courses should also show up in the user's course listing.
            Hide
            Ann Adamcik added a comment -

            I've done some more testing on this one.

            Current behavior:

            1. allowvisiblecoursesinhiddencategories = off or on
            category = hidden
            course = hidden

            a. course creator (category context)
            does not see the category or the course on front page course listing
            can search for and find the course

            b. teacher (course context)
            does not see the category or the course on front page course listings
            course is not listed on user's profile page
            does see the course in the my moodle page if allowvisiblecoursesinhiddencategories is on, otherwise does not
            can search for the course and view it from the search results page

            c. student (course context)
            does not see the category or the course on the front page - ok
            course not listed on user's profile page - ok
            does not see the course on the my moodle page - ok
            cannot find the course when searching for it - ok

            Things should be consistent here - users should either see the course if they have the viewhiddencourse capability, or they shouldn't be able to search for and view the course at all.

            2. allowvisiblecoursesinhiddencategories = on
            category = hidden
            course = visible

            a. course creator (category context)
            does not see the category or the course on front page course listing - ** user should see the course **
            can search for and find the course - ok

            b. teacher (course context)
            does not see the category or course on front page course listings - ** user should see the course **
            course not listed on user's profile page - ** should be listed **
            does see the course on the my moodle page - ok
            can search for the course and view it from the search results page - ok

            c. student (course context)
            does not see the category or course on front page course listings - ** user should see the course **
            course not listed on user's profile page - ** should be listed **
            does see the course on the my moodle page - ok
            can search for the course and view it from the search results page - ok

            d. A user who is not logged in does see the course on the front page - ok.

            This case is definitely not behaving as it should. With allowvisiblecoursesinhiddencategories set to on, and the course visible, all users should be seeing it on the front page.

            3. allowvisiblecoursesinhiddencategories = off or on
            category = visible
            course = visible

            works correctly

            4. allowvisiblecoursesinhiddencategories = off or on
            category = visible
            course = hidden

            works correctly.

            Clearly case #2 is buggy, and case #1 is inconsistent.

            Currently, the only way we can hide a block of courses from students, while allowing teachers to see the courses on the front page, is to leave the category visible and hide each course individually. If we hide the whole category (thus hiding all the courses under it), teachers will no longer see their courses on the front page. Giving all teachers a role in the category context isn't a viable solution - the viewhiddencourses capability in the course context should be enough to allow the user to see the course.

            Show
            Ann Adamcik added a comment - I've done some more testing on this one. Current behavior: 1. allowvisiblecoursesinhiddencategories = off or on category = hidden course = hidden a. course creator (category context) does not see the category or the course on front page course listing can search for and find the course b. teacher (course context) does not see the category or the course on front page course listings course is not listed on user's profile page does see the course in the my moodle page if allowvisiblecoursesinhiddencategories is on, otherwise does not can search for the course and view it from the search results page c. student (course context) does not see the category or the course on the front page - ok course not listed on user's profile page - ok does not see the course on the my moodle page - ok cannot find the course when searching for it - ok Things should be consistent here - users should either see the course if they have the viewhiddencourse capability, or they shouldn't be able to search for and view the course at all. 2. allowvisiblecoursesinhiddencategories = on category = hidden course = visible a. course creator (category context) does not see the category or the course on front page course listing - ** user should see the course ** can search for and find the course - ok b. teacher (course context) does not see the category or course on front page course listings - ** user should see the course ** course not listed on user's profile page - ** should be listed ** does see the course on the my moodle page - ok can search for the course and view it from the search results page - ok c. student (course context) does not see the category or course on front page course listings - ** user should see the course ** course not listed on user's profile page - ** should be listed ** does see the course on the my moodle page - ok can search for the course and view it from the search results page - ok d. A user who is not logged in does see the course on the front page - ok. This case is definitely not behaving as it should. With allowvisiblecoursesinhiddencategories set to on, and the course visible, all users should be seeing it on the front page. 3. allowvisiblecoursesinhiddencategories = off or on category = visible course = visible works correctly 4. allowvisiblecoursesinhiddencategories = off or on category = visible course = hidden works correctly. Clearly case #2 is buggy, and case #1 is inconsistent. Currently, the only way we can hide a block of courses from students, while allowing teachers to see the courses on the front page, is to leave the category visible and hide each course individually. If we hide the whole category (thus hiding all the courses under it), teachers will no longer see their courses on the front page. Giving all teachers a role in the category context isn't a viable solution - the viewhiddencourses capability in the course context should be enough to allow the user to see the course.
            Hide
            Brett Hinton added a comment -

            This is still an issue in 1.9.4+. Basically no matter if allow visible courses in hidden categories is enabled or not:

            Teachers assigned to hidden courses that are in hidden categories, should be able to see those hidden courses on their profile page and in the course listings page (on the front page, etc).

            Currently the above statement is not the case.

            My understanding from discussion on this issue previously that the behavior in moving forward needed to be consistent with what was happening in 1.8 and my above statement is what was previously happening.

            Just a little bump and my 2 cents for a resolution to this issue since it is hit me with two different clients in recent months and I didn't have a resolution to offer them.

            Show
            Brett Hinton added a comment - This is still an issue in 1.9.4+. Basically no matter if allow visible courses in hidden categories is enabled or not: Teachers assigned to hidden courses that are in hidden categories, should be able to see those hidden courses on their profile page and in the course listings page (on the front page, etc). Currently the above statement is not the case. My understanding from discussion on this issue previously that the behavior in moving forward needed to be consistent with what was happening in 1.8 and my above statement is what was previously happening. Just a little bump and my 2 cents for a resolution to this issue since it is hit me with two different clients in recent months and I didn't have a resolution to offer them.
            Hide
            Michael Blake added a comment -

            Martin, can you make a call on this one? Jonathan from Remote Learner is reporting it's become a problem for their staff.

            Show
            Michael Blake added a comment - Martin, can you make a call on this one? Jonathan from Remote Learner is reporting it's become a problem for their staff.
            Hide
            M Granger added a comment -

            We have a few schools that hide the staff category to ensure pupils cannot get to staff courses. Currently the staff cannot access courses which is causing problems.

            Show
            M Granger added a comment - We have a few schools that hide the staff category to ensure pupils cannot get to staff courses. Currently the staff cannot access courses which is causing problems.
            Hide
            Matthew Koelling added a comment -

            Hi. We at Humboldt State are having the same bug. Regardless of the permissions the course is still invisible to the instructor as documented in the description.

            Show
            Matthew Koelling added a comment - Hi. We at Humboldt State are having the same bug. Regardless of the permissions the course is still invisible to the instructor as documented in the description.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            U P S T R E A M I Z E D !

            Many thanks, this is now available in all the repos (git & cvs).

            Closing, ciao

            Show
            Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Many thanks, this is now available in all the repos (git & cvs). Closing, ciao
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Doh,

            somehow this issue was closed incorrectly when processing all the integrated issues this week. (sort of most voted and current in integration filters mix). Apologies for the confusion, reseting to previous status!

            Ciao, Eloy

            Show
            Eloy Lafuente (stronk7) added a comment - Doh, somehow this issue was closed incorrectly when processing all the integrated issues this week. (sort of most voted and current in integration filters mix). Apologies for the confusion, reseting to previous status! Ciao, Eloy
            Hide
            Marina Glancy added a comment -

            I believe it is not an issue any more on currently supported Moodle versions. I will leave the issue open for some time and will close it later if there are no objections

            Show
            Marina Glancy added a comment - I believe it is not an issue any more on currently supported Moodle versions. I will leave the issue open for some time and will close it later if there are no objections
            Hide
            Marina Glancy added a comment -

            I'm closing this issue because I believe it affects only unsupported versions of Moodle. This issue will remain here in case other users have the same problem.

            Show
            Marina Glancy added a comment - I'm closing this issue because I believe it affects only unsupported versions of Moodle. This issue will remain here in case other users have the same problem.

              People

              • Votes:
                30 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: