Exemplo n.º 1
0
        public void InsertSubject(SubjectModel model)
        {
            var subject = new Subject(model.Id, model.Data, LevelTree.Peek().Question.Id);

            CreateNode(subject);
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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);
        }