public IActionResult ManageAnswer() { var username = User.Identity.Name.ToString(); var user = UserOptions.GetUser(username); Query query = QueryOptions.Load(user, 1); Question question = QuestionOptions.Load(query, 1); Answer answer = AnswerOptions.Load(question, 1); return(View("LoadAnswer", answer)); }
public IActionResult LoadAnswer(int queryNumber, int questionNumber, int answerNumber) { var username = User.Identity.Name.ToString(); var user = UserOptions.GetUser(username); Query query = QueryOptions.Load(user, queryNumber); Question question = QuestionOptions.Load(query, questionNumber); Answer answer = AnswerOptions.Load(question, answerNumber); return(View("LoadAnswer", answer)); }
public IActionResult SelectAnswer(int number, string code) { var question = QuestionOptions.GetActive(number, code, true); var answer = AnswerOptions.Load(question, number); AnswerOptions.Select(answer); question.IsAnswered = true; //return RedirectToAction("JoinQuery", "Client", new { code, question }); if (QueryOptions.ValidCode(code)) { return(View("ClientView", question)); } else { return(View("QueryClosed", question)); } }