From 40f65e5e553ca2499ff70bdd293be7861427d6d3 Mon Sep 17 00:00:00 2001 From: Timur Date: Mon, 3 Mar 2025 23:12:57 +0300 Subject: [PATCH 1/4] make checker simplier --- services/backend/apps/task/models.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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): From 94672a6fdb3862c4e84c7a6e4ebd43a19b7c89f0 Mon Sep 17 00:00:00 2001 From: rngsurrounded Date: Tue, 4 Mar 2025 05:32:29 +0900 Subject: [PATCH 2/4] fix --- .../CompetitionSession/components/TaskContent/index.tsx | 9 +-------- services/frontend/src/pages/CompetitionSession/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 9 deletions(-) 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..9208099 100644 --- a/services/frontend/src/pages/CompetitionSession/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/index.tsx @@ -69,7 +69,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 From 8de84c82d17ead7eea563c04aaa8c6cb2034f3c2 Mon Sep 17 00:00:00 2001 From: rngsurrounded Date: Tue, 4 Mar 2025 05:35:51 +0900 Subject: [PATCH 3/4] fix --- services/frontend/src/components/layout/header.tsx | 1 - .../Competitions/components/CompetitionCard/index.tsx | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) 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/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 && (
From edfa6f9ec822c6f4ea1caea92d42b45d951e7a1f Mon Sep 17 00:00:00 2001 From: rngsurrounded Date: Tue, 4 Mar 2025 05:50:58 +0900 Subject: [PATCH 4/4] minor fixes --- services/frontend/src/pages/CompetitionSession/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/services/frontend/src/pages/CompetitionSession/index.tsx b/services/frontend/src/pages/CompetitionSession/index.tsx index 9208099..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) => {