mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 17:57:10 +00:00
Merge branch 'master' of gitlab.prodcontest.ru:team-15/project
This commit is contained in:
@@ -38,6 +38,7 @@ class SubmissionOut(ModelSchema):
|
|||||||
competition_name: str = Field(..., alias="task.competition.title")
|
competition_name: str = Field(..., alias="task.competition.title")
|
||||||
task_position: int = Field(..., alias="task.in_competition_position")
|
task_position: int = Field(..., alias="task.in_competition_position")
|
||||||
task_title: str = Field(..., alias="task.title")
|
task_title: str = Field(..., alias="task.title")
|
||||||
|
description: str = Field(..., alias="task.description")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def resolve_criteries(self, context) -> list[CriteriaOut] | None:
|
def resolve_criteries(self, context) -> list[CriteriaOut] | None:
|
||||||
|
|||||||
Binary file not shown.
@@ -2,6 +2,7 @@ import random
|
|||||||
import uuid
|
import uuid
|
||||||
from datetime import timedelta, datetime
|
from datetime import timedelta, datetime
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.auth.hashers import make_password
|
from django.contrib.auth.hashers import make_password
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
@@ -60,6 +61,17 @@ E — коэффициент чувствительности количеств
|
|||||||
{
|
{
|
||||||
"obj": None,
|
"obj": None,
|
||||||
"title": "Задача 2",
|
"title": "Задача 2",
|
||||||
|
"description": """
|
||||||
|
Напишите "hello_dano" на питоне
|
||||||
|
""".strip(),
|
||||||
|
"type": CompetitionTask.CompetitionTaskType.CHECKER.value,
|
||||||
|
"points": 25,
|
||||||
|
"submission_reviewers_count": 2,
|
||||||
|
"max_attempts": 50,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"obj": None,
|
||||||
|
"title": "Задача 3",
|
||||||
"description": """Небольшой интернет-магазин собрал данные о действиях пользователей на своем сайте
|
"description": """Небольшой интернет-магазин собрал данные о действиях пользователей на своем сайте
|
||||||
за последние несколько месяцев.
|
за последние несколько месяцев.
|
||||||
ecommerce_logs.csv — журнал действий пользователей:
|
ecommerce_logs.csv — журнал действий пользователей:
|
||||||
@@ -135,17 +147,6 @@ ecommerce_logs.csv — журнал действий пользователей:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"obj": None,
|
|
||||||
"title": "Задача 3",
|
|
||||||
"description": """
|
|
||||||
Напишите "hello_dano" на питоне
|
|
||||||
""".strip(),
|
|
||||||
"type": CompetitionTask.CompetitionTaskType.CHECKER.value,
|
|
||||||
"points": 25,
|
|
||||||
"submission_reviewers_count": 2,
|
|
||||||
"max_attempts": 50,
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -196,7 +197,7 @@ ecommerce_logs.csv — журнал действий пользователей:
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"obj": None,
|
"obj": None,
|
||||||
"title": "Задача 4",
|
"title": "Задача 3",
|
||||||
"description": """
|
"description": """
|
||||||
Напишите выведите 1+3 на питоне
|
Напишите выведите 1+3 на питоне
|
||||||
""".strip(),
|
""".strip(),
|
||||||
@@ -349,14 +350,18 @@ class Command(BaseCommand):
|
|||||||
if task.type == CompetitionTask.CompetitionTaskType.REVIEW.value:
|
if task.type == CompetitionTask.CompetitionTaskType.REVIEW.value:
|
||||||
num_submissions = random.randint(1, 3)
|
num_submissions = random.randint(1, 3)
|
||||||
for m in range(num_submissions):
|
for m in range(num_submissions):
|
||||||
dummy_content = ContentFile(
|
dummy_content_txt = ContentFile(
|
||||||
b"otvet: 112 sto proc" ,
|
b"otvet: 112 sto proc" ,
|
||||||
name=f"submission_{uuid.uuid4().hex}.txt",
|
name=f"submission_{uuid.uuid4().hex}.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
content_dir = f"{settings.BASE_DIR}/apps/core/contents"
|
||||||
|
with open(f"{content_dir}/presentation.pptx", "rb") as f:
|
||||||
|
files = [f, f, dummy_content_txt]
|
||||||
submission = CompetitionTaskSubmission.objects.create(
|
submission = CompetitionTaskSubmission.objects.create(
|
||||||
user=user,
|
user=user,
|
||||||
task=task,
|
task=task,
|
||||||
content=dummy_content,
|
content=random.choice(files),
|
||||||
)
|
)
|
||||||
submission.save()
|
submission.save()
|
||||||
submission.send_on_review()
|
submission.send_on_review()
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ const FileSolution: React.FC<FileSolutionProps> = ({
|
|||||||
<FileIcon size={28} className="text-black mb-2" />
|
<FileIcon size={28} className="text-black mb-2" />
|
||||||
<span className="text-sm text-gray-700 font-medium mb-1 font-hse-sans">{fileName}</span>
|
<span className="text-sm text-gray-700 font-medium mb-1 font-hse-sans">{fileName}</span>
|
||||||
|
|
||||||
<div className="flex items-center mt-2">
|
<div className="flex flex-col justify-center mt-2">
|
||||||
{existingFileUrl && !selectedFile && (
|
{existingFileUrl && !selectedFile && (
|
||||||
<a
|
<a
|
||||||
href={existingFileUrl}
|
href={existingFileUrl}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const submitTaskSolution = async (
|
|||||||
|
|
||||||
// туповатый костыль но для мвп сойдет
|
// туповатый костыль но для мвп сойдет
|
||||||
if (typeof solution === 'string') {
|
if (typeof solution === 'string') {
|
||||||
const textFile = new File([solution], 'solution.txt', { type: 'text/plain' });
|
const textFile = new File([solution], 'solution_example.txt', { type: 'text/plain' });
|
||||||
formData.append('content', textFile);
|
formData.append('content', textFile);
|
||||||
} else {
|
} else {
|
||||||
formData.append('content', solution);
|
formData.append('content', solution);
|
||||||
|
|||||||
Reference in New Issue
Block a user