def rejudge_submissions(request): for submission in Submission.objects.all(): judge_submission(submission) # problem = submission.problem # (judge_submission.s(submission.pk, 0) | run_sandbox.s() | parse_sandbox_result.s(submission.pk, 0)).apply_async() # chord((judge_submission.s(submission.pk, test.pk) | run_sandbox.s() | parse_sandbox_result.s(submission.pk, test.pk)) for test in problem.test_set.all())(apply_submission_result.s(submission.pk)) return redirect('polygon.views.submissions')
def test_submission(request, pk): form = TestSubmissionForm(request.POST or None) problem = get_object_or_404(Problem, pk=pk) if request.method == 'POST': if form.is_valid(): submission = form.save(commit=False) submission.problem = problem submission.user = request.user submission.save() judge_submission(submission) return redirect('polygon.views.submission', pk=submission.pk) return render(request, 'polygon/problem/test_submission.html', context={ 'form': form, 'problem': problem, 'Submission': Submission })
def judge_contest_submission(problemset_submission: ContestUserSubmission): submission = problemset_submission.submission task = judge_submission(submission, commit=False) (task | process_submission.s( problemset_submission.pk)).apply_async()
def rejudge_submission(request, pk): submission = get_object_or_404(Submission, pk=pk) judge_submission(submission) return redirect('polygon.views.submission', pk=pk)