public GroupMembersRepo(UlearnDb db, IManualCheckingsForOldSolutionsAdder manualCheckingsForOldSolutionsAdder, IGroupsRepo groupsRepo, ILogger logger) { this.db = db; this.manualCheckingsForOldSolutionsAdder = manualCheckingsForOldSolutionsAdder; this.groupsRepo = groupsRepo; this.logger = logger; }
public void SetUp() { SetupTestInfrastructureAsync(services => services.AddScoped <GroupsController>()).GetAwaiter().GetResult(); groupsController = GetController <GroupsController>(); groupsRepo = serviceProvider.GetService <IGroupsRepo>(); }
public JoinGroupController(ILogger logger, WebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo, IGroupsRepo groupsRepo, IGroupMembersRepo groupMembersRepo) : base(logger, courseManager, db, usersRepo) { this.groupsRepo = groupsRepo; this.groupMembersRepo = groupMembersRepo; }
public GroupsController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo, IGroupsRepo groupsRepo, IGroupAccessesRepo groupAccessesRepo, IGroupMembersRepo groupMembersRepo) : base(courseManager, db, usersRepo) { this.groupsRepo = groupsRepo; this.groupAccessesRepo = groupAccessesRepo; this.groupMembersRepo = groupMembersRepo; }
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 JoinGroupController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo, IGroupsRepo groupsRepo, IGroupMembersRepo groupMembersRepo, ISlideCheckingsRepo slideCheckingsRepo) : base(courseManager, db, usersRepo) { this.groupsRepo = groupsRepo; this.groupMembersRepo = groupMembersRepo; this.slideCheckingsRepo = slideCheckingsRepo; }
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; }
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; }
public GroupController(ILogger logger, WebCourseManager courseManager, UlearnDb db, IGroupsRepo groupsRepo, IGroupAccessesRepo groupAccessesRepo, IGroupMembersRepo groupMembersRepo, IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, INotificationsRepo notificationsRepo, IGroupsCreatorAndCopier groupsCreatorAndCopier) : base(logger, courseManager, db, usersRepo) { this.groupsRepo = groupsRepo; this.groupAccessesRepo = groupAccessesRepo; this.groupMembersRepo = groupMembersRepo; this.courseRolesRepo = courseRolesRepo; this.notificationsRepo = notificationsRepo; this.groupsCreatorAndCopier = groupsCreatorAndCopier; }
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; }
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; }
public GroupController(IWebCourseManager courseManager, UlearnDb db, IGroupsRepo groupsRepo, IGroupAccessesRepo groupAccessesRepo, IGroupMembersRepo groupMembersRepo, IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, INotificationsRepo notificationsRepo, IGroupsCreatorAndCopier groupsCreatorAndCopier, IUnitsRepo unitsRepo, ISlideCheckingsRepo slideCheckingsRepo) : base(courseManager, db, usersRepo) { this.groupsRepo = groupsRepo; this.groupAccessesRepo = groupAccessesRepo; this.groupMembersRepo = groupMembersRepo; this.courseRolesRepo = courseRolesRepo; this.notificationsRepo = notificationsRepo; this.groupsCreatorAndCopier = groupsCreatorAndCopier; this.unitsRepo = unitsRepo; this.slideCheckingsRepo = slideCheckingsRepo; }
public CodeReviewStatisticsController(IWebCourseManager courseManager, ISlideCheckingsRepo slideCheckingsRepo, IUsersRepo usersRepo, IGroupsRepo groupsRepo, IGroupMembersRepo groupMembersRepo, ICourseRolesRepo courseRolesRepo, UlearnDb db) : base(courseManager, db, usersRepo) { this.slideCheckingsRepo = slideCheckingsRepo; this.groupsRepo = groupsRepo; this.groupMembersRepo = groupMembersRepo; this.courseRolesRepo = courseRolesRepo; }
public ExerciseController(IWebCourseManager courseManager, UlearnDb db, MetricSender metricSender, IUsersRepo usersRepo, IUserSolutionsRepo userSolutionsRepo, ICourseRolesRepo courseRolesRepo, IVisitsRepo visitsRepo, ISlideCheckingsRepo slideCheckingsRepo, IGroupsRepo groupsRepo, StyleErrorsResultObserver styleErrorsResultObserver, IStyleErrorsRepo styleErrorsRepo, IServiceScopeFactory serviceScopeFactory) : base(courseManager, db, usersRepo) { this.metricSender = metricSender; this.userSolutionsRepo = userSolutionsRepo; this.courseRolesRepo = courseRolesRepo; this.visitsRepo = visitsRepo; this.slideCheckingsRepo = slideCheckingsRepo; this.groupsRepo = groupsRepo; this.styleErrorsRepo = styleErrorsRepo; this.styleErrorsResultObserver = styleErrorsResultObserver; this.serviceScopeFactory = serviceScopeFactory; }
public ExerciseController(IWebCourseManager courseManager, UlearnDb db, MetricSender metricSender, IUsersRepo usersRepo, IUserSolutionsRepo userSolutionsRepo, ICourseRolesRepo courseRolesRepo, IVisitsRepo visitsRepo, ILtiConsumersRepo ltiConsumersRepo, ILtiRequestsRepo ltiRequestsRepo, ISlideCheckingsRepo slideCheckingsRepo, IGroupsRepo groupsRepo, IStyleErrorsRepo styleErrorsRepo) : base(courseManager, db, usersRepo) { this.metricSender = metricSender; this.userSolutionsRepo = userSolutionsRepo; this.courseRolesRepo = courseRolesRepo; this.visitsRepo = visitsRepo; this.ltiConsumersRepo = ltiConsumersRepo; this.ltiRequestsRepo = ltiRequestsRepo; this.slideCheckingsRepo = slideCheckingsRepo; this.groupsRepo = groupsRepo; this.styleErrorsRepo = styleErrorsRepo; }
public GroupAccessesRepo( UlearnDb db, IGroupsRepo groupsRepo, ISystemAccessesRepo systemAccessesRepo, ICoursesRepo coursesRepo, IGroupMembersRepo groupMembersRepo, IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IWebCourseManager courseManager ) { this.db = db; this.groupsRepo = groupsRepo; this.systemAccessesRepo = systemAccessesRepo; this.coursesRepo = coursesRepo; this.groupMembersRepo = groupMembersRepo; this.courseRolesRepo = courseRolesRepo; this.usersRepo = usersRepo; this.courseManager = courseManager; }
public RunnerController(IWebCourseManager courseManager, UlearnDb db, IOptions <WebApiConfiguration> options, IUsersRepo usersRepo, IUserSolutionsRepo userSolutionsRepo, ISlideCheckingsRepo slideCheckingsRepo, IGroupsRepo groupsRepo, IVisitsRepo visitsRepo, MetricSender metricSender, XQueueResultObserver xQueueResultObserver, SandboxErrorsResultObserver sandboxErrorsResultObserver, AntiPlagiarismResultObserver antiPlagiarismResultObserver, StyleErrorsResultObserver styleErrorsResultObserver) : base(courseManager, db, usersRepo) { configuration = options.Value; resultObservers = new List <IResultObserver> { xQueueResultObserver, sandboxErrorsResultObserver, antiPlagiarismResultObserver, styleErrorsResultObserver, }; this.userSolutionsRepo = userSolutionsRepo; this.slideCheckingsRepo = slideCheckingsRepo; this.groupsRepo = groupsRepo; this.visitsRepo = visitsRepo; this.metricSender = metricSender; }
public GroupsController(IGroupsRepo repository, IMapper mapper) { _repository = repository; _mapper = mapper; }
public static async Task <bool> SendToReviewAndUpdateScore(UserExerciseSubmission submissionNoTracking, IWebCourseManager courseManager, ISlideCheckingsRepo slideCheckingsRepo, IGroupsRepo groupsRepo, IVisitsRepo visitsRepo, MetricSender metricSender) { var userId = submissionNoTracking.UserId; var courseId = submissionNoTracking.CourseId; var course = await courseManager.GetCourseAsync(courseId); var exerciseSlide = course.FindSlideById(submissionNoTracking.SlideId, true) as ExerciseSlide; // SlideId проверен в вызывающем методе if (exerciseSlide == null) { return(false); } var exerciseMetricId = GetExerciseMetricId(courseId, exerciseSlide); var automaticCheckingNoTracking = submissionNoTracking.AutomaticChecking; var isProhibitedUserToSendForReview = await slideCheckingsRepo.IsProhibitedToSendExerciseToManualChecking(courseId, exerciseSlide.Id, userId); var sendToReview = exerciseSlide.Scoring.RequireReview && submissionNoTracking.AutomaticCheckingIsRightAnswer && !isProhibitedUserToSendForReview && await groupsRepo.IsManualCheckingEnabledForUserAsync(course, userId); if (sendToReview) { await slideCheckingsRepo.RemoveWaitingManualCheckings <ManualExerciseChecking>(courseId, exerciseSlide.Id, userId, false); await slideCheckingsRepo.AddManualExerciseChecking(courseId, exerciseSlide.Id, userId, submissionNoTracking.Id); await visitsRepo.MarkVisitsAsWithManualChecking(courseId, exerciseSlide.Id, userId); metricSender.SendCount($"exercise.{exerciseMetricId}.sent_to_review"); metricSender.SendCount("exercise.sent_to_review"); } await visitsRepo.UpdateScoreForVisit(courseId, exerciseSlide, userId); if (automaticCheckingNoTracking != null) { var verdictForMetric = automaticCheckingNoTracking.GetVerdict().Replace(" ", ""); metricSender.SendCount($"exercise.{exerciseMetricId}.{verdictForMetric}"); } return(sendToReview); }
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)); }