mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
Merge branch 'master' of gitlab.prodcontest.ru:team-15/project
This commit is contained in:
+14
-12
@@ -1,4 +1,3 @@
|
||||
// src/components/competition/CompetitionResultsModal.tsx
|
||||
import React from 'react';
|
||||
import {
|
||||
Dialog,
|
||||
@@ -12,7 +11,8 @@ import { Loader2 } from 'lucide-react';
|
||||
export interface CompetitionResult {
|
||||
task_name: string;
|
||||
result: number;
|
||||
max_points: number
|
||||
max_points: number;
|
||||
position: number;
|
||||
}
|
||||
|
||||
interface CompetitionResultsModalProps {
|
||||
@@ -111,17 +111,19 @@ export const CompetitionResultsModal: React.FC<CompetitionResultsModalProps> = (
|
||||
Произошла ошибка при загрузке результатов
|
||||
</div>
|
||||
) : results && results.length > 0 ? (
|
||||
results.map((result, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex flex-col md:flex-row justify-between items-start md:items-center p-4 bg-gray-50 rounded-lg border"
|
||||
>
|
||||
<div className="font-medium mb-2 md:mb-0">{result.task_name}</div>
|
||||
<div className="text-right">
|
||||
{renderResultValue(result.result, result.max_points)}
|
||||
[...results]
|
||||
.sort((a, b) => a.position - b.position)
|
||||
.map((result, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex flex-col md:flex-row justify-between items-start md:items-center p-4 bg-gray-50 rounded-lg border"
|
||||
>
|
||||
<div className="font-medium mb-2 md:mb-0">{result.task_name}</div>
|
||||
<div className="text-right">
|
||||
{renderResultValue(result.result, result.max_points)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
))
|
||||
) : (
|
||||
<div className="text-center py-6 text-gray-500">
|
||||
Нет доступных результатов
|
||||
|
||||
+105
-11
@@ -1,6 +1,13 @@
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import * as monaco from 'monaco-editor';
|
||||
import { Copy, Check } from 'lucide-react';
|
||||
import { Copy, Check, Info } from 'lucide-react';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
interface CodeSolutionProps {
|
||||
answer: string;
|
||||
@@ -92,16 +99,103 @@ const CodeSolution: React.FC<CodeSolutionProps> = ({
|
||||
<div className="bg-white rounded-lg overflow-hidden border border-gray-200">
|
||||
<div className="flex items-center justify-between bg-gray-50 px-4 py-2 border-b border-gray-200">
|
||||
<div className="text-sm font-medium text-gray-600">{languageDisplay}</div>
|
||||
<button
|
||||
onClick={copyToClipboard}
|
||||
className="flex items-center text-sm text-gray-500 hover:text-gray-700 transition-colors"
|
||||
>
|
||||
{copied ? (
|
||||
<Check className="w-4 h-4 mr-1" />
|
||||
) : (
|
||||
<Copy className="w-4 h-4 mr-1" />
|
||||
)}
|
||||
</button>
|
||||
<div className="flex items-center space-x-3">
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<button
|
||||
className="flex items-center text-sm text-gray-500 hover:text-gray-700 transition-colors"
|
||||
title="Информация о среде выполнения"
|
||||
>
|
||||
<Info className="w-4 h-4" />
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-xl font-semibold">Информация о среде выполнения</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="mt-4 space-y-6">
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold mb-3 border-b pb-2">Ограничение ресурсов</h3>
|
||||
<ul className="space-y-3 text-gray-700">
|
||||
<li className="flex items-start">
|
||||
<div className="bg-yellow-100 p-1.5 rounded-full mr-3 mt-0.5">
|
||||
<div className="w-1.5 h-1.5 bg-yellow-500 rounded-full"></div>
|
||||
</div>
|
||||
Максимум 1 посылка в 10 секунд
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<div className="bg-yellow-100 p-1.5 rounded-full mr-3 mt-0.5">
|
||||
<div className="w-1.5 h-1.5 bg-yellow-500 rounded-full"></div>
|
||||
</div>
|
||||
Максимальный размер решения 4MB
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<div className="bg-yellow-100 p-1.5 rounded-full mr-3 mt-0.5">
|
||||
<div className="w-1.5 h-1.5 bg-yellow-500 rounded-full"></div>
|
||||
</div>
|
||||
Максимальное время работы программы 1 минута
|
||||
</li>
|
||||
<li className="flex items-start">
|
||||
<div className="bg-yellow-100 p-1.5 rounded-full mr-3 mt-0.5">
|
||||
<div className="w-1.5 h-1.5 bg-yellow-500 rounded-full"></div>
|
||||
</div>
|
||||
Выделяется 512MB на решение
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold mb-3 border-b pb-2">Доступные библиотеки</h3>
|
||||
<div className="bg-gray-50 p-4 rounded-md font-mono text-sm">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">pandas</span>
|
||||
<span className="text-gray-500 ml-2">2.2.3</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">numpy</span>
|
||||
<span className="text-gray-500 ml-2">2.2.3</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">matplotlib</span>
|
||||
<span className="text-gray-500 ml-2">3.10.1</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">scipy</span>
|
||||
<span className="text-gray-500 ml-2">1.15.2</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">scikit-learn</span>
|
||||
<span className="text-gray-500 ml-2">1.6.1</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">seaborn</span>
|
||||
<span className="text-gray-500 ml-2">0.13.2</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-yellow-600 font-semibold">statsmodels</span>
|
||||
<span className="text-gray-500 ml-2">0.14.4</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<button
|
||||
onClick={copyToClipboard}
|
||||
className="flex items-center text-sm text-gray-500 hover:text-gray-700 transition-colors"
|
||||
title="Копировать код"
|
||||
>
|
||||
{copied ? (
|
||||
<Check className="w-4 h-4" />
|
||||
) : (
|
||||
<Copy className="w-4 h-4" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-4">
|
||||
|
||||
@@ -155,10 +155,10 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
||||
? 'bg-blue-50 text-blue-700'
|
||||
: 'bg-red-50 text-red-700'}`}
|
||||
>
|
||||
{hasSubmissionsLeft ? (
|
||||
{maxAttempts === -1 || hasSubmissionsLeft ? (
|
||||
<>
|
||||
<span className="font-medium">
|
||||
Осталось посылок: {submissionsLeft === Infinity ? '∞' : submissionsLeft}
|
||||
Осталось посылок: {maxAttempts === -1 ? '∞' : submissionsLeft}
|
||||
</span>
|
||||
{maxAttempts !== -1 && (
|
||||
<span className="text-blue-500 ml-1">
|
||||
|
||||
Reference in New Issue
Block a user