Merge branch 'master' of gitlab.prodcontest.ru:team-15/project

This commit is contained in:
ITQ
2025-03-03 00:42:32 +03:00
3 changed files with 37 additions and 33 deletions
@@ -132,6 +132,7 @@ class Command(BaseCommand):
def create_submissions(self, tasks, users):
for task in tasks:
if task.type == CompetitionTask.CompetitionTaskType.REVIEW.value:
# Each task will get between 1 and 3 submissions
num_submissions = random.randint(1, 3)
for _ in range(num_submissions):
@@ -1,9 +1,9 @@
import React from 'react';
import { Sheet, SheetClose, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet";
import { Button } from "@/components/ui/button";
import { X } from "lucide-react";
import { X, Check } from "lucide-react";
import SolutionStatus from '../SolutionStatus';
import { Solution, TaskType } from '@/shared/types/task';
import { Solution } from '@/shared/types/task';
interface SolutionHistorySheetProps {
isOpen: boolean;
@@ -11,6 +11,7 @@ interface SolutionHistorySheetProps {
solutions: Solution[];
maxPoints: number;
onSolutionSelect: (solution: Solution) => void;
currentSolutionId?: string | null;
}
const SolutionHistorySheet: React.FC<SolutionHistorySheetProps> = ({
@@ -18,7 +19,8 @@ const SolutionHistorySheet: React.FC<SolutionHistorySheetProps> = ({
onOpenChange,
solutions,
maxPoints,
onSolutionSelect
onSolutionSelect,
currentSolutionId
}) => {
return (
<Sheet open={isOpen} onOpenChange={onOpenChange}>
@@ -36,15 +38,17 @@ const SolutionHistorySheet: React.FC<SolutionHistorySheetProps> = ({
<div className="flex flex-col mt-3 space-y-2.5 overflow-y-auto max-h-[calc(100vh-80px)] px-4 pb-4">
{solutions.length > 0 ? (
solutions.map((solution, index) => (
solutions.map((solution) => (
<div
key={solution.id || index}
className="w-full cursor-pointer transition-transform hover:scale-[1.01]"
onClick={() => {
onSolutionSelect(solution);
onOpenChange(false);
}}
key={solution.id}
className={`w-full cursor-pointer relative ${solution.id === currentSolutionId ? 'ring-2 ring-blue-500 rounded-lg' : ''}`}
onClick={() => onSolutionSelect(solution)}
>
{solution.id === currentSolutionId && (
<div className="absolute top-2 right-2 z-10 bg-blue-500 text-white rounded-full p-1">
<Check size={14} />
</div>
)}
<SolutionStatus solution={solution} maxPoints={maxPoints} />
</div>
))
@@ -120,7 +120,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
fileInputRef={fileInputRef}
existingFileUrl={selectedSolutionUrl}
onClearExistingFile={handleClearExistingFile}
isLoading={isInitialLoading}
/>
)}