예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 public ScoringSettings()
 {
     _groups = new ScoringGroup[0];
 }