Skip to content

Закрепление домашних работ за студентами#663

Open
semrosin wants to merge 99 commits intomasterfrom
group-homeworks-feature
Open

Закрепление домашних работ за студентами#663
semrosin wants to merge 99 commits intomasterfrom
group-homeworks-feature

Conversation

@semrosin
Copy link
Copy Markdown
Contributor

@semrosin semrosin commented Apr 4, 2026

Данный PR добавляет функциональность закрепления домашнего задания за группой студентов.

Интерфейс

  • Создание (изменение) групп студентов в отдельной вкладке при создании (изменении) домашней работы. Домашка будет отображаться только студентам, добавленным в эту группу
group_creation image Screenshot 2026-04-16 181827
  • Информация о количестве студентов, еще не состоящих в группах, на главной странице курса:
image
  • Отображение в таблице решений:
Screenshot 2026-04-16 182438

Архитектура решения:

  • Все домашки, закрепленные за группами, добавляются в глобальный (для курса) фильтр
  • Домашняя работа, закрепленная за группой, добавляется в фильтр группы
  • Глобальный фильтр применяется ко всем студентам при получении информации о курсе, удаляя групповые домашки из возвращаемого значения курса
  • Затем применяются фильтры групп курса, в которых состоит студент, добавляющие к курсу домашки этих групп

semrosin added 30 commits March 28, 2026 12:47
@semrosin semrosin force-pushed the group-homeworks-feature branch from 714f8b1 to b398355 Compare April 13, 2026 10:37
Comment on lines +98 to +106
var groupFilter = await _courseFilterRepository.GetAsync(groupId.ToString(), group.CourseId);
if (groupFilter != null)
{
groupFilter.Filter.StudentIds = updatedStudentIds.ToList();
await _courseFilterRepository.UpdateAsync(groupFilter.Id, f => new CourseFilter
{
FilterJson = groupFilter.FilterJson
});
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно ли это?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется да, потому что можно изменить группу, не изменив при этом саму домашку, то есть UpdateGroupFilters не вызовется. Скорее, там стоит убрать

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если меняется группа, то в фильтрах менять ничего не нужно

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда получается нет смысла хранить в фильтре членов группы?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если сейчас это не требуется и никак не используется, то необязательно

var isCourseStudent = course.AcceptedStudents.Any(t => t.StudentId == userId);

// Получаем группы пользователя, чтобы найти фильтры для них
var studentGroups = await _groupsService.GetStudentGroupsAsync(course.Id, userId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

группы можно получить из самого курса

Comment on lines +106 to +110
foreach (var group in studentGroups)
{
if (courseFilters.TryGetValue(group.Id.ToString(), out var groupCourseFilter))
studentCourse = ApplyFilterInternal(course, studentCourse, groupCourseFilter, ApplyFilterOperation.Union);
}
Copy link
Copy Markdown
Contributor

@DedSec256 DedSec256 Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно записать через Linq.Aggregate

Comment thread hwproj.front/src/api/ApiSingleton.ts
Comment thread hwproj.front/src/components/Courses/StudentStats.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Закрепление задач за студентами

2 participants