Skip to content

Commit f14f8ab

Browse files
committed
StudentStats: исправление для сгруппированных кр
1 parent affebfe commit f14f8ab

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

hwproj.front/src/components/Courses/StudentStats.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,15 @@ const StudentStats: React.FC<IStudentStatsProps> = (props) => {
106106

107107
const notTests = homeworks.filter(h => !h.tags!.includes(TestTag))
108108

109-
const testHomeworks = homeworks.filter(h => h.tags!.includes(TestTag))
110-
const testGroups = Lodash(testHomeworks)
109+
const testGroups = Lodash(homeworks.filter(h => h.tags!.includes(TestTag)))
111110
.groupBy((h: HomeworkViewModel) => {
112111
const key = h.tags!.find(t => !DefaultTags.includes(t))
113112
return key || h.id!.toString();
114113
})
115114
.values()
116115
.value();
116+
117+
const testHomeworks = testGroups.map(x => x[0])
117118

118119
const homeworksWithGroups = notTests.filter(h => h.groupId)
119120
const testsWithGroups = testHomeworks.filter(t => t.groupId != undefined)

0 commit comments

Comments
 (0)