@@ -24,12 +24,17 @@ import {
24
24
MenuItem ,
25
25
SelectChangeEvent ,
26
26
Pagination ,
27
+ Avatar ,
28
+ Stack ,
27
29
} from "@mui/material" ;
28
30
import {
29
31
Visibility as VisibilityIcon ,
30
32
Refresh as RefreshIcon ,
31
33
Search as SearchIcon ,
32
34
Sort as SortIcon ,
35
+ Person as PersonIcon ,
36
+ School as SchoolIcon ,
37
+ Book as BookIcon ,
33
38
} from "@mui/icons-material" ;
34
39
35
40
import {
@@ -94,7 +99,16 @@ const TestAttemptsList: FC = () => {
94
99
attemptsData ?. testAttemptsAll ?. items ?. filter ( ( attempt ) => {
95
100
if ( ! attempt ) return false ;
96
101
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
+ }
98
112
99
113
return true ;
100
114
} ) || [ ] ;
@@ -158,7 +172,7 @@ const TestAttemptsList: FC = () => {
158
172
< Grid item xs = { 12 } md = { 4 } >
159
173
< TextField
160
174
fullWidth
161
- label = "Поиск по ID попытки "
175
+ label = "Поиск по студенту, курсу или лекции "
162
176
value = { searchTerm }
163
177
onChange = { ( e ) => setSearchTerm ( e . target . value ) }
164
178
InputProps = { {
@@ -239,11 +253,12 @@ const TestAttemptsList: FC = () => {
239
253
< Table >
240
254
< TableHead >
241
255
< TableRow >
242
- < TableCell > ID попытки</ TableCell >
256
+ < TableCell > Студент</ TableCell >
257
+ < TableCell > Курс</ TableCell >
258
+ < TableCell > Лекция</ TableCell >
259
+ < TableCell > Тест</ TableCell >
243
260
< TableCell > Время начала</ TableCell >
244
261
< TableCell > Время завершения</ TableCell >
245
- < TableCell > Правильных ответов</ TableCell >
246
- < TableCell > Ошибок</ TableCell >
247
262
< TableCell > Результат</ TableCell >
248
263
< TableCell > Статус</ TableCell >
249
264
< TableCell > Действия</ TableCell >
@@ -255,33 +270,83 @@ const TestAttemptsList: FC = () => {
255
270
256
271
return (
257
272
< TableRow key = { attempt . id } hover >
258
- < TableCell > { attempt . id } </ TableCell >
259
273
< 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 >
261
287
</ TableCell >
262
288
< 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 >
264
313
</ TableCell >
265
314
< 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 >
272
323
</ TableCell >
273
324
< 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 ) : "-" }
280
329
</ TableCell >
281
330
< 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 >
285
350
</ TableCell >
286
351
< TableCell >
287
352
{ attempt . result !== null ? (
0 commit comments