mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 22:07:10 +00:00
<type>(scope): <description>
[body] [footer(s)]
This commit is contained in:
@@ -120,7 +120,6 @@ def submit_task(
|
||||
user_input = content.read()
|
||||
correct_answer = task.correct_answer_file.read()
|
||||
verdict = user_input == correct_answer
|
||||
print(user_input, correct_answer)
|
||||
submission = CompetitionTaskSubmission.objects.create(
|
||||
user=user,
|
||||
task=task,
|
||||
|
||||
@@ -5,6 +5,7 @@ from celery import shared_task
|
||||
from django.conf import settings
|
||||
from django.core.files.base import ContentFile
|
||||
from urllib.parse import urlparse
|
||||
import base64
|
||||
|
||||
from apps.task.models import CompetitionTaskSubmission
|
||||
|
||||
@@ -13,10 +14,7 @@ from apps.task.models import CompetitionTaskSubmission
|
||||
def analyze_data_task(self, submission_id):
|
||||
submission = CompetitionTaskSubmission.objects.get(id=submission_id)
|
||||
try:
|
||||
code_url = (
|
||||
f"{settings.MINIO_DEFAULT_CUSTOM_ENDPOINT_URL}/"
|
||||
f"{urlparse(submission.content.url).path}"
|
||||
)
|
||||
code = submission.content.read()
|
||||
files = [
|
||||
{
|
||||
"url": (
|
||||
@@ -34,7 +32,7 @@ def analyze_data_task(self, submission_id):
|
||||
f"{settings.CHECKER_API_ENDPOINT}/execute",
|
||||
json={
|
||||
"files": files,
|
||||
"code_url": code_url,
|
||||
"code": base64.encode(code),
|
||||
"answer_file_path": submission.task.answer_file_path,
|
||||
"expected_hash": hashlib.sha256(
|
||||
submission.task.correct_answer_file.read()
|
||||
|
||||
@@ -2,10 +2,9 @@ from django.apps import AppConfig
|
||||
|
||||
|
||||
class UsersConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "apps.user"
|
||||
label = "user"
|
||||
verbose_name = "Пользователи (веб)"
|
||||
verbose_name = "контестанты"
|
||||
|
||||
def ready(self):
|
||||
import apps.user.signals
|
||||
|
||||
Reference in New Issue
Block a user