private static void AddDefaultScoringGroupIfNeeded(IEnumerable <Unit> units, IEnumerable <Slide> slides, CourseSettings settings) { if (slides.Any(s => s.ShouldBeSolved && string.IsNullOrEmpty(s.ScoringGroup))) { var defaultScoringGroup = new ScoringGroup { Id = "", Abbreviation = "Баллы", Name = "Упражнения и тесты", }; settings.Scoring.Groups.Add(defaultScoringGroup.Id, defaultScoringGroup); /* Add default scoring group to each unit */ foreach (var unit in units) { unit.Scoring.Groups.Add(defaultScoringGroup.Id, defaultScoringGroup); } } }
public ScoringSettings() { _groups = new ScoringGroup[0]; }