Exemplo n.º 1
0
        public override IEnumerable <SlideBlock> BuildUp(SlideBuildingContext context, IImmutableSet <string> filesInProgress)
        {
            if (!Language.HasValue)
            {
                Language = context.CourseSettings.DefaultLanguage;
            }
            Slide                   = context.Slide;
            CourseId                = context.CourseId;
            ExerciseInitialCode     = ExerciseInitialCode ?? "// Вставьте сюда финальное содержимое файла " + UserCodeFilePath;
            ExpectedOutput          = ExpectedOutput ?? "";
            Validator.ValidatorName = string.Join(" ", Language.GetName(), Validator.ValidatorName ?? "");
            SlideFolderPath         = context.UnitDirectory;

            ReplaceStartupObjectForNUnitExercises();

            yield return(this);

            if (CorrectSolutionFile.Exists)
            {
                yield return(new MarkdownBlock("### Решение")
                {
                    Hide = true
                });

                yield return(new CodeBlock(CorrectSolutionFile.ContentAsUtf8(), Language)
                {
                    Hide = true
                });
            }
        }
Exemplo n.º 2
0
 public string GetCorrectSolution()
 {
     return(SolutionRegionContent.Value ?? (CorrectSolutionFile.Exists ? CorrectSolutionFile.ContentAsUtf8() : null));
 }