mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 01:37:11 +00:00
<type>(scope): <description>
[body] [footer(s)]
This commit is contained in:
@@ -109,7 +109,9 @@ def submit_task(
|
|||||||
user=user, achievement=first_steps_achievement
|
user=user, achievement=first_steps_achievement
|
||||||
)
|
)
|
||||||
|
|
||||||
total_attempts = CompetitionTaskSubmission.objects.filter(user=user, task=task).count()
|
total_attempts = CompetitionTaskSubmission.objects.filter(
|
||||||
|
user=user, task=task
|
||||||
|
).count()
|
||||||
if task.max_attempts == total_attempts:
|
if task.max_attempts == total_attempts:
|
||||||
return status.FORBIDDEN, ForbiddenError()
|
return status.FORBIDDEN, ForbiddenError()
|
||||||
|
|
||||||
@@ -118,8 +120,10 @@ def submit_task(
|
|||||||
user=user,
|
user=user,
|
||||||
task=task,
|
task=task,
|
||||||
status=CompetitionTaskSubmission.StatusChoices.CHECKED,
|
status=CompetitionTaskSubmission.StatusChoices.CHECKED,
|
||||||
result={"correct": content == task.answer_file_path},
|
|
||||||
content=content,
|
content=content,
|
||||||
|
result={
|
||||||
|
"correct": content.read() == task.correct_answer_file.read()
|
||||||
|
},
|
||||||
)
|
)
|
||||||
if task.type == CompetitionTask.CompetitionTaskType.REVIEW:
|
if task.type == CompetitionTask.CompetitionTaskType.REVIEW:
|
||||||
submission = CompetitionTaskSubmission.objects.create(
|
submission = CompetitionTaskSubmission.objects.create(
|
||||||
|
|||||||
Reference in New Issue
Block a user