private TocModel CreateGuestTocModel(Course course, int slideIndex)
        {
            var visibleUnits = unitsRepo.GetVisibleUnits(course.Id, User);
            var builder      = new TocModelBuilder(
                s => Url.Action("Slide", "Course", new { courseId = course.Id, slideIndex = s.Index }),
                s => 0,
                course,
                slideIndex);

            builder.IsInstructor  = false;
            builder.IsVisited     = s => false;
            builder.IsUnitVisible = visibleUnits.Contains;
            var toc = builder.CreateTocModel();

            toc.NextUnitTime = unitsRepo.GetNextUnitPublishTime(course.Id);
            return(toc);
        }
        private TocModel CreateGuestTocModel(Course course, Guid?currentSlideId)
        {
            var visibleUnits = unitsRepo.GetVisibleUnits(course, User);
            var builder      = new TocModelBuilder(
                s => Url.RouteUrl("Course.SlideById", new { courseId = course.Id, slideId = s.Url }),
                s => 0,
                s => 0,
                (u, g) => 0,
                course,
                currentSlideId)
            {
                IsInstructor  = false,
                IsVisited     = s => false,
                IsUnitVisible = visibleUnits.Contains,
                IsSlideHidden = s => s is QuizSlide && ((QuizSlide)s).ManualChecking
            };
            var toc = builder.CreateTocModel();

            toc.NextUnitTime = unitsRepo.GetNextUnitPublishTime(course.Id);
            return(toc);
        }