Esempio n. 1
0
        public async Task <ActionResult> SetResult(string id, [FromBody] SubmissionResult value)
        {
            ISubmissionProvider res = await _workspace.Submissions.Get(id);

            if (res != null)
            {
                await res.SetResult(value);

                return(Accepted());
            }
            else
            {
                return(NotFound());
            }
        }
Esempio n. 2
0
        public async Task <ActionResult> Rejudge(string id)
        {
            ISubmissionProvider res = await _workspace.Submissions.Get(id);

            if (res != null)
            {
                await res.SetResult(null);

                try
                {
                    SendJudgeRequest(res.Id);
                    return(Accepted());
                }
                catch
                {
                    return(Forbid());
                }
            }
            else
            {
                return(NotFound());
            }
        }