public bool SaveQuestionAnswer(SaveQuestionAnswerRequestModel model) { bool success; var question = _databaseController.GetQuestionById(model.QuestionId); if (model.Correct) { question.intAnsweredCorrectly += 1; var questions = new List <Question> { question }; success = _databaseController.InsertUpdate(questions); } else { question.intAnsweredWrong += 1; var questions = new List <Question> { question }; success = _databaseController.InsertUpdate(questions); } return(success); }
public bool SaveQuestionAnswer(bool correct, int questionId) { var requestModel = new SaveQuestionAnswerRequestModel { Correct = correct, QuestionId = questionId }; var content = JsonConvert.SerializeObject(requestModel); return(_webserviceProvider.PostDataFromWebService <bool>(Controllers.WhoWantsToBeAMillionaire.ToString(), "SaveQuestionAnswer", content)); }
public bool SaveQuestionAnswer(SaveQuestionAnswerRequestModel model) { return(_gameHandler.SaveQuestionAnswer(model)); }