fix t
All checks were successful
Deploy on Master Change / deploy (push) Successful in 1m5s

This commit is contained in:
2026-07-06 10:29:08 +07:00
parent 52d62dbc96
commit 573ff17581
2 changed files with 31 additions and 2 deletions

View File

@@ -924,6 +924,7 @@ export const ExamRoomWorkspace: React.FC<Props> = ({ examId, onBack }) => {
fullName: s.fullName,
studentCode: s.studentCode,
avatar: s.avatar,
paperTitle: s.paperTitle,
}))}
onlineIds={onlineIds}
onStudentClick={(rkId) => {

View File

@@ -9,6 +9,7 @@ interface WorkspaceSeatingChartProps {
fullName: string;
studentCode: string;
avatar?: string;
paperTitle?: string;
}[];
onlineIds: number[];
onStudentClick?: (studentRkId: number) => void;
@@ -70,6 +71,11 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
);
}, [students, listSearchQuery]);
// Check if any student has an assigned exam paper
const hasPaperColumn = useMemo(() => {
return students.some((s) => s.paperTitle);
}, [students]);
// Load templates and layout
useEffect(() => {
// Load templates
@@ -397,6 +403,26 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
<span style={{ fontSize: '0.65rem', color: 'var(--text-secondary)', fontFamily: 'monospace' }}>
{student.studentCode}
</span>
{student.paperTitle && (
<span
style={{
fontSize: '0.62rem',
background: 'var(--accent-light)',
color: 'var(--accent)',
padding: '1px 4px',
borderRadius: '4px',
marginTop: '2px',
fontWeight: 600,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%'
}}
title={`Đề: ${student.paperTitle}`}
>
📄 {student.paperTitle}
</span>
)}
</div>
) : (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', opacity: 0.4 }}>
@@ -658,6 +684,7 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
<tr>
<th>Sinh viên</th>
<th> SV</th>
{hasPaperColumn && <th>Gói đ</th>}
<th>Vị trí chỗ ngồi</th>
<th>Trạng thái</th>
<th style={{ textAlign: 'right' }}>Thao tác</th>
@@ -676,6 +703,7 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
</div>
</td>
<td><code>{s.studentCode}</code></td>
{hasPaperColumn && <td>{s.paperTitle || '—'}</td>}
<td>
<span className={`badge ${studentSeats[s.rkId] ? 'badge-info' : 'badge-muted'}`}>
{seatLabel}
@@ -772,8 +800,8 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
<span style={{ fontSize: '0.8rem', fontWeight: 600, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{s.fullName}
</span>
<span style={{ fontSize: '0.7rem', color: 'var(--text-secondary)', fontFamily: 'monospace' }}>
{s.studentCode}
<span style={{ fontSize: '0.7rem', color: 'var(--text-secondary)', fontFamily: 'monospace', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{s.studentCode} {s.paperTitle && ` · 📄 ${s.paperTitle}`}
</span>
</div>
<span className={isOnline ? 'pulse-dot-online' : 'status-badge-offline'} style={{ width: '6px', height: '6px' }} />