Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
3b51ebe
feat: add tab for course groups
semrosin Mar 2, 2026
15a5618
feat: add groups with names get method
semrosin Mar 4, 2026
8cb61aa
feat: add course groups api to apisingleton
semrosin Mar 4, 2026
446ed7a
feat: add course group tab prototype
semrosin Mar 4, 2026
d54c045
fix: groups ui
semrosin Mar 6, 2026
3e98254
feat: add group choose for homework
semrosin Mar 9, 2026
cb7da7a
refactor: separate group selector
semrosin Mar 10, 2026
e02de09
feat: add homework update group validation
semrosin Mar 13, 2026
707aaf3
feat: add apply filter subtractively method
semrosin Mar 13, 2026
623c274
feat: add global filter subtraction applying
semrosin Mar 13, 2026
1d255ab
feat: add filter updating for group homeworks method
semrosin Mar 13, 2026
7850406
feat: add updating filters for group homeworks
semrosin Mar 13, 2026
501c002
fix: student filters applying
semrosin Mar 22, 2026
85acdbf
fix: deleting homework
semrosin Mar 23, 2026
2a99494
feat: show non included in groups course students count
semrosin Mar 24, 2026
ae06821
refactor: union apply filter methods by creating apply filter type
semrosin Mar 26, 2026
cde8d1a
fix: parallel dbcontext access problem
semrosin Mar 27, 2026
c2b9a4b
feat: mark grouped students
semrosin Mar 27, 2026
19257f2
fix: add automap for groups
semrosin Mar 29, 2026
b6e2df0
fix: parallel access error in groups service
semrosin Mar 29, 2026
8d43277
fix: parallel access error in course filter service
semrosin Mar 29, 2026
adc7da6
fix: add hw to group mates filters on update
semrosin Mar 29, 2026
644ca77
feat: move creation groups to homework
semrosin Mar 29, 2026
be83d1a
feat: remove creation groups from groups tab
semrosin Mar 29, 2026
7d33478
fix: forbid remove student after group creation
semrosin Mar 30, 2026
3e07775
fix: only mentor can see all group homeworks
semrosin Mar 31, 2026
ebf7ba2
fix: group homework cell in stats
semrosin Apr 4, 2026
a815e53
fix: max homeworks rate counting
semrosin Apr 4, 2026
6a7f382
fix: sort homeworks after apply filter
semrosin Apr 4, 2026
03aa2a6
refactor: optimize sequantial db access for groups
semrosin Apr 4, 2026
33cf41f
feat: get many homeworks method
semrosin Apr 4, 2026
075adea
refactor: use many homeworks get method in filter service
semrosin Apr 4, 2026
9769fa9
fix: can choose only students without group
semrosin Apr 5, 2026
dc72916
refactor: students without group filter
semrosin Apr 5, 2026
1b47e5d
refactor: styles calculation
semrosin Apr 5, 2026
3a42690
feat: show max homework sum
semrosin Apr 5, 2026
686f6f6
fix: gray cell instead of red cross
semrosin Apr 5, 2026
f2dcc7d
refactor: remove excess api calls (groups in stats)
semrosin Apr 9, 2026
5377dc2
refactor: remove excess api calls (group selector)
semrosin Apr 9, 2026
719b101
refactor: rename named group type
semrosin Apr 10, 2026
e1f76f0
refactor: rename named groups type in front-end
semrosin Apr 10, 2026
d85c77f
fix: update group name
semrosin Apr 10, 2026
bdb7536
little style fix
semrosin Apr 10, 2026
328b65e
add migration with homework's group id field
semrosin Apr 10, 2026
fa9607e
refactor: union creation of selected group
semrosin Apr 11, 2026
68541fa
little style fix
semrosin Apr 11, 2026
f7226a7
wip
DedSec256 Apr 11, 2026
3f40064
refactor: create global filter id constant
semrosin Apr 11, 2026
a63f1c1
refactor: filter service responsibility
semrosin Apr 11, 2026
384ad56
Merge branch 'group-homeworks-feature' of https://github.com/InteIIig…
semrosin Apr 11, 2026
face16b
refactor: db access in groupmates filters
semrosin Apr 11, 2026
5207446
refactor: applyFilterType -> operation
semrosin Apr 11, 2026
8228af8
refactor: remove nullable group access
semrosin Apr 11, 2026
177bebd
refactor: get groupmates
semrosin Apr 11, 2026
5d339e9
refactor: return group access way in update
semrosin Apr 11, 2026
efedae4
wip
DedSec256 Apr 11, 2026
1e2de3a
wip
DedSec256 Apr 11, 2026
afe4a62
wip
DedSec256 Apr 11, 2026
eb5cd1d
wip
DedSec256 Apr 11, 2026
131448a
wip
DedSec256 Apr 11, 2026
62b8485
wip
DedSec256 Apr 12, 2026
5a72bee
wip
DedSec256 Apr 12, 2026
878b07b
wip
DedSec256 Apr 12, 2026
1a69c9f
wip
DedSec256 Apr 12, 2026
3685b72
wip
DedSec256 Apr 12, 2026
047a05b
wip
DedSec256 Apr 12, 2026
79ef2f5
wip
DedSec256 Apr 12, 2026
08928d1
wip
DedSec256 Apr 12, 2026
9589d0f
wip
DedSec256 Apr 12, 2026
eed7e01
wip
DedSec256 Apr 12, 2026
0e7d930
wip
DedSec256 Apr 12, 2026
b7c201d
wip
DedSec256 Apr 13, 2026
4ebd59d
wip
DedSec256 Apr 13, 2026
224c1e6
wip
DedSec256 Apr 13, 2026
cb451a1
wip
DedSec256 Apr 13, 2026
8cff9a0
wip
DedSec256 Apr 13, 2026
b398355
fix: rename userId -> Id in filter
semrosin Apr 13, 2026
dfd264a
fix: filter if usage
semrosin Apr 13, 2026
ef94ce4
little fix
semrosin Apr 13, 2026
90d370a
add migration
semrosin Apr 13, 2026
21930a0
feat: change to work on group filters
semrosin Apr 13, 2026
46970a1
feat: unlock remove user from group
semrosin Apr 13, 2026
19e56de
feat: print students without group on hover
semrosin Apr 13, 2026
29a0225
fix: right test sum counting
semrosin Apr 13, 2026
06120f4
refactor: use linq.aggregate
semrosin Apr 13, 2026
a4ea57f
refactor: get student groups from course
semrosin Apr 13, 2026
5c90055
refactor: simplify group filter updating
semrosin Apr 13, 2026
1d0b696
refactor: remove unnecessary updation call
semrosin Apr 13, 2026
38f25c1
Wip
DedSec256 Apr 13, 2026
b354891
wip
DedSec256 Apr 13, 2026
03531e9
wip
DedSec256 Apr 13, 2026
2b1fcd5
wip
DedSec256 Apr 13, 2026
4b1b3c2
fix: max sum counting
semrosin Apr 14, 2026
dc2f1b8
feat: add grouped students label
semrosin Apr 14, 2026
56fc639
refactor: separate student max sum calculation
semrosin Apr 14, 2026
6a414a6
refactor: simplify max sum calculation
semrosin Apr 14, 2026
05c667b
refactor: remove unused variables
semrosin Apr 15, 2026
f7f7d60
fix: group tests counting
semrosin Apr 16, 2026
6df1f78
fix: students to group counting
semrosin Apr 16, 2026
ec1b1a8
fix
DedSec256 Apr 19, 2026
31a0f59
wip
DedSec256 Apr 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ public async Task<IActionResult> AddStudentInGroup(long courseId, long groupId,
return Ok();
}

[HttpPost("{courseId}/removeStudentFromGroup/{groupId}")]
[Authorize(Roles = Roles.LecturerRole)]
public async Task<IActionResult> RemoveStudentFromGroup(long courseId, long groupId, [FromQuery] string userId)
{
await _coursesClient.RemoveStudentFromGroup(courseId, groupId, userId);
return Ok();
}

[HttpGet("get/{groupId}")]
[ProducesResponseType(typeof(GroupViewModel), (int)HttpStatusCode.OK)]
public async Task<IActionResult> GetGroup(long groupId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public async Task<IActionResult> EditMentorWorkspace(
return BadRequest("Пользователь с такой почтой не является преподавателем или экспертом");

var courseFilterModel = _mapper.Map<CreateCourseFilterDTO>(editMentorWorkspaceDto);
courseFilterModel.UserId = mentorId;
courseFilterModel.Id = mentorId;

var courseFilterCreationResult =
await _coursesClient.CreateOrUpdateCourseFilter(courseId, courseFilterModel);
Expand Down Expand Up @@ -308,6 +308,7 @@ private async Task<CourseViewModel> ToCourseViewModel(CourseDTO course)
AcceptedStudents = acceptedStudents.ToArray(),
NewStudents = newStudents.ToArray(),
Homeworks = course.Homeworks,
Groups = course.Groups,
IsCompleted = course.IsCompleted,
IsOpen = course.IsOpen
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ namespace HwProj.Models.CoursesService
{
public class CreateCourseFilterModel
{
public string UserId { get; set; }
public string Id { get; set; }

public long CourseId { get; set; }

public List<string> StudentIds { get; set; } = new List<string>();

public List<long> HomeworkIds { get; set; } = new List<long>();

public List<string> MentorIds { get; set; } = new List<string>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace HwProj.Models.CoursesService.DTO
{
public class CreateCourseFilterDTO
{
public string UserId { get; set; }
public string Id { get; set; }

public List<string> StudentIds { get; set; } = new List<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class CourseViewModel
public bool IsOpen { get; set; }
public bool IsCompleted { get; set; }

public GroupViewModel[] Groups { get; set; }
public AccountDataDto[] Mentors { get; set; }
public AccountDataDto[] AcceptedStudents { get; set; }
public AccountDataDto[] NewStudents { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace HwProj.Models.CoursesService.ViewModels
public class GroupViewModel
{
public long Id { get; set; }
public string Name { get; set; }
public string[] StudentsIds { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class CreateHomeworkViewModel
public List<PostTaskViewModel> Tasks { get; set; } = new List<PostTaskViewModel>();

public ActionOptions? ActionOptions { get; set; }

public long? GroupId { get; set; }
}

public class HomeworkViewModel
Expand Down Expand Up @@ -58,5 +60,7 @@ public class HomeworkViewModel
public List<string> Tags { get; set; } = new List<string>();

public List<HomeworkTaskViewModel> Tasks { get; set; } = new List<HomeworkTaskViewModel>();

public long? GroupId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public AutomapperProfile()

CreateMap<CreateCourseFilterDTO, CreateCourseFilterModel>();
CreateMap<Filter, CourseFilterDTO>();

CreateMap<UpdateGroupViewModel, Group>().ReverseMap();
CreateMap<Group, UserGroupDescription>();

CreateMap<GroupMateViewModel, GroupMate>().ReverseMap();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public async Task<GroupViewModel[]> GetAll(long courseId)
var result = groups.Select(t => new GroupViewModel
{
Id = t.Id,
Name = t.Name,
StudentsIds = t.GroupMates.Select(s => s.StudentId).ToArray()
}).ToArray();

Expand Down Expand Up @@ -80,22 +81,14 @@ public async Task<IActionResult> AddStudentInGroup(long groupId, [FromQuery] str
return Ok();
}

[HttpPost("{courseId}/removeStudentFromGroup/{groupId}")]
[ServiceFilter(typeof(CourseMentorOnlyAttribute))]
public async Task<IActionResult> RemoveStudentFromGroup(long groupId, [FromQuery] string userId)
{
return await _groupsService.DeleteGroupMateAsync(groupId, userId)
? Ok()
: NotFound() as IActionResult;
}

[HttpGet]
public async Task<IActionResult> Get([FromBody] long[] groupIds)
{
var groups = await _groupsService.GetGroupsAsync(groupIds);
var result = groups.Select(group => new GroupViewModel
{
Id = group.Id,
Name = group.Name,
StudentsIds = group.GroupMates.Select(g => g.StudentId).ToArray()
}).ToArray();
return Ok(result) as IActionResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static HomeworkViewModel ToHomeworkViewModel(this Homework homework)
IsDeferred = DateTime.UtcNow < homework.PublicationDate,
Tasks = homework.Tasks.Select(t => t.ToHomeworkTaskViewModel()).ToList(),
Tags = tags.ToList(),
GroupId = homework.GroupId,
};
}

Expand Down Expand Up @@ -147,6 +148,7 @@ public static Homework ToHomework(this CreateHomeworkViewModel homework)
PublicationDate = homework.PublicationDate,
Tasks = homework.Tasks.Select(t => t.ToHomeworkTask()).ToList(),
Tags = string.Join(";", homework.Tags),
GroupId = homework.GroupId,
};

public static CourseTemplate ToCourseTemplate(this CreateCourseViewModel createCourseViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public static List<string> ValidateHomework(CreateHomeworkViewModel homework, Ho
errors.Add("Нельзя изменить дату публикации домашнего задания, если она уже показана студента");
}

if (previousState.GroupId != homework.GroupId)
{
errors.Add("Нельзя изменить группу для домашнего задания, если оно уже опубликовано");
}

return errors;
}
}
Expand Down
Loading
Loading