Skip to content

Commit 119f03f

Browse files
authored
Merge pull request #53 from F-Code-Project-Mini/chore/fix-bug
Chore/fix bug
2 parents b0df38b + 34673ec commit 119f03f

6 files changed

Lines changed: 41 additions & 151 deletions

File tree

backend/src/configs/socket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const initSocket = (server: http.Server) => {
1414
io.on("connection", (socket) => {
1515
socket.on("SAVE_SCORE", async (payload) => {
1616
// if (payload.score == "" && payload.note == "") return;
17-
// if (payload.score == "") payload.score = "0";
17+
if (payload.score <= 0 && payload.note == "") return;
1818
console.log("payload:", payload.score);
1919

2020
try {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const BadgeLeader = () => {
2+
return <span className="text-primary bg-primary/10 rounded-md px-2 py-0.5 text-xs font-medium">Trưởng nhóm</span>;
3+
};
4+
5+
export default BadgeLeader;

frontend/src/pages/Candidate/Members.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import NotifyNotLeader from "~/components/NotifyNotLeader";
22
import type { TeamType } from "~/types/team.types";
33
import { ChangeNameTeam } from "./ChangeNameTeam";
44
import useAuth from "~/hooks/useAuth";
5+
import BadgeLeader from "~/components/BadgeLeader";
56

67
const Members = ({ data }: { data: TeamType | undefined }) => {
78
const candidates = data?.candidates;
@@ -84,11 +85,7 @@ const Members = ({ data }: { data: TeamType | undefined }) => {
8485
>
8586
<div className="flex items-center gap-2">
8687
{user.fullName}
87-
{isLeader && (
88-
<span className="text-primary bg-primary/10 rounded-md px-2 py-0.5 text-xs font-medium">
89-
Trưởng nhóm
90-
</span>
91-
)}
88+
{isLeader && <BadgeLeader />}
9289
</div>
9390
<p className="mt-0.5 text-xs text-gray-600">Ngành: {member.major}</p>
9491
{!user.isConfirm && (

frontend/src/pages/Judge/Barem/index.tsx

Lines changed: 3 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -7,137 +7,13 @@ const baremJudge = [
77
target: "Trang phục",
88
partitions: [
99
{
10-
criteria: "Trang phục phù hợp.",
11-
description: `Lịch sự, gọn gàng, phù hợp với tính chất học thuật của buổi thuyết trình. <br/>
12-
(<span class="font-bold">Trừ 1 điểm</span> cho trường hợp mặc quần/ váy ngắn trên đầu gối; mang dép)`,
10+
criteria: "x",
11+
description: `Lxxxxxxxxxxxxxxxxxxxxxxxx <br/>
12+
(<span class="font-bold">Trừ 1 điểm</span>xxxx`,
1313
maxScore: 3,
1414
},
1515
],
1616
},
17-
{
18-
target: "Thái độ",
19-
partitions: [
20-
{
21-
criteria: "Tác phong chuyên nghiệp",
22-
description:
23-
"Thể hiện sự tôn trọng, lịch sự, đúng mực với giám khảo (chào hỏi, phản ứng tích cực khi bị hỏi khó, thái độ bình tĩnh).",
24-
maxScore: 10,
25-
},
26-
{
27-
criteria: "Tiếp nhận ý kiến từ BGK",
28-
description: `Sẵn sàng tiếp nhận và thực hiện lời phê bình mang tính xây dựng; không né tránh, phản ứng tích cực khi được hỏi. <br/>
29-
(<span class="font-bold">0 điểm</span> nếu đổ lỗi cho người khác hoặc biện minh thay vì nhận trách nhiệm)`,
30-
maxScore: 5,
31-
},
32-
{
33-
criteria: "Đến đúng giờ",
34-
description: `<span class="font-bold">2 điểm</span> nếu đúng giờ.<br/>
35-
<span class="font-bold">1 điểm</span> nếu đến trễ và đã thông báo cho CLB từ trước.<br/>
36-
<span class="font-bold">0 điểm</span> nếu đến trễ nhưng không thông báo với CLB từ trước.`,
37-
maxScore: 2,
38-
},
39-
{
40-
criteria: "Tự tin thuyết trình",
41-
description: "Giữ phong thái tự tin, giọng nói rõ ràng, tốc độ nói hợp lý.",
42-
maxScore: 5,
43-
},
44-
{
45-
criteria: "Thuyết trình mà không cần script",
46-
description: `Thuyết trình tự nhiên, không cầm điện thoại, nhìn giấy.<br/>
47-
(<span class="font-bold">Trừ 2 điểm</span> cho trường hợp cầm điện thoại, giấy / nhìn chú thích trên slide quá nhiều)`,
48-
maxScore: 5,
49-
},
50-
],
51-
},
52-
{
53-
target: "Khả năng thuyết trình",
54-
partitions: [
55-
{
56-
criteria: "Eye contact",
57-
description: `Giao tiếp bằng ánh mắt với giám khảo, tạo sự kết nối.<br/>
58-
<span class="font-bold">2 điểm</span>: Ứng viên tương tác ít nhất 70% tổng thời lượng thuyết trình của mình<br/>
59-
<span class="font-bold">1 điểm</span>: Tương tác ít nhất 30%<br/>
60-
<span class="font-bold">0 điểm</span>: Cho các trường hợp còn lại`,
61-
maxScore: 2,
62-
},
63-
{
64-
criteria: "Body language",
65-
description: "Cử chỉ, điệu bộ tự nhiên, phù hợp với nội dung nói; không gò bó, không thừa động tác.",
66-
maxScore: 2,
67-
},
68-
{
69-
criteria: "Lưu loát, mạch lạc, rõ ràng, ngắn gọn và hấp dẫn.",
70-
description:
71-
"Bài nói có cấu trúc logic, xen lẫn cảm xúc hoặc ví dụ thực tế giúp tăng tính thuyết phục.",
72-
maxScore: 5,
73-
},
74-
],
75-
},
76-
{
77-
target: "Teamwork",
78-
partitions: [
79-
{
80-
criteria: "Hỗ trợ thành viên trong nhóm",
81-
description: `Lắng nghe, ra hiệu, giúp đỡ khi thành viên khác gặp sự cố (slide sai, quên ý...).<br/>
82-
Cần <span class="font-bold">trừ điểm mạnh tay</span> những trường hợp sử dụng điện thoại, làm việc riêng,... trong khi những người khác đang thuyết trình<br/>
83-
Chú đề <span class="font-bold">đáng nổi không khác gì <span class="text-red-500">quá 30s</span> mà nhóm không phát hiện hoặc bị BGK nhắc nhở thì từ cả nhóm cốt nạy.<br/>
84-
Nếu nhóm</span> thuyết trình tốt, không cần hỗ trợ thì full điểm.`,
85-
maxScore: 5,
86-
},
87-
{
88-
criteria: "Ăn ý trong trình bày",
89-
description: `Giúp đỡ thành viên khác khi không trả lời được câu hỏi.<br/>
90-
(<span class="font-bold">Trừ 2 điểm</span> nếu từ ý xen vào khi người khác đang trả lời kể cả đang trả lời sai)`,
91-
maxScore: 5,
92-
},
93-
{
94-
criteria: "Chuyển slide giữa các phần với nhau.",
95-
description: `Khi xong phần thuyết trình mời bạn kế tiếp lên để tiếp tục. (VD: Đến đây phần thuyết trình của em đã hết, e xin mời bạn ABC lên trình bài nội dung XYZ)`,
96-
maxScore: 5,
97-
},
98-
{
99-
criteria: "Nắm vững phần trình bày của bạn thân",
100-
description: "BGK xem qua yêu cầu để tái của ứng viên và quan sát ứng viên trình bày.",
101-
maxScore: 10,
102-
},
103-
],
104-
},
105-
{
106-
target: "Kiến thức và Tư duy phản biện",
107-
partitions: [
108-
{
109-
criteria: "Giải thích được các kiến thức phức tạp một cách dễ hiểu, rõ ràng và ngắn gọn",
110-
description: "",
111-
maxScore: 10,
112-
},
113-
{
114-
criteria: "Trả lời câu hỏi của giám khảo cách để hiểu, rõ ràng, không lạm man",
115-
description: "",
116-
maxScore: 10,
117-
},
118-
{
119-
criteria: "Phản biện, thuyết phục được BGK.",
120-
description: `Dựa ra vị dụ thực tế hoặc 1 lý do nào đó để bảo vệ câu trả lời của mình và thuyết phục được BGK. (<span class="font-bold">Chú ý thái độ ứng viên</span>)`,
121-
maxScore: 10,
122-
},
123-
{
124-
criteria: "Nắm được tổng quát nội dung của cả nhóm",
125-
description: `Trong lúc thuyết trình, ứng viên có liên hệ hoặc nhắc đến nội dung của các thành viên khác trong nhóm.<br/>
126-
(<span class="font-bold">BGK có thể đặt câu hỏi về phần trình bày của bạn khác để kiểm tra mức độ hiểu và nắm bắt tổng thể của ứng viên.</span>)`,
127-
maxScore: 2,
128-
},
129-
],
130-
},
131-
{
132-
target: "Năng khiếu khác",
133-
partitions: [
134-
{
135-
criteria: "Đây là điểm cộng. Do BGK tự quyết định",
136-
description: `BGK căn ghi rõ lý do hoặc tiêu chí được cộng điểm (<span class="font-bold">ví dụ: sáng tạo, phong thái ấn tượng, xử lý tình huống tốt...</span>)`,
137-
maxScore: 4,
138-
},
139-
],
140-
},
14117
];
14218

14319
const JudgeBaremPage = () => {

frontend/src/pages/Mentor/Barem/index.tsx

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { socket } from "~/utils/socket";
99
import useAuth from "~/hooks/useAuth";
1010
import type { CandidateType } from "~/types/team.types";
1111
import { BadgeCheck } from "lucide-react";
12+
import BadgeLeader from "~/components/BadgeLeader";
1213
type ParamsBarem = {
1314
id: string;
1415
candidateId?: string;
@@ -33,6 +34,8 @@ const MentorBaremPage = () => {
3334
},
3435
enabled: !!params.id,
3536
});
37+
const isLeader = params?.candidateId === candidates?.leader.id;
38+
// console.log("isLeader", params?.candidateId, isLeader);
3639

3740
const [candidateActive, setcandidateActive] = useState<CandidateType | undefined>(undefined);
3841

@@ -88,6 +91,9 @@ const MentorBaremPage = () => {
8891

8992
const totalMaxScore =
9093
baremMentor?.reduce((sum, item) => {
94+
if (!isLeader && item.target == "Leader") {
95+
return sum;
96+
}
9197
return (
9298
sum +
9399
item.partitions.reduce((partSum, partition) => {
@@ -212,9 +218,12 @@ const MentorBaremPage = () => {
212218
<section className="my-6" id="barem-table">
213219
<div className="overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xs">
214220
<div className="border-b border-gray-200 bg-gradient-to-r from-gray-50 to-white px-4 py-4 sm:px-6">
215-
<h2 className="text-base font-bold text-gray-900 sm:text-lg">
216-
ỨNG VIÊN: <span className="text-primary">{candidateActive?.user.fullName}</span>
217-
</h2>
221+
<div className="flex items-center gap-2">
222+
<h2 className="text-base font-bold text-gray-900 sm:text-lg">
223+
ỨNG VIÊN: <span className="text-primary">{candidateActive?.user.fullName}</span>
224+
</h2>
225+
{isLeader && <BadgeLeader />}
226+
</div>
218227
<p className="mt-1 text-xs text-gray-500 sm:text-sm">
219228
Vui lòng nhập điểm cho từng tiêu chí dưới đây
220229
</p>
@@ -249,6 +258,9 @@ const MentorBaremPage = () => {
249258
(sum, partition) => sum + (partition.partitions?.length || 0),
250259
0,
251260
);
261+
if (!isLeader && item.target == "Leader") {
262+
return null;
263+
}
252264

253265
return item.partitions.flatMap((partition, partitionIndex) => {
254266
const subPartitions = partition.partitions || [];
@@ -357,16 +369,19 @@ const MentorBaremPage = () => {
357369

358370
const TotalScore = ({ totalCurrentScore, totalMaxScore }: { totalCurrentScore: number; totalMaxScore: number }) => (
359371
<div className="my-6 flex flex-col gap-4 rounded-lg border border-gray-200 bg-white p-4 shadow-xs sm:flex-row sm:items-center sm:justify-between sm:p-6">
360-
<div className="flex items-baseline gap-2">
361-
<span className="text-md font-semibold text-gray-700 sm:text-lg">Tổng điểm:</span>
362-
<span
363-
className={`${
364-
totalCurrentScore <= totalMaxScore ? "text-primary" : "text-red-600"
365-
} text-2xl font-bold sm:text-3xl`}
366-
>
367-
{totalCurrentScore.toFixed(1)}
368-
</span>
369-
<span className="text-lg font-medium text-gray-600">/ {totalMaxScore}</span>
372+
<div>
373+
<div className="flex items-baseline gap-2">
374+
<span className="text-md font-semibold text-gray-700 sm:text-lg">Tổng điểm:</span>
375+
<span
376+
className={`${
377+
totalCurrentScore <= totalMaxScore ? "text-primary" : "text-red-600"
378+
} text-2xl font-bold sm:text-3xl`}
379+
>
380+
{totalCurrentScore.toFixed(1)}
381+
</span>
382+
<span className="text-lg font-medium text-gray-600">/ {totalMaxScore}</span>
383+
</div>
384+
<span className="text-xs italic">Leader luôn cao hơn member tối đa là 15đ</span>
370385
</div>
371386
<span className="font-bold italic">Điểm được lưu tự động</span>
372387
</div>

frontend/src/pages/Mentor/Team.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { TeamType } from "~/types/team.types";
66
import NotifyNotLeader from "~/components/NotifyNotLeader";
77
import { ShowTopic } from "../Candidate/ShowTopic";
88
import Helper from "~/utils/helper";
9+
import BadgeLeader from "~/components/BadgeLeader";
910
const Team = ({ team }: { team: TeamType }) => {
1011
return (
1112
<section className="col-span-1 lg:col-span-8" id="members">
@@ -84,11 +85,7 @@ const Team = ({ team }: { team: TeamType }) => {
8485
>
8586
<div className="flex items-center gap-2">
8687
{user.fullName}
87-
{isLeader && (
88-
<span className="text-primary bg-primary/10 rounded-md px-2 py-0.5 text-xs font-medium">
89-
Trưởng nhóm
90-
</span>
91-
)}
88+
{isLeader && <BadgeLeader />}
9289
</div>
9390
<p className="mt-0.5 text-xs text-gray-600">Ngành: {member.major}</p>
9491
{!user.isConfirm && (

0 commit comments

Comments
 (0)