Ejemplo n.º 1
0
        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.GetLowestPublishTimeOfUnpublishedUnit(course.Id);
            return(toc);
        }