Thanks for the further help. It appears to me that I was probably being blocked from observing the correct behavior with this component due to experiencing a completely different error while I was testing it. I reverted back to an earlier custom edx-platform repository, and re-applied the cohort-selector-xblock install instructions, and I started seeing theoretically-correct / closer-to-what I expect behavior. But I want to confirm with you if what I’m seeing is what’s expected…
As the instructor, I set the test student to the DefaultCohort (which is not associated with any content groups)
I then set the first section for content group / cohort selection to accessible to all content groups
(When I’m assigning the student to DefaultCohort by default, the first section needs to be unrestricted otherwise they can’t see it to select it.) And I don’t see any errors in the console window,
and I do see the “access to this unit is restricted” messages.
When the student logs in, they see all the sections. Is that expected? I would have thought the subsection would be hidden if all units were hidden (and I thought I had seen someone mention that before on this forum, but I can’t find it. But even if this isn’t the official behavior, is it what you see?)
If they click into any of the “Subsection for ContentGroup1/2/3” sections before they select a cohort, they see “There is no content here” (which is what I would expect.)
When the student goes to select their cohort, there is a cached entry there apparently from my prior tests, even though I manually re-assigned the student to the DefaultCohort. This is a minor thing, but again I’m just curious if this is expected.
If I select Cohort3, then I do see the correct message about movement from the cohort I had manually assigned them to (DefaultCohort) to the one they chose (Cohort3).
After that, if they hit the “next” button, they will go through the Subsections for Cohort1 and 2, which correctly continue to display “no content” (though I would prefer they didn’t show up at all. But this is perhaps back to the previous issue with the Subsections continuing to be visible even when they have no visible content.)
And finally when they hit next to get to Cohort3 content, they correctly see the Cohort3 content.
So maybe everything is working at this point? And maybe it’s only my expectations that are incorrect about
a) Subsections disappearing when no visible units are within?
b) The cohort selection pulldown not caching old selections for re-display?