public async Task <IActionResult> GetById([FromRoute] int id) { var questions = await _resultService.GetByID(id); Console.WriteLine("Inside get by Id method " + id); return(Ok(questions)); }
public async Task EndQuiz(Object question) { UserInfo userInfo = _userQuizState.GetValueOrDefault(Context.ConnectionId); userInfo.QuestionsAttempted.Add(question); questionsToBeAdded = userInfo.QuestionsAttempted; userInfo.QuestionsFromQuestionBank = null; _graphService.UpdateUserConceptRelation(userInfo, userInfo.UserId); userInfo.QuestionsAttempted = null; await _resultService.PostUserInfo(userInfo); UserInfo ui = await _resultService.GetByID(userInfo.UserId); ui.QuestionsAttempted = questionsToBeAdded; Console.WriteLine("THIS IS THE RESULT " + JsonConvert.SerializeObject(ui)); await _iquizEngineService.PostUserInfoAsync(ui); await _resultService.DeleteByIdAsync(userInfo.UserId); var Contents = _graphService.GetContentRecommendations(userInfo.UserId, userInfo.DomainName); Console.WriteLine("THIS IS THE CONTENT RECOMMENDER " + JsonConvert.SerializeObject(Contents)); Clients.Caller.SendAsync("EndQuiz", ui); }
public async Task <IActionResult> GetQuestionsById([FromRoute] int id) { var questions = await _resultService.GetByID(id); return(Ok(questions)); }