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:
@@ -424,7 +424,6 @@ B — пользователи, которым доступен только о
|
||||
""".strip(),
|
||||
"type": CompetitionTask.CompetitionTaskType.INPUT.value,
|
||||
"points": 15,
|
||||
"submission_reviewers_count": 2,
|
||||
"max_attempts": 50,
|
||||
"correct_answer_file": ans3,
|
||||
},
|
||||
@@ -434,7 +433,6 @@ B — пользователи, которым доступен только о
|
||||
"description": "Сколько будет 6 * 7?",
|
||||
"type": CompetitionTask.CompetitionTaskType.INPUT.value,
|
||||
"points": 5,
|
||||
"submission_reviewers_count": 2,
|
||||
"max_attempts": 10,
|
||||
"correct_answer_file": ans3,
|
||||
},
|
||||
@@ -659,14 +657,17 @@ class Command(BaseCommand):
|
||||
competitions_objs = []
|
||||
|
||||
for i, competition in enumerate(competitions):
|
||||
competition_obj = Competition.objects.create(
|
||||
title=competition["title"],
|
||||
description=competition["description"],
|
||||
start_date=competition["start_date"],
|
||||
end_date=competition["end_date"],
|
||||
type=competition["type"],
|
||||
participation_type=competition["participation_type"],
|
||||
)
|
||||
try:
|
||||
competition_obj = Competition.objects.create(
|
||||
title=competition["title"],
|
||||
description=competition["description"],
|
||||
start_date=competition["start_date"],
|
||||
end_date=competition["end_date"],
|
||||
type=competition["type"],
|
||||
participation_type=competition["participation_type"],
|
||||
)
|
||||
except Exception as e:
|
||||
print(competition)
|
||||
|
||||
if competition.get("image"):
|
||||
competition_obj.image_url = competition["image"]
|
||||
|
||||
@@ -91,7 +91,7 @@ class CompetitionTask(BaseModel):
|
||||
raise ValidationError({
|
||||
"correct_answer_file": "Загрузите правильный ответ"
|
||||
})
|
||||
|
||||
|
||||
# if self.answer_file_path and not self.type == "checker":
|
||||
# raise ValidationError({
|
||||
# "type": "Укажите другой тип задания: этот не совместим с путем правильного ответа"
|
||||
@@ -100,7 +100,7 @@ class CompetitionTask(BaseModel):
|
||||
raise ValidationError({
|
||||
"answer_file_path": "Введите путь правильного ответа - это нужно для корректной работы чекера"
|
||||
})
|
||||
|
||||
|
||||
if not self.reviewers and self.type == "review":
|
||||
raise ValidationError({
|
||||
"reviewers": "Загрузите ревьюверов - кто будет проверять задания, если не они?"
|
||||
@@ -110,7 +110,6 @@ class CompetitionTask(BaseModel):
|
||||
# "type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным"
|
||||
# })
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
@@ -150,9 +149,16 @@ class CompetitionTaskAttachment(BaseModel):
|
||||
related_name="attachments",
|
||||
)
|
||||
file = models.FileField(upload_to=file_upload_at, verbose_name="файл")
|
||||
bind_at = models.CharField(verbose_name="путь сохранения", max_length=255,
|
||||
validators=[RegexValidator(r"^(?:[a-zA-Z]:\\(?:[^<>:\"\/\\|?*]*\\)*|/(?:[^<>:\"\/\\|?*]+/?)*)$",
|
||||
message="Введите абсолютный путь до папки")])
|
||||
bind_at = models.CharField(
|
||||
verbose_name="путь сохранения",
|
||||
max_length=255,
|
||||
validators=[
|
||||
RegexValidator(
|
||||
r"^(?:[a-zA-Z]:\\(?:[^<>:\"\/\\|?*]*\\)*|/(?:[^<>:\"\/\\|?*]+/?)*)$",
|
||||
message="Введите абсолютный путь до папки",
|
||||
)
|
||||
],
|
||||
)
|
||||
public = models.BooleanField(default=False, verbose_name="публичный")
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user