Exemple #1
0
 public ApiController(ILabService labService, IExerciseService exerciseService, IUserService userService, ILabExecutionService labExecutionService)
 {
     _labService          = labService ?? throw new ArgumentNullException(nameof(labService));
     _exerciseService     = exerciseService ?? throw new ArgumentNullException(nameof(exerciseService));
     _userService         = userService ?? throw new ArgumentNullException(nameof(userService));
     _labExecutionService = labExecutionService ?? throw new ArgumentNullException(nameof(labExecutionService));
 }
Exemple #2
0
 public UserDashboardController(IUserService userService, IStringLocalizer <UserDashboardController> localizer, IScoreboardService scoreboardService, ILabExecutionService labExecutionService, IFlagService flagService, ILabService labService)
     : base("~/Views/UserDashboard.cshtml", userService)
 {
     _localizer           = localizer ?? throw new ArgumentNullException(nameof(localizer));
     _scoreboardService   = scoreboardService ?? throw new ArgumentNullException(nameof(scoreboardService));
     _labExecutionService = labExecutionService ?? throw new ArgumentNullException(nameof(labExecutionService));
     _flagService         = flagService ?? throw new ArgumentNullException(nameof(flagService));
     _labService          = labService ?? throw new ArgumentNullException(nameof(labService));
 }
 public AdminLabExecutionsController(IUserService userService, IStringLocalizer <AdminLabExecutionsController> localizer, ILogger <AdminLabExecutionsController> logger, ILabExecutionService labExecutionService, ISlotService slotService, ILabService labService)
     : base("~/Views/AdminLabExecutions.cshtml", userService)
 {
     _userService         = userService ?? throw new ArgumentNullException(nameof(userService));
     _localizer           = localizer ?? throw new ArgumentNullException(nameof(localizer));
     _logger              = logger ?? throw new ArgumentNullException(nameof(logger));
     _labExecutionService = labExecutionService ?? throw new ArgumentNullException(nameof(labExecutionService));
     _slotService         = slotService ?? throw new ArgumentNullException(nameof(slotService));
     _labService          = labService ?? throw new ArgumentNullException(nameof(labService));
 }
Exemple #4
0
        public async Task <IActionResult> RenderScoreboardAsync([FromServices] ILabExecutionService labExecutionService, int?labId, int?slotId)
        {
            if (labId == null || slotId == null)
            {
                // Show the most recently executed lab and slot as default
                var recentLabExecution = await labExecutionService.GetMostRecentLabExecutionAsync(HttpContext.RequestAborted);

                if (recentLabExecution != null)
                {
                    labId  = recentLabExecution.LabId;
                    slotId = recentLabExecution.Group?.SlotId;
                }
            }

            return(await RenderAsync(labId ?? 0, slotId ?? 0));
        }