public void InsertSubject(SubjectModel model) { var subject = new Subject(model.Id, model.Data, LevelTree.Peek().Question.Id); CreateNode(subject); }
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"); }
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"); }
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); }