Extend preview to support cohorted courseware

TNL-651.

Some code review has already been done on #6258. See that PR for sandbox information.
not part of your changes, but does it seem odd that we pass a boolean into this function that is used to determine whether or not it should do anything?  (why not just not call the function?)