@@ -24,12 +24,17 @@ import {
2424 MenuItem ,
2525 SelectChangeEvent ,
2626 Pagination ,
27+ Avatar ,
28+ Stack ,
2729} from "@mui/material" ;
2830import {
2931 Visibility as VisibilityIcon ,
3032 Refresh as RefreshIcon ,
3133 Search as SearchIcon ,
3234 Sort as SortIcon ,
35+ Person as PersonIcon ,
36+ School as SchoolIcon ,
37+ Book as BookIcon ,
3338} from "@mui/icons-material" ;
3439
3540import {
@@ -94,7 +99,16 @@ const TestAttemptsList: FC = () => {
9499 attemptsData ?. testAttemptsAll ?. items ?. filter ( ( attempt ) => {
95100 if ( ! attempt ) return false ;
96101
97- if ( searchTerm && ! attempt . id ?. includes ( searchTerm ) ) return false ;
102+ if ( searchTerm ) {
103+ const searchLower = searchTerm . toLowerCase ( ) ;
104+ return (
105+ attempt . id ?. toLowerCase ( ) . includes ( searchLower ) ||
106+ attempt . studentName ?. toLowerCase ( ) . includes ( searchLower ) ||
107+ attempt . trainingName ?. toLowerCase ( ) . includes ( searchLower ) ||
108+ attempt . lectureSubject ?. toLowerCase ( ) . includes ( searchLower ) ||
109+ attempt . testGroupName ?. toLowerCase ( ) . includes ( searchLower )
110+ ) ;
111+ }
98112
99113 return true ;
100114 } ) || [ ] ;
@@ -158,7 +172,7 @@ const TestAttemptsList: FC = () => {
158172 < Grid item xs = { 12 } md = { 4 } >
159173 < TextField
160174 fullWidth
161- label = "Поиск по ID попытки "
175+ label = "Поиск по студенту, курсу или лекции "
162176 value = { searchTerm }
163177 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
164178 InputProps = { {
@@ -239,11 +253,12 @@ const TestAttemptsList: FC = () => {
239253 < Table >
240254 < TableHead >
241255 < TableRow >
242- < TableCell > ID попытки</ TableCell >
256+ < TableCell > Студент</ TableCell >
257+ < TableCell > Курс</ TableCell >
258+ < TableCell > Лекция</ TableCell >
259+ < TableCell > Тест</ TableCell >
243260 < TableCell > Время начала</ TableCell >
244261 < TableCell > Время завершения</ TableCell >
245- < TableCell > Правильных ответов</ TableCell >
246- < TableCell > Ошибок</ TableCell >
247262 < TableCell > Результат</ TableCell >
248263 < TableCell > Статус</ TableCell >
249264 < TableCell > Действия</ TableCell >
@@ -255,33 +270,83 @@ const TestAttemptsList: FC = () => {
255270
256271 return (
257272 < TableRow key = { attempt . id } hover >
258- < TableCell > { attempt . id } </ TableCell >
259273 < TableCell >
260- { attempt . startTime ? formatDate ( attempt . startTime ) : "-" }
274+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
275+ < Avatar sx = { { width : 32 , height : 32 } } >
276+ < PersonIcon />
277+ </ Avatar >
278+ < Box >
279+ < Typography variant = "body2" fontWeight = "medium" >
280+ { attempt . studentName }
281+ </ Typography >
282+ < Typography variant = "caption" color = "text.secondary" >
283+ Студент
284+ </ Typography >
285+ </ Box >
286+ </ Stack >
261287 </ TableCell >
262288 < TableCell >
263- { attempt . endTime ? formatDate ( attempt . endTime ) : "-" }
289+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
290+ < SchoolIcon color = "primary" />
291+ < Box >
292+ < Typography variant = "body2" fontWeight = "medium" >
293+ { attempt . trainingName }
294+ </ Typography >
295+ < Typography variant = "caption" color = "text.secondary" >
296+ Курс
297+ </ Typography >
298+ </ Box >
299+ </ Stack >
300+ </ TableCell >
301+ < TableCell >
302+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
303+ < BookIcon color = "secondary" />
304+ < Box >
305+ < Typography variant = "body2" fontWeight = "medium" >
306+ { attempt . lectureSubject }
307+ </ Typography >
308+ < Typography variant = "caption" color = "text.secondary" >
309+ Лекция
310+ </ Typography >
311+ </ Box >
312+ </ Stack >
264313 </ TableCell >
265314 < TableCell >
266- < Chip
267- label = { attempt . successfulCount || 0 }
268- color = "success"
269- variant = "outlined"
270- size = "small"
271- />
315+ < Box >
316+ < Typography variant = "body2" fontWeight = "medium" >
317+ { attempt . testGroupName }
318+ </ Typography >
319+ < Typography variant = "caption" color = "text.secondary" >
320+ Тест
321+ </ Typography >
322+ </ Box >
272323 </ TableCell >
273324 < TableCell >
274- < Chip
275- label = { attempt . errorsCount || 0 }
276- color = "error"
277- variant = "outlined"
278- size = "small"
279- />
325+ { attempt . startTime ? formatDate ( attempt . startTime ) : "-" }
326+ </ TableCell >
327+ < TableCell >
328+ { attempt . endTime ? formatDate ( attempt . endTime ) : "-" }
280329 </ TableCell >
281330 < TableCell >
282- < Typography variant = "body2" fontWeight = "medium" >
283- { getScoreDisplay ( attempt ) }
284- </ Typography >
331+ < Box >
332+ < Typography variant = "body2" fontWeight = "medium" >
333+ { getScoreDisplay ( attempt ) }
334+ </ Typography >
335+ < Box sx = { { display : "flex" , gap : 0.5 , mt : 0.5 } } >
336+ < Chip
337+ label = { attempt . successfulCount || 0 }
338+ color = "success"
339+ variant = "outlined"
340+ size = "small"
341+ />
342+ < Chip
343+ label = { attempt . errorsCount || 0 }
344+ color = "error"
345+ variant = "outlined"
346+ size = "small"
347+ />
348+ </ Box >
349+ </ Box >
285350 </ TableCell >
286351 < TableCell >
287352 { attempt . result !== null ? (
0 commit comments