public GameController(IQuizRepo quizRepo, IGameRepo gameRepo, IQuestionRepo questionRepo, UserManager <User> userMgr) { this.quizRepo = quizRepo; this.gameRepo = gameRepo; this.questionRepo = questionRepo; this.userMgr = userMgr; }
public QuestionService(IQuestionRepo questionRepo, NotificationService notificationService, IAnswerRepo answerRepo, IQuestionHub questionHub) { this.questionRepo = questionRepo; this.notificationService = notificationService; this.answerRepo = answerRepo; this.questionHub = questionHub; }
public QuestionController(IQuestionRepo questionRepo, IQuizRepo quizRepo, IAnswerRepo answerRepo, IChoiceRepo choiceRepo) { this.questionRepo = questionRepo; this.quizRepo = quizRepo; this.answerRepo = answerRepo; this.choiceRepo = choiceRepo; }
public QuizController(UserManager <AppUser> userManager, IQuizRepo quizRepository, IQuestionRepo questionRepo, IAnswerRepo answerRepo) { this._userManager = userManager; this._quizRepo = quizRepository; this._questionRepo = questionRepo; this._answerRepo = answerRepo; }
public QuestionService( IQuestionRepo questionRepo, ITestQuesRepo testQuesRepo ) { _questionRepo = questionRepo; _testQuesRepo = testQuesRepo; }
public PlayController(IQuizRepo quizRepo, ApplicationDbContext context, IQuestionRepo questionRepo, IAnswerRepo answerRepo, IChoiceRepo choiceRepo) { this.quizRepo = quizRepo; this.context = context; this.questionRepo = questionRepo; this.answerRepo = answerRepo; this.choiceRepo = choiceRepo; }
public DataInitializer(IQuizRepo quizrepo, IQuestionRepo questionRepo, IAnswerRepo answerRepo, UserManager <AppUser> userMgr) { this._quizRepo = quizrepo; this._questionRepo = questionRepo; this._answerRepo = answerRepo; this._userMgr = userMgr; }
public ResponseService( IResponseRepo responseRepo, IQuestionRepo questionRepo ) { _responseRepo = responseRepo; _questionRepo = questionRepo; }
public HomeController(ILogger <HomeController> logger, IQuizRepo quizRepo, IDifficultyRepo difficultyRepo, IQuestionRepo questionRepo, IAnswerRepo answerRepo) { _logger = logger; this.quizRepo = quizRepo; this.difficultyRepo = difficultyRepo; this.questionRepo = questionRepo; this.answerRepo = answerRepo; }
//constructor public DashboardController(IQuestionRepo questionRepo, IQuizRepo quizRepo, IAnswerRepo answerRepo, IChoiceRepo choiceRepo, ISubjectRepo subjectRepo) { this.questionRepo = questionRepo; this.quizRepo = quizRepo; this.answerRepo = answerRepo; this.choiceRepo = choiceRepo; this.subjectRepo = subjectRepo; }
public QuestionnaireManagerController(IQuestionnaireRepo questionnaireRepo, IQuestionRepo questionRepo, IAnswerRepo answerRepo, IPatientQuestionnaireRepo patientQuestionnaireRepo) { _questionnaireRepo = questionnaireRepo; _questionRepo = questionRepo; _answerRepo = answerRepo; _patientQuestionnaireRepo = patientQuestionnaireRepo; }
public TestService( ITestRepo testRepo, IResponseRepo responseRepo, IQuestionRepo questionRepo, ITestQuesRepo testQuesRepo ) { _testRepo = testRepo; _responseRepo = responseRepo; _questionRepo = questionRepo; _testQuesRepo = testQuesRepo; }
public async static Task SeedQuizold(IQuizRepo quizRepo, IQuestionRepo questionRepo) { string[] quizNames = { "Animals", "trivia", "geography" }; List <QuizClass> quizzes = new List <QuizClass>(); foreach (var quizName in quizNames) { var quiz = await quizRepo.GetQuizByNameAsync(quizName); if (quiz == null) { QuizClass newQuiz = new QuizClass() { Name = quizName, Difficulty = 2, Description = "A quiz about " + quizName }; await quizRepo.Create(newQuiz); } quizzes.Add(quiz); } Question vraag1 = new Question() { Description = "hoeveel weegt pikachu" }; Option option1 = new Option() { OptionDescription = "5 kg", CorrectAnswer = true }; Option option2 = new Option() { OptionDescription = "8 kg", CorrectAnswer = false }; List <Option> opties = new List <Option>(); opties.Add(option1); opties.Add(option2); vraag1.PossibleOptions = opties; var question = await questionRepo.GetQuestionByDescriptionAsync(vraag1.Description); if (question == null) { await questionRepo.Create(vraag1); } await quizRepo.AddQuestionToQuizAsync(quizzes[0].QuizId, vraag1.QuestionId); }
public PatientQuestionnaireController(IQuestionnaireRepo questionnaireRepo, IQuestionRepo questionRepo, IAnswerRepo answerRepo, IUserAnswerRepo userAnswerRepo, IUserQuestionnaireAnswerRepo userQuestionnaireAnswerRepo, IPatientQuestionnaireRepo patientQuestionnaireRepo) { _questionnaireRepo = questionnaireRepo; _questionRepo = questionRepo; _answerRepo = answerRepo; _userAnswerRepo = userAnswerRepo; _userQuestionnaireAnswerRepo = userQuestionnaireAnswerRepo; _patientQuestionnaireRepo = patientQuestionnaireRepo; }
public QuestionnaireResultsController(IQuestionnaireRepo questionnaireRepo, IQuestionRepo questionRepo, IUserRepo userRepo, IPatientQuestionnaireRepo patientQuestionnaireRepo, UserManager <User> userManager, IUserAnswerRepo userAnswerRepo, IUserQuestionnaireAnswerRepo userQuestionnaireAnswerRepo) { _questionnaireRepo = questionnaireRepo; _questionRepo = questionRepo; _userRepo = userRepo; _patientQuestionnaireRepo = patientQuestionnaireRepo; _userManager = userManager; _userAnswerRepo = userAnswerRepo; _userQuestionnaireAnswerRepo = userQuestionnaireAnswerRepo; }
public QuizOverviewController(IQuizRepo quizRepo, IQuestionRepo questionRepo) { this.quizRepo = quizRepo; this.questionRepo = questionRepo; }
public QuestionController() { repo = new QuestionRepo(); }
public QuestionService(IQuestionRepo dataRepository) { _dataRepository = dataRepository; }
public QuestionController(IQuestionRepo repo, IMapper mapper, ILogger <QuestionController> logger) : base(repo, mapper, logger) { this._repo = repo; this._mapper = mapper; this._logger = logger; }
public QuestionService(IQuestionRepo questionRepo, IQuestionOrderService questionOrderService) { this.questionRepo = questionRepo; this.questionOrderService = questionOrderService; }
public Game(IQuestionRepo questionRepo, IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; _questionRepo = questionRepo; }
public async static Task SeedQuiz(IQuizRepo quizRepo, IQuestionRepo questionRepo) { //quiz over Trivia aanmaken string quizName = "Trivia"; if (await quizRepo.GetQuizByNameAsync(quizName) == null) { QuizClass newQuiz = new QuizClass() { Name = quizName, Difficulty = 5, Description = "A quiz about all sorts of things" }; await quizRepo.Create(newQuiz); List <Option> opties = new List <Option>(); Question vraag = new Question() { Description = "Which of the following items was owned by the fewest U.S. homes in 1990?" }; if (await questionRepo.GetQuestionByDescriptionAsync(vraag.Description) == null) { Option option1 = new Option() { OptionDescription = "home computer", CorrectAnswer = false }; Option option2 = new Option() { OptionDescription = "compact disk player", CorrectAnswer = true }; Option option3 = new Option() { OptionDescription = "dishwasher", CorrectAnswer = false }; opties.Add(option1); opties.Add(option2); opties.Add(option3); vraag.PossibleOptions = opties; await questionRepo.Create(vraag); await quizRepo.AddQuestionToQuizAsync(newQuiz.QuizId, vraag.QuestionId); } vraag = new Question() { Description = "How tall is the tallest man on earth?" }; if (await questionRepo.GetQuestionByDescriptionAsync(vraag.Description) == null) { Option option1 = new Option() { OptionDescription = "2.72 m", CorrectAnswer = true }; Option option2 = new Option() { OptionDescription = "2.64 m", CorrectAnswer = false }; Option option3 = new Option() { OptionDescription = "3.05 m", CorrectAnswer = false }; opties = new List <Option>(); opties.Add(option1); opties.Add(option2); opties.Add(option3); vraag.PossibleOptions = opties; await questionRepo.Create(vraag); await quizRepo.AddQuestionToQuizAsync(newQuiz.QuizId, vraag.QuestionId); } vraag = new Question() { Description = "Which racer holds the record for the most Grand Prix wins?" }; if (await questionRepo.GetQuestionByDescriptionAsync(vraag.Description) == null) { Option option1 = new Option() { OptionDescription = "Michael Schumacher", CorrectAnswer = true }; Option option2 = new Option() { OptionDescription = "Mario Andretti", CorrectAnswer = false }; Option option3 = new Option() { OptionDescription = "Lewis Hamilton", CorrectAnswer = false }; opties = new List <Option>(); opties.Add(option1); opties.Add(option2); opties.Add(option3); vraag.PossibleOptions = opties; await questionRepo.Create(vraag); await quizRepo.AddQuestionToQuizAsync(newQuiz.QuizId, vraag.QuestionId); } } return; }
public Mapper(IQuestionRepo questionRepo) { this.questionRepo = questionRepo; }
public QuizRepo(QuizDbContext context, IQuestionRepo questionRepo) { this.context = context; this.questionRepo = questionRepo; }
// Constructor public QuizController(IQuestionRepo questionRepository) { _questionRepository = questionRepository; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IQuizRepo quizRepo, IQuestionRepo questionRepo, QuizDbContext context, RoleManager <Role> roleMgr, UserManager <User> userMgr) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); app.UseStatusCodePagesWithRedirects("/Error/{0}"); } else { app.UseStatusCodePagesWithRedirects("/Error/{0}"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapRazorPages(); }); QuizDbContextExtensions.SeedQuiz(quizRepo, questionRepo).Wait(); QuizDbContextExtensions.SeedRoles(roleMgr).Wait(); QuizDbContextExtensions.SeedUsers(userMgr).Wait(); }
public QuestionService(IMapper mapper, IQuestionRepo repo) { _repo = repo; _mapper = mapper; }
public QuestionController(IQuestionRepo questionRepo) { _questionRepo = questionRepo; }
public QuizController(IQuizRepo repo, IQuestionRepo qRepo, ApplicationDbContext ctx) { repository = repo; questionRepo = qRepo; _context = ctx; }
public QuizService(IMapper mapper, IQuizRepo repo, IQuestionRepo questionRepo) { _mapper = mapper; _quizRepo = repo; _questionRepo = questionRepo; }