@using System.Web.Mvc.Html @using System.Web.UI.HtmlControls @using DAL @using Microsoft.AspNet.Identity @using Model @using Ninject.Infrastructure.Disposal @model Model.Contest @{ var diff = 0; var contestId = Model.Id; }

Contest - @Model.Name

@if (Model.EndTime < DateTime.Now) { diff = -1;

contest has Ended

Contest has ended. Go to Problem Section to up solve the problems
@Html.Partial("StandingPartial", Model)

Submissions

@if (Model.Participants != null) { @foreach (var item in Model.Submissions.OrderByDescending(t => t.SubmissionTime.Second)) { if (item.IsContestTime == false) { continue; } var tim = (item.SubmissionTime - Model.StarTime).TotalSeconds; TimeSpan time = TimeSpan.FromSeconds(tim); string str = time.ToString(@"hh\:mm\:ss"); var color = "btn"; @if (item.Participant != null) { } @**@ } }
Submission Problem Participant Name Compiler Comment Submission Time
@item.Problem.ProblemName @item.Participant.Id @if (item.IsProcessed == true && item.IsCompiledSuccessfully == false) { color = "btn btn-danger"; item.CompilerComment = "Compilation Error"; } else if (item.CompilerComment == "Accepted") { color = "btn btn-success"; } else if (item.CompilerComment == "Wrong Answer" || item.CompilerComment == "Runtime Error" || item.CompilerComment == "Time Limit" || item.CompilerComment == "Runtime Error" || item.CompilerComment == "Memory Limit") { color = "btn btn-danger"; } else if (item.CompilerComment == "Duplicate") { color = "btn btn-warning"; } @str @Html.DisplayFor(modelItem => item.TimeLimit)
} else if (Model.StarTime > DateTime.Now) {

contest has not started yet

diff = (int) (Model.StarTime - DateTime.Now).TotalSeconds; var participant = this.Model.Participants.Where(c => c.Id == this.User.Identity.GetUserName()).Count(); if (participant != 0) {

You have registered for this contest

} else { if (this.Model.Visible == true) { @Html.ActionLink("Registration", "RegistrationForContest", "Participant", new {id = Model.Id,}, htmlAttributes: new {@class = "btn btn-primary"}) } else {

contest is invite only.

} }
days hours minutes seconds
} else { diff = (int) (Model.EndTime - DateTime.Now).TotalSeconds;
days hours minutes seconds

Problems

@if (Model.Problems != null) { @foreach (var item in Model.Problems) { } }
@Html.DisplayNameFor(model => model.Problems[0].ProblemName) @Html.DisplayNameFor(model => model.Problems[0].ProblemName) @Html.DisplayNameFor(model => model.Problems[0].ProblemName) Utilitis
@Html.ActionLink(item.ProblemName, "Details", "Problem", new {id = item.Id}, null) @Html.DisplayFor(modelItem => item.Score) @Html.DisplayFor(modelItem => item.TimeLimit)
@Html.Partial("StandingPartial", Model)

Submissions

@if (Model.Participants != null) { @foreach (var item in Model.Submissions.OrderByDescending(t => t.SubmissionTime.Millisecond)) { if (item.IsContestTime == false) { continue; } var tim = (item.SubmissionTime - Model.StarTime).TotalSeconds; TimeSpan time = TimeSpan.FromSeconds(tim); string str = time.ToString(@"hh\:mm\:ss"); var color = "btn"; @if (item.Participant != null) { } @**@ } }
Submission Problem Participant Name Compiler Comment Submission Time
@item.Problem.ProblemName @item.Participant.Id @if (item.IsProcessed == true && item.IsCompiledSuccessfully == false) { color = "btn btn-danger"; item.CompilerComment = "Compilation Error"; } else if (item.CompilerComment == "Accepted") { color = "btn btn-success"; } else if (item.CompilerComment == "Wrong Answer" || item.CompilerComment == "Runtime Error" || item.CompilerComment == "Time Limit" || item.CompilerComment == "Runtime Error" || item.CompilerComment == "Memory Limit") { color = "btn btn-danger"; } else if (item.CompilerComment == "Duplicate") { color = "btn btn-warning"; } @str @Html.DisplayFor(modelItem => item.TimeLimit)
}

@Html.ActionLink("Edit", "Edit", new {id = Model.Id}) | @Html.ActionLink("Back to List", "Index")

@section scripts { }