Skip to content

Commit cd94071

Browse files
committed
Показывать выбранного студента и задачу даже с включенным фильтром решений
1 parent d37272d commit cd94071

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hwproj.front/src/components/Solutions/StudentSolutionsPage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ const StudentSolutionsPage: FC = () => {
121121
})
122122

123123
const taskSolutionsStats = showOnlyUnrated
124-
? allTaskSolutionsStats.filter(x => x.countUnratedSolutions && x.countUnratedSolutions > 0)
124+
? allTaskSolutionsStats.filter(x => x.taskId == +currentTaskId || x.countUnratedSolutions && x.countUnratedSolutions > 0)
125125
: allTaskSolutionsStats
126126

127127
const studentSolutionsPreviews =
128128
taskStudentsSolutionsPreview.map(x => showOnlyUnrated
129129
? ({
130130
taskId: x.taskId,
131-
studentSolutionsPreview: x.studentSolutionsPreview.filter(((_, i) => {
131+
studentSolutionsPreview: x.studentSolutionsPreview.filter(((data, i) => {
132+
if (data.student.userId === currentStudentId) return true
132133
const lastSolution = currentTaskSolutions[i].lastSolution
133134
return lastSolution && lastSolution.state === SolutionState.NUMBER_0
134135
}))

0 commit comments

Comments
 (0)