diff --git a/ServerCore/Pages/Events/FastestSolves.cshtml.cs b/ServerCore/Pages/Events/FastestSolves.cshtml.cs index 0a7a952c..80d20a94 100644 --- a/ServerCore/Pages/Events/FastestSolves.cshtml.cs +++ b/ServerCore/Pages/Events/FastestSolves.cshtml.cs @@ -43,9 +43,10 @@ public async Task OnGetAsync(SortOrder? sort, PuzzleStateFilter? stateFilter) names.ForEach(t => teamNameLookup[t.ID] = t.Name); + DateTime submissionEnd = Event.AnswerSubmissionEnd; // get the page data: puzzle, solve count, top three fastest var puzzlesData = await PuzzleStateHelper.GetSparseQuery(_context, this.Event, null, null) - .Where(s => s.SolvedTime != null && s.Puzzle.IsPuzzle) + .Where(s => s.SolvedTime != null && s.Puzzle.IsPuzzle && s.SolvedTime <= submissionEnd) .GroupBy(state => state.Puzzle) .Select(g => new { Puzzle = g.Key, diff --git a/ServerCore/Pages/Events/Standings.cshtml.cs b/ServerCore/Pages/Events/Standings.cshtml.cs index ff7b390f..3576b528 100644 --- a/ServerCore/Pages/Events/Standings.cshtml.cs +++ b/ServerCore/Pages/Events/Standings.cshtml.cs @@ -31,8 +31,9 @@ public async Task OnGetAsync(SortOrder? sort) .Where(p => p.Event == Event && p.IsPuzzle) .ToDictionaryAsync(p => p.ID, p => new { p.SolveValue, p.IsCheatCode, p.IsFinalPuzzle }); + DateTime submissionEnd = Event.AnswerSubmissionEnd; var stateData = await PuzzleStateHelper.GetSparseQuery(_context, this.Event, null, null) - .Where(pspt => pspt.SolvedTime != null) + .Where(pspt => pspt.SolvedTime != null && pspt.SolvedTime <= submissionEnd) .Select(pspt => new { pspt.PuzzleID, pspt.TeamID, pspt.SolvedTime }) .ToListAsync(); diff --git a/ServerCore/Pages/Submissions/Index.cshtml b/ServerCore/Pages/Submissions/Index.cshtml index 01d7ef06..c0f8e060 100644 --- a/ServerCore/Pages/Submissions/Index.cshtml +++ b/ServerCore/Pages/Submissions/Index.cshtml @@ -57,8 +57,6 @@
} -
-
@if (Model.Puzzle.HasDataConfirmation) {
@@ -72,12 +70,18 @@

Correct

Answer: @Model.AnswerToken
+ + @if (Model.PuzzleState.SolvedTime > Model.Event.AnswerSubmissionEnd) + { + + } } - else if (!@Model.Event.IsAnswerSubmissionActive) + else if (DateTime.UtcNow < Model.Event.EventBegin) {
-

Answer Submission Closed

- No submissions will be accepted at this time. +

This event is not yet in session. No submissions will be accepted at this time.

} else if (Model.PuzzleState.IsEmailOnlyMode) @@ -103,30 +107,39 @@ } else { - if (Model.DuplicateSubmission) + if (DateTime.UtcNow > @Model.Event.AnswerSubmissionEnd) + { + + } + + @if (Model.DuplicateSubmission) { } - -
-
-
- - - Submitted answers will automatically be capitalized and stripped of non-alphanumeric characters
- @Html.ValidationSummary(true) - -
-
- +
+
+ +
+
+ + + Submitted answers will automatically be capitalized and stripped of non-alphanumeric characters
+ @Html.ValidationSummary(true) + +
+
+ +
+
- +
} -
-
@if (Model.SubmissionViews.Count > 0) { diff --git a/ServerCore/Pages/Submissions/Index.cshtml.cs b/ServerCore/Pages/Submissions/Index.cshtml.cs index 2c041b48..2d63cfe3 100644 --- a/ServerCore/Pages/Submissions/Index.cshtml.cs +++ b/ServerCore/Pages/Submissions/Index.cshtml.cs @@ -53,9 +53,9 @@ public async Task OnPostAsync(int puzzleId, string submissionText } SubmissionText = submissionText; - if (!this.Event.IsAnswerSubmissionActive) + if (DateTime.UtcNow < Event.EventBegin) { - return Page(); + return NotFound("The event hasn't started yet!"); } await SetupContext(puzzleId); @@ -126,7 +126,7 @@ await PuzzleStateHelper.SetSolveStateAsync(_context, AnswerToken = submission.SubmissionText; } - else if (submission.Response == null) + else if (submission.Response == null && Event.IsAnswerSubmissionActive) { // We also determine if the puzzle should be set to email-only mode. if (IsPuzzleSubmissionLimitReached( diff --git a/ServerCore/Pages/Teams/Play.cshtml b/ServerCore/Pages/Teams/Play.cshtml index 81a62eeb..a4bd0ef8 100644 --- a/ServerCore/Pages/Teams/Play.cshtml +++ b/ServerCore/Pages/Teams/Play.cshtml @@ -7,7 +7,8 @@ ViewData["AuthorRoute"] = "/Puzzles/Index"; // Needs route data - ViewData["PlayRoute"] = "/Teams/Play"; - Boolean unsolvedFilter = Model.StateFilter == PlayModel.PuzzleStateFilter.Unsolved; + bool unsolvedFilter = Model.StateFilter == PlayModel.PuzzleStateFilter.Unsolved; + bool canSubmit = DateTime.UtcNow >= Model.Event.EventBegin; }

Puzzles

+@if (DateTime.UtcNow > @Model.Event.AnswerSubmissionEnd) +{ + +}
View All Correct Answers
@@ -131,13 +139,13 @@ { Solved on @Html.Raw(Model.LocalTime(item.SolvedTime)) } - else if (@Model.Event.IsAnswerSubmissionActive) + else if (canSubmit) { Submit Answer } else { - See past submissions + Not yet available }