Add Blazor WebApp and rework data handling to utilize Entity Framework
This commit is contained in:
@@ -2,15 +2,6 @@
|
||||
|
||||
namespace Core.Calculation;
|
||||
|
||||
public enum UnassignedScheduleStrategy
|
||||
{
|
||||
BiggestGroup,
|
||||
IndividualEvents,
|
||||
AnyNotMeetingAlready,
|
||||
LevelOfEffort,
|
||||
Any
|
||||
}
|
||||
|
||||
public class UnassignedStudentScheduler
|
||||
{
|
||||
private readonly IList<Student> _students;
|
||||
@@ -86,21 +77,21 @@ public class UnassignedStudentScheduler
|
||||
_teams
|
||||
.Where(t => scheduledTeams.All(st => st.Name != t.Name))
|
||||
.Select(t => t.CloneWithOmittedStudents(assignedStudents))
|
||||
.Where(t => t.Students.Count > 1) //|| t.Event.Format is EventFormat.Individual
|
||||
.Where(t => t.Students.Count > 1) //|| t.Event.EventFormat is EventFormat.Individual
|
||||
//.OrderBy(t => scheduledTeams.Count(st => st.Name == t.Name))
|
||||
.OrderByDescending(t => t.Students.Count); // select descending greatest number of students assigned
|
||||
//.ThenBy(t => Random.Shared.Next()); // todo: sort by student historic record of event assignment
|
||||
//.ThenBy(t => Random.Shared.Next()); // todo: sort by student historic record of eventDefinition assignment
|
||||
|
||||
// find individual events unassigned students can work on
|
||||
private IEnumerable<Team> GetAvailableTeams_Individual(
|
||||
IEnumerable<Team> scheduledTeams, IEnumerable<Student> assignedStudents) =>
|
||||
_teams
|
||||
.Where(t => scheduledTeams.All(st => st.Name != t.Name))
|
||||
.Where(t => t.Event.Format == EventFormat.Individual || t.Students.Count == 1)
|
||||
.Where(t => t.Event.EventFormat == EventFormat.Individual || t.Students.Count == 1)
|
||||
.Select(t => t.CloneWithOmittedStudents(assignedStudents))
|
||||
.Where(t => t.Students.Count > 0);
|
||||
|
||||
// find any unassigned event students can work on
|
||||
// find any unassigned eventDefinition students can work on
|
||||
private IEnumerable<Team> GetAvailableTeams_AnyNotMeetingAlready(
|
||||
IEnumerable<Team> scheduledTeams, IEnumerable<Student> assignedStudents) =>
|
||||
_teams
|
||||
@@ -121,7 +112,7 @@ public class UnassignedStudentScheduler
|
||||
_teams
|
||||
.Where(t => scheduledTeams.All(st => st.Name != t.Name))
|
||||
.Select(t => t.CloneWithOmittedStudents(assignedStudents))
|
||||
.Where(t => t.Students.Count > 1) //|| t.Event.Format is EventFormat.Individual
|
||||
.Where(t => t.Students.Count > 1) //|| t.Event.EventFormat is EventFormat.Individual
|
||||
//.OrderBy(t => scheduledTeams.Count(st => st.Name == t.Name))
|
||||
.OrderByDescending(t => t.Event.LevelOfEffort); // select descending greatest number of students assigned
|
||||
|
||||
|
||||
Reference in New Issue
Block a user