diff --git a/services/backend/apps/task/models.py b/services/backend/apps/task/models.py index ffb3c08..435f5b3 100644 --- a/services/backend/apps/task/models.py +++ b/services/backend/apps/task/models.py @@ -82,20 +82,20 @@ class CompetitionTask(BaseModel): def clean(self): super().clean() - if self.correct_answer_file and self.type not in ["checker", "input"]: - raise ValidationError({ - "type": "Если загружен файл правильного ответа, то тип проверки не может быть ручным" - }) - elif not self.correct_answer_file and self.type == "review": + # if self.correct_answer_file and self.type not in ["checker", "input"]: + # raise ValidationError({ + # "type": "Если загружен файл правильного ответа, то тип проверки не может быть ручным" + # }) + if not self.correct_answer_file and self.type != "review": raise ValidationError({ "correct_answer_file": "Загрузите правильный ответ" }) - if self.answer_file_path and not self.type == "checker": - raise ValidationError({ - "type": "Укажите другой тип задания: этот не совместим с путем правильного ответа" - }) - elif not self.answer_file_path and self.type == "checker": + # if self.answer_file_path and not self.type == "checker": + # raise ValidationError({ + # "type": "Укажите другой тип задания: этот не совместим с путем правильного ответа" + # }) + if not self.answer_file_path and self.type == "checker": raise ValidationError({ "answer_file_path": "Введите путь правильного ответа - это нужно для корректной работы чекера" }) @@ -104,10 +104,10 @@ class CompetitionTask(BaseModel): raise ValidationError({ "reviewers": "Загрузите ревьюверов - кто будет проверять задания, если не они?" }) - elif self.reviewers and not self.type == "review": - raise ValidationError({ - "type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным" - }) + # elif self.reviewers and not self.type == "review": + # raise ValidationError({ + # "type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным" + # }) def __str__(self): diff --git a/services/frontend/src/components/layout/header.tsx b/services/frontend/src/components/layout/header.tsx index 0563f7d..3bc9470 100644 --- a/services/frontend/src/components/layout/header.tsx +++ b/services/frontend/src/components/layout/header.tsx @@ -55,7 +55,6 @@ export const Header = () => {
- Материалы diff --git a/services/frontend/src/pages/CompetitionSession/components/TaskContent/index.tsx b/services/frontend/src/pages/CompetitionSession/components/TaskContent/index.tsx index 634a7a0..7909578 100644 --- a/services/frontend/src/pages/CompetitionSession/components/TaskContent/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/components/TaskContent/index.tsx @@ -25,14 +25,7 @@ const TaskContent: React.FC = ({ task }) => { const attachments = attachmentsQuery.data || []; - const convertToMarkdown = (text: string): string => { - if (!text) return ''; - - let markdown = text.replace(/\n/g, '\n\n'); - return markdown; - }; - const markdownText = convertToMarkdown(task.description); return (
@@ -45,7 +38,7 @@ const TaskContent: React.FC = ({ task }) => { remarkPlugins={[remarkMath, remarkGfm]} rehypePlugins={[rehypeKatex]} > - {markdownText} + {task.description}
diff --git a/services/frontend/src/pages/CompetitionSession/index.tsx b/services/frontend/src/pages/CompetitionSession/index.tsx index 4f92cae..15cf56f 100644 --- a/services/frontend/src/pages/CompetitionSession/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/index.tsx @@ -60,7 +60,6 @@ const CompetitionSession = () => { setTimeout(() => { window.location.reload(); - setIsReloading(false); }, 2500); }, onError: (error) => { @@ -69,7 +68,9 @@ const CompetitionSession = () => { }); const competition = competitionQuery.data; - const tasks = tasksQuery.data || []; + const tasks = [...(tasksQuery.data || [])].sort((a, b) => { + return a.in_competition_position - b.in_competition_position; + }); const results = resultsQuery.data || []; const isLoading = tasksQuery.isLoading || competitionQuery.isLoading; const error = tasksQuery.error || competitionQuery.error diff --git a/services/frontend/src/pages/Competitions/components/CompetitionCard/index.tsx b/services/frontend/src/pages/Competitions/components/CompetitionCard/index.tsx index ddbc19b..8f257b8 100644 --- a/services/frontend/src/pages/Competitions/components/CompetitionCard/index.tsx +++ b/services/frontend/src/pages/Competitions/components/CompetitionCard/index.tsx @@ -32,9 +32,9 @@ export function CompetitionCard({ return ( -
+
{competition.title}
- -
+ +
{competition.type === CompetitionType.COMPETITIVE @@ -67,7 +67,7 @@ export function CompetitionCard({ {competition.type === CompetitionType.COMPETITIVE && ( -
+
{competition.start_date && (