Exemple #1
0
 public UserProgressController(ILogger logger, IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo,
                               IVisitsRepo visitsRepo, IUserQuizzesRepo userQuizzesRepo)
     : base(logger, courseManager, db, usersRepo)
 {
     this.visitsRepo      = visitsRepo;
     this.userQuizzesRepo = userQuizzesRepo;
 }
Exemple #2
0
 public SlidesController(ILogger logger, IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo,
                         IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo)
     : base(logger, courseManager, db, usersRepo)
 {
     CourseRolesRepo = courseRolesRepo;
     SolutionsRepo   = solutionsRepo;
     UserQuizzesRepo = userQuizzesRepo;
     VisitsRepo      = visitsRepo;
     GroupsRepo      = groupsRepo;
 }
 public ManualCheckingsForOldSolutionsAdder(
     IUserSolutionsRepo userSolutionsRepo, ISlideCheckingsRepo slideCheckingsRepo, IVisitsRepo visitsRepo, IUserQuizzesRepo userQuizzesRepo,
     IWebCourseManager courseManager)
 {
     this.userSolutionsRepo  = userSolutionsRepo;
     this.slideCheckingsRepo = slideCheckingsRepo;
     this.visitsRepo         = visitsRepo;
     this.userQuizzesRepo    = userQuizzesRepo;
     this.courseManager      = courseManager;
 }
 public ExerciseStatisticsController(ILogger logger, WebCourseManager courseManager, IUserSolutionsRepo userSolutionsRepo, UlearnDb db, IUsersRepo usersRepo,
                                     IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo)
     : base(logger, courseManager, db, usersRepo)
 {
     this.userSolutionsRepo = userSolutionsRepo;
     this.solutionsRepo     = solutionsRepo;
     this.userQuizzesRepo   = userQuizzesRepo;
     this.visitsRepo        = visitsRepo;
     this.groupsRepo        = groupsRepo;
 }
Exemple #5
0
 public ExportController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo,
                         IGroupMembersRepo groupMembersRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo, IUserQuizzesRepo userQuizzesRepo,
                         ICourseRolesRepo courseRolesRepo)
     : base(courseManager, db, usersRepo)
 {
     this.groupMembersRepo = groupMembersRepo;
     this.visitsRepo       = visitsRepo;
     this.groupsRepo       = groupsRepo;
     this.userQuizzesRepo  = userQuizzesRepo;
     this.courseRolesRepo  = courseRolesRepo;
 }
Exemple #6
0
 public SlidesController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo,
                         IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo,
                         SlideRenderer slideRenderer, ICoursesRepo coursesRepo)
     : base(courseManager, db, usersRepo)
 {
     this.coursesRepo     = coursesRepo;
     this.courseRolesRepo = courseRolesRepo;
     this.solutionsRepo   = solutionsRepo;
     this.userQuizzesRepo = userQuizzesRepo;
     this.visitsRepo      = visitsRepo;
     this.groupsRepo      = groupsRepo;
     this.slideRenderer   = slideRenderer;
 }
Exemple #7
0
 public CoursesController(ILogger logger, IWebCourseManager courseManager, UlearnDb db, ICoursesRepo coursesRepo,
                          IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IUnitsRepo unitsRepo, IUserSolutionsRepo solutionsRepo,
                          IUserQuizzesRepo userQuizzesRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo)
     : base(logger, courseManager, db, usersRepo)
 {
     this.coursesRepo     = coursesRepo;
     this.courseRolesRepo = courseRolesRepo;
     this.unitsRepo       = unitsRepo;
     this.solutionsRepo   = solutionsRepo;
     this.userQuizzesRepo = userQuizzesRepo;
     this.visitsRepo      = visitsRepo;
     this.groupsRepo      = groupsRepo;
 }
Exemple #8
0
 public UserProgressController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo,
                               IVisitsRepo visitsRepo, IUserQuizzesRepo userQuizzesRepo, IAdditionalScoresRepo additionalScoresRepo,
                               ICourseRolesRepo courseRolesRepo, IGroupAccessesRepo groupAccessesRepo, IGroupMembersRepo groupMembersRepo,
                               ISlideCheckingsRepo slideCheckingsRepo)
     : base(courseManager, db, usersRepo)
 {
     this.visitsRepo           = visitsRepo;
     this.userQuizzesRepo      = userQuizzesRepo;
     this.additionalScoresRepo = additionalScoresRepo;
     this.courseRolesRepo      = courseRolesRepo;
     this.groupAccessesRepo    = groupAccessesRepo;
     this.groupMembersRepo     = groupMembersRepo;
     this.slideCheckingsRepo   = slideCheckingsRepo;
 }
Exemple #9
0
        public static async Task <HashSet <Guid> > GetSolvedSlides(IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, Course course, string userId)
        {
            var solvedSlides = await solutionsRepo.GetIdOfPassedSlides(course.Id, userId);

            solvedSlides.UnionWith(await userQuizzesRepo.GetPassedSlideIdsAsync(course.Id, userId));
            return(solvedSlides);
        }
Exemple #10
0
        public static async Task <Func <Slide, int> > BuildGetSlideMaxScoreFunc(IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, IVisitsRepo visitsRepo, IGroupsRepo groupsRepo,
                                                                                Course course, string userId)
        {
            if (userId == null)
            {
                return(GetMaxScoreForGuest);
            }
            var solvedSlidesIds = await GetSolvedSlides(solutionsRepo, userQuizzesRepo, course, userId);

            var slidesWithUsersManualChecking = (await visitsRepo.GetSlidesWithUsersManualChecking(course.Id, userId)).ToImmutableHashSet();
            var enabledManualCheckingForUser  = await groupsRepo.IsManualCheckingEnabledForUserAsync(course, userId).ConfigureAwait(false);

            return(s => GetMaxScoreForUsersSlide(s, solvedSlidesIds.Contains(s.Id), slidesWithUsersManualChecking.Contains(s.Id), enabledManualCheckingForUser));
        }
Exemple #11
0
        public static HashSet <Guid> GetSolvedSlides(IUserSolutionsRepo solutionsRepo, IUserQuizzesRepo userQuizzesRepo, Course course, string userId)
        {
            var solvedSlides = solutionsRepo.GetIdOfPassedSlides(course.Id, userId);

            solvedSlides.UnionWith(userQuizzesRepo.GetPassedSlideIds(course.Id, userId));
            return(solvedSlides);
        }