Exemplo n.º 1
0
 public void CopySettingsFrom(ScoringGroup otherScoringGroup)
 {
     _canBeSetByInstructor = string.IsNullOrEmpty(_canBeSetByInstructor) ? otherScoringGroup._canBeSetByInstructor : _canBeSetByInstructor;
     _maxAdditionalScore   = string.IsNullOrEmpty(_maxAdditionalScore) ? otherScoringGroup._maxAdditionalScore : _maxAdditionalScore;
     _enabledForEveryone   = string.IsNullOrEmpty(_enabledForEveryone) ? otherScoringGroup._enabledForEveryone : _enabledForEveryone;
     Abbreviation          = Abbreviation ?? otherScoringGroup.Abbreviation;
     Name = string.IsNullOrEmpty(Name) ? otherScoringGroup.Name : Name;
 }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
0
 public ScoringSettings()
 {
     _groups = new ScoringGroup[0];
 }