public IActionResult Part(string userId) { var questionCount = UserProgressService.GetAnsweredQuestionCount(userId); var currentPart = UserProgressService.GetCurrentPartNumber(userId); var viewModel = new UserViewModel() { UserId = userId }; if (currentPart == 0) { viewModel.Part = 1; viewModel.Instructions = "Two letters will appear on the screen. Your task is to examine the options and then pick one of the letters. There is no correct answer for any quesiton."; UserProgressService.UpdatePartNumber(userId, 1); } else if (questionCount >= 9 && currentPart == 1) { viewModel.Part = 2; viewModel.Instructions = "A scenario will be shown on a screen along with a price. Your task is to examine the price and decide how likely you are to spend money in that scenario. There is no correct answer for any quesiton."; UserProgressService.UpdatePartNumber(userId, 2); } else if (questionCount >= 2 && currentPart == 2) { return(View("SurveyComplete")); } return(View("PartIntro", viewModel)); }
public LessonsController(ApplicationDbContext context) { _context = context; qS = new LessonService(context); ts = new TestService(context); uS = new UserService(context); upS = new UserProgressService(context); }
public QuizzController( ApplicationDbContext context, UserManager <User> userManager, SignInManager <User> SignInManager) { dbContext = context; qS = new LessonService(context); rS = new ResultService(context); uS = new UserService(context); tS = new TestService(context); upS = new UserProgressService(context); _userManager = userManager; _SignInManager = SignInManager; }
public LessonAPIController(ApplicationDbContext context, SignInManager <User> signInManager, UserManager <User> userManager) { _context = context; qS = new LessonService(context); ts = new TestService(context); uS = new UserService(context); upS = new UserProgressService(context); _userManager = userManager; _signInManager = signInManager; }
public AdminController( SignInManager <User> signInManager, ILogger <UserAPIController> logger, ApplicationDbContext context, UserManager <User> userManager) { _signInManager = signInManager; _logger = logger; uS = new UserService(context); lS = new LessonService(context); tS = new TestService(context); rS = new ResultService(context); upS = new UserProgressService(context); _userManager = userManager; }