public dynamic GetBlockData(SlideBlock block)
		{
			var index = Array.IndexOf(Slide.Blocks, block);
			if (index < 0)
				throw new ArgumentException("No block " + block + " in slide " + Slide);
			return BlockData[index];
		}
Beispiel #2
0
		public QuizInfoModel(QuizModel model, SlideBlock currentBlock, int index, QuizState quizState)
		{
			QuizModel = model;
			CurrentBlock = currentBlock;
			BlockIndex = index;
			QuizState = quizState;
		}
        public static string Text(this SlideBlock block)
        {
            var md = block as MdBlock;

            if (md != null)
            {
                return(md.Markdown);
            }
            var code = block as CodeBlock;

            if (code != null)
            {
                return(code.Code);
            }
            throw new Exception(block.ToString());
        }
Beispiel #4
0
        public override bool HasEqualStructureWith(SlideBlock other)
		{
			var block = other as MatchingBlock;
			if (block == null)
				return false;
			if (Matches.Length != block.Matches.Length)
				return false;
			var idsSet = Matches.Select(m => m.Id).ToImmutableHashSet();
			var blockIdsSet = block.Matches.Select(m => m.Id).ToImmutableHashSet();
			return idsSet.SetEquals(blockIdsSet);
		}
Beispiel #5
0
		public override bool HasEqualStructureWith(SlideBlock other)
		{
			var block = other as OrderingBlock;
			if (block == null)
				return false;
			return Items.SequenceEqual(block.Items);
		}
Beispiel #6
0
		public override bool HasEqualStructureWith(SlideBlock other)
		{
			return other is FillInBlock;
		}
Beispiel #7
0
		public override bool HasEqualStructureWith(SlideBlock other)
		{
			var block = other as IsTrueBlock;
			if (block == null)
				return false;
			return Answer == block.Answer;
		}
Beispiel #8
0
		public override bool HasEqualStructureWith(SlideBlock other)
		{
			var block = other as ChoiceBlock;
			if (block == null)
				return false;
			if (Items.Length != block.Items.Length || Multiple != block.Multiple)
				return false;

			var idsSet = Items.Select(i => i.Id).ToImmutableHashSet();
			var blockIdsSet = block.Items.Select(i => i.Id).ToImmutableHashSet();
			return idsSet.SetEquals(blockIdsSet);
		}
Beispiel #9
0
		public abstract bool HasEqualStructureWith(SlideBlock other);
Beispiel #10
0
		public SlideBlockDiff(SlideBlock original, SlideBlock changed)
		{
			OriginalSlideBlock = original;
			ChangedSlideBlock = changed;
		}
Beispiel #11
0
		public Lesson(string title, string id, SlideBlock[] blocks)
		{
			Title = title;
			Id = id;
			Blocks = blocks;
		}
Beispiel #12
0
 public static bool IsCode(this SlideBlock block)
 {
     return(block is CodeBlock);
 }