Example #1
0
 public RateLimiter(IAttemptRepository repository, ILinkedValueChecker linkedValueChecker,
                    IOptions <RateLimitConfiguration> configuration)
 {
     _repository         = repository;
     _linkedValueChecker = linkedValueChecker;
     _configuration      = configuration;
 }
Example #2
0
 public RatingUpdater(IUserRepository _userRepository, IPuzzleRepository _puzzleRepository, IRatingRepository _ratingRepository, IAttemptRepository _attemptRepository)
 {
     userRepository    = _userRepository;
     puzzleRepository  = _puzzleRepository;
     ratingRepository  = _ratingRepository;
     attemptRepository = _attemptRepository;
 }
 public AttemptController(IAttemptRepository attemptRepository, IAttemptDeviceRepository attemptDeviceRepository,
                          IDeviceRepository deviceRepository)
 {
     _attemptRepository       = attemptRepository;
     _attemptDeviceRepository = attemptDeviceRepository;
     _deviceRepository        = deviceRepository;
 }
Example #4
0
 public QuestionController(IFilteredLatestQuestionsFetcher filteredLatestQuestionsFetcher, IStackExchangeClient stackExchangeClient, IAttemptRepository attemptRepository, IMapper mapper)
 {
     _filteredLatestQuestionsFetcher = filteredLatestQuestionsFetcher;
     _stackExchangeClient            = stackExchangeClient;
     _attemptRepository = attemptRepository;
     _mapper            = mapper;
 }
Example #5
0
 public UserController(IUserRepository _userRepository,
                       IRatingRepository _ratingRepository,
                       IValidator _validator,
                       IPasswordHasher _passwordHasher,
                       ICounterRepository _counterRepository,
                       IPersistentLoginHandler _loginHandler,
                       ITimedTrainingScoreRepository _timedTrainingScoreRepository,
                       IUserVerifier _userVerifier,
                       IEmailSender _emailSender,
                       IGameRepository _gameRepository,
                       IAttemptRepository _attemptRepository,
                       IOptions <Settings> settings)
     : base(_userRepository, _loginHandler)
 {
     userRepository               = _userRepository;
     ratingRepository             = _ratingRepository;
     validator                    = _validator;
     passwordHasher               = _passwordHasher;
     counterRepository            = _counterRepository;
     loginHandler                 = _loginHandler;
     timedTrainingScoreRepository = _timedTrainingScoreRepository;
     userVerifier                 = _userVerifier;
     emailSender                  = _emailSender;
     gameRepository               = _gameRepository;
     attemptRepository            = _attemptRepository;
     recaptchaKey                 = settings.Value.RecaptchaKey;
     requireEmailVerification     = settings.Value.Email.RequireEmailVerification;
 }
 public TestService(ITestRepository testRepository, IRoomRepository roomRespository, IAttemptRepository attemptRepository, IWorkContext workContext)
 {
     _testRepository    = testRepository;
     _roomRepository    = roomRespository;
     _attemptRepository = attemptRepository;
     _workContext       = workContext;
 }
 public PreviouslyAttemptedQuestionFetcher(IAttemptRepository attemptRepository, IStackExchangeClient stackExchangeClient, IAttemptedQuestionDtoAssembler attemptedQuestionDtoAssembler, IMapper mapper)
 {
     _attemptRepository             = attemptRepository;
     _stackExchangeClient           = stackExchangeClient;
     _attemptedQuestionDtoAssembler = attemptedQuestionDtoAssembler;
     _mapper = mapper;
 }
Example #8
0
 public HintController(IAttemptRepository repository, IHubContext <HintsHub> hintsHub,
                       IHintRepository hintRepository)
 {
     _repository     = repository;
     _hintsHub       = hintsHub;
     _hintRepository = hintRepository;
 }
Example #9
0
 public DeviceController(IDeviceRepository deviceRepository, IAttemptRepository attemptRepository,
                         IAttemptDeviceRepository attemptDeviceRepository)
 {
     // Dit is een test
     _deviceRepository        = deviceRepository;
     _attemptRepository       = attemptRepository;
     _attemptDeviceRepository = attemptDeviceRepository;
 }
 public RoomService(IRoomRepository roomRespository, IUserRepository userRepository, IMemberRepository memberRepository, ITestRepository testRepository, IAttemptRepository attemptRepository, IWorkContext workContext)
 {
     _roomRepository    = roomRespository;
     _userRepository    = userRepository;
     _memberRepository  = memberRepository;
     _testRepository    = testRepository;
     _attemptRepository = attemptRepository;
     _workContext       = workContext;
 }
 public MemberService(IRoomRepository roomRespository, IAttemptRepository attemptRepository, IMemberRepository memberRepository, ITokenGeneratorService tokenGeneratorService, ITokenRepository tokenRepository, ICacheRepository cacheRepository, IOptions <AuthOptionsConfig> config)
 {
     _memberRepository      = memberRepository;
     _attemptRepository     = attemptRepository;
     _roomRepository        = roomRespository;
     _tokenGeneratorService = tokenGeneratorService;
     _tokenRepository       = tokenRepository;
     _cacheRepository       = cacheRepository;
     _config = config;
 }
Example #12
0
 public AdminService(
     IHoleRepository holeRepository,
     ISignalRNotifier signalRNotifier,
     IAttemptRepository attemptRepository,
     IUserRepository userRepository,
     IChallengeRepository challengeRepository,
     IGameRepository gameRepository)
 {
     this.holeRepository      = holeRepository;
     this.signalRNotifier     = signalRNotifier;
     this.attemptRepository   = attemptRepository;
     this.userRepository      = userRepository;
     this.challengeRepository = challengeRepository;
     this.gameRepository      = gameRepository;
 }
Example #13
0
 public DashboardService(
     IGameRepository gameRepository,
     IHoleRepository holeRepository,
     ISignalRNotifier signalRNotifier,
     IAttemptRepository attemptRepository,
     IUserRepository userRepository,
     IBestAttemptsService bestAttemptsService,
     IChallengeRepository challengeRepository)
 {
     this.gameRepository      = gameRepository;
     this.holeRepository      = holeRepository;
     this.signalRNotifier     = signalRNotifier;
     this.attemptRepository   = attemptRepository;
     this.userRepository      = userRepository;
     this.bestAttemptsService = bestAttemptsService;
     this.challengeRepository = challengeRepository;
 }
Example #14
0
 public GameService(
     ICodeGolfService codeGolfService,
     IAttemptRepository attemptRepository,
     IGameRepository gameRepository,
     IHoleRepository holeRepository,
     ISignalRNotifier signalRNotifier,
     IUserRepository userRepository,
     IChallengeRepository challengeRepository)
 {
     this.codeGolfService     = codeGolfService;
     this.attemptRepository   = attemptRepository;
     this.gameRepository      = gameRepository;
     this.holeRepository      = holeRepository;
     this.signalRNotifier     = signalRNotifier;
     this.userRepository      = userRepository;
     this.challengeRepository = challengeRepository;
 }
Example #15
0
 public IndexModel(IAttemptRepository attemptRepository, IHintRepository hintRepository)
 {
     _attemptRepository = attemptRepository;
     _hintRepository    = hintRepository;
 }
Example #16
0
 public AttemptController(IQuizRepository quizRepo, IAttemptRepository attemptsRepo)
 {
     this.quizRepo     = quizRepo;
     this.attemptsRepo = attemptsRepo;
 }
Example #17
0
        private async Task <OperationErrorMessages> EvaluateValidationAttributes(HttpContext httpContext, IAttemptRepository attemptRepository)
        {
            var _workContext = httpContext.RequestServices.GetService <IWorkContext>();
            var memberId     = _workContext.MemberId.Value;

            var activeAttempt = await attemptRepository.GetActiveAttemptByMemberId(memberId);

            if (activeAttempt == null)
            {
                return(OperationErrorMessages.HasNoActiveAttempt);
            }

            return(OperationErrorMessages.NoError);
        }
Example #18
0
 public AttemptController(IAttemptRepository attemptRepository)
 {
     _attemptRepository = attemptRepository;
 }
 public AttemptScoreCalculator(IAttemptRepository attemptRepository)
 {
     _attemptRepository = attemptRepository;
 }
Example #20
0
 public AttemptService(IAttemptRepository attemptRepository, IWorkContext workContext)
 {
     _attemptRepository = attemptRepository;
     _workContext       = workContext;
 }
 public FilteredLatestQuestionsFetcher(IStackExchangeClient stackExchangeClient, IQuestionFilter questionFilter, IAttemptRepository attemptRepository)
 {
     _stackExchangeClient = stackExchangeClient;
     _questionFilter      = questionFilter;
     _attemptRepository   = attemptRepository;
 }
 public AttemptSubmissionManager(IMapper mapper, IAttemptRepository attemptRepository, IAttemptScoreCalculator attemptScoreCalculator)
 {
     _mapper                 = mapper;
     _attemptRepository      = attemptRepository;
     _attemptScoreCalculator = attemptScoreCalculator;
 }
Example #23
0
 public BestAttemptsService(IAttemptRepository attemptRepository)
 {
     this.attemptRepository = attemptRepository;
 }
Example #24
0
 public HomeController(IAttemptRepository attemptRepository)
 {
     this.attemptRepository = attemptRepository;
 }
Example #25
0
        private async Task <OperationErrorMessages> EvaluateValidationAttributes(object argument, HttpContext httpContext, IAttemptRepository attemptRepository, Type dtoType)
        {
            var _workContext = httpContext.RequestServices.GetService <IWorkContext>();

            var userId  = _workContext.UserId;
            var attempt = await attemptRepository.GetAttemptById(ObjectId.Parse(((CommonAPI_AttemptIdDTO)argument).AttemptId));

            if (attempt == null)
            {
                return(OperationErrorMessages.AttemptNotFound);
            }

            else if (attempt.UserId != userId)
            {
                return(OperationErrorMessages.AttemptAccessError);
            }

            return(OperationErrorMessages.NoError);
        }