public ActionResult EditExistingQuestion(QuestionListModel model) { var que = NodeStore.Ctx.GetNode(int.Parse(model.SelectedQuestionId)); // var que = new QuestionModel(int.Parse(model.SelectedQuestionId), model.SelectedQuestionData); // NodeStore.Ctx.InsertQuestion(que); var levelNode = new LevelTreeNode(new Question(que.Id,que.Data,que.ParentId)); levelNode.Answers.AddRange(NodeStore.Ctx.GetAnswers(que.Id)); NodeStore.Ctx.LevelTree.Push(levelNode); return RedirectToAction("AddAnswer"); }
public SubjectModel(LevelTreeNode node) { ParentId = node.Question.Id; Answers = new AnswerListModel(node.Question, node.Answers.Select(x => new AnswerModel(x)).ToList()); }