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.
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.