Пример #1
0
 public StyleErrorsResultObserver(IWebCourseManager courseManager, MetricSender metricSender,
                                  IUsersRepo usersRepo, ISlideCheckingsRepo slideCheckingsRepo)
 {
     this.courseManager      = courseManager;
     this.metricSender       = metricSender;
     this.slideCheckingsRepo = slideCheckingsRepo;
     this.usersRepo          = usersRepo;
 }
Пример #2
0
 public SlideRenderer(IUlearnVideoAnnotationsClient videoAnnotationsClient,
                      IUserSolutionsRepo solutionsRepo, ISlideCheckingsRepo slideCheckingsRepo, ICourseRolesRepo courseRolesRepo)
 {
     this.videoAnnotationsClient = videoAnnotationsClient;
     this.solutionsRepo          = solutionsRepo;
     this.slideCheckingsRepo     = slideCheckingsRepo;
     this.courseRolesRepo        = courseRolesRepo;
 }
Пример #3
0
 public ReviewCommentsController(IWebCourseManager courseManager, UlearnDb db, IUsersRepo usersRepo,
                                 ISlideCheckingsRepo slideCheckingsRepo, ICourseRolesRepo courseRolesRepo, IUnitsRepo unitsRepo, INotificationsRepo notificationsRepo)
     : base(courseManager, db, usersRepo)
 {
     this.slideCheckingsRepo = slideCheckingsRepo;
     this.courseRolesRepo    = courseRolesRepo;
     this.unitsRepo          = unitsRepo;
     this.notificationsRepo  = notificationsRepo;
     this.notificationsRepo  = notificationsRepo;
 }
Пример #4
0
 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 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;
 }
Пример #6
0
 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;
 }
Пример #7
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;
 }
Пример #8
0
 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;
 }
Пример #9
0
 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;
 }
Пример #10
0
 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;
 }
Пример #11
0
 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;
 }
Пример #12
0
        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);
        }
Пример #13
0
 public VisitsRepo(UlearnDb db, ISlideCheckingsRepo slideCheckingsRepo)
 {
     this.db = db;
     this.slideCheckingsRepo = slideCheckingsRepo;
 }