예제 #1
0
        public void InsertSubject(SubjectModel model)
        {
            var subject = new Subject(model.Id, model.Data, LevelTree.Peek().Question.Id);

            CreateNode(subject);
        }
예제 #2
0
        public ActionResult SelectExistingSubject(SubjectListModel model)
        {
            var subj = new SubjectModel(int.Parse(model.SelectedSubjId), model.SelectedSubjData);

            NodeStore.Ctx.InsertSubject(subj);

            var answer = NodeStore.Ctx.LevelTree.Peek().Answers.Last();

            NodeStore.Ctx.CompleteCreateAnswer(new AnswerModel(answer), subj.Id);

            return RedirectToAction("AddAnswer");
        }
예제 #3
0
        public ActionResult InputSubject(SubjectModel model)
        {
            var subject = new Subject(model.Id, model.Data, model.ParentId);
            NodeStore.Ctx.CreateNode(subject);

            var answer = NodeStore.Ctx.LevelTree.Peek().Answers.Last();

            NodeStore.Ctx.CompleteCreateAnswer(new AnswerModel(answer), subject.Id);

            NodeStore.TmpNode = null;

            return RedirectToAction("AddAnswer");
        }
예제 #4
0
        public ActionResult DisplaySubject(int? id)
        {
            if (!id.HasValue) return View();

            var node = NodeStore.Ctx.GetNode(id.Value);
            var model = new SubjectModel(node.Id, node.Data);
            return View(model);
        }