Ejemplo n.º 1
0
		private static Slide ParseSyntaxTree(SyntaxTree tree, SlideInfo slideInfo, string prelude,
			IFileSystem getInclude)
		{
			var blocksBuilder = new SlideBuilder(getInclude);
			blocksBuilder.Visit(tree.GetRoot());
			if (!ExerciseBuilder.IsExercise(tree))
				return new Slide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id);
			var exerciseBlock = new ExerciseBuilder(SlideBuilder.LangId, prelude).BuildBlockFrom(tree);
			blocksBuilder.Blocks.Add(exerciseBlock);
			return new ExerciseSlide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id);
		}
Ejemplo n.º 2
0
        private static Slide ParseSyntaxTree(SyntaxTree tree, SlideInfo slideInfo, string prelude,
                                             IFileSystem getInclude)
        {
            var blocksBuilder = new SlideBuilder(getInclude);

            blocksBuilder.Visit(tree.GetRoot());
            if (!ExerciseBuilder.IsExercise(tree))
            {
                return(new Slide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id));
            }
            var exerciseBlock = new ExerciseBuilder(SlideBuilder.LangId, prelude).BuildBlockFrom(tree);

            blocksBuilder.Blocks.Add(exerciseBlock);
            return(new ExerciseSlide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id));
        }
Ejemplo n.º 3
0
        private static Slide ParseSyntaxTree(SyntaxTree tree, SlideInfo slideInfo, string prelude,
                                             DirectoryInfo getInclude, CourseSettings settings)
        {
            var blocksBuilder = new SlideBuilder(getInclude);

            blocksBuilder.Visit(tree.GetRoot());
            if (!ExerciseBuilder.IsExercise(tree))
            {
                return(new Slide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id, meta: null));
            }
            var exerciseBlock = new ExerciseBuilder(SlideBuilder.LangId, prelude).BuildBlockFrom(tree, slideInfo.SlideFile);

            exerciseBlock.CheckScoringGroup(slideInfo.SlideFile.FullName, settings.Scoring);
            blocksBuilder.Blocks.Add(exerciseBlock);
            return(new ExerciseSlide(blocksBuilder.Blocks, slideInfo, blocksBuilder.Title, blocksBuilder.Id, meta: null));
        }