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, fullName: s.fullName,
studentCode: s.studentCode, studentCode: s.studentCode,
avatar: s.avatar, avatar: s.avatar,
paperTitle: s.paperTitle,
}))} }))}
onlineIds={onlineIds} onlineIds={onlineIds}
onStudentClick={(rkId) => { onStudentClick={(rkId) => {

View File

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