예제 #1
0
        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");
        }
예제 #2
0
 public SubjectModel(LevelTreeNode node)
 {
     ParentId = node.Question.Id;
     Answers = new AnswerListModel(node.Question, node.Answers.Select(x => new AnswerModel(x)).ToList());
 }