internal void SetAnswer(string id, string questionId, int answer) { QuestionsRepository qr = new QuestionsRepository(); qr.UpdateAnswer(id, questionId, answer); User user = uctx.GetById("Users", id); user.Score = CalculateScore(id); uctx.UpdateObject(user, false); }
internal List<Question> GetQuestions(string userid , bool refresh ) { QuestionsRepository qr = new QuestionsRepository(); List<UserQuestion> questionIds = null; if (refresh) qr.RemoveQuestions(userid); questionIds = qr.AssignQuestionsIds(userid); List<Question> questions = qr.GetQuestions(questionIds); return questions; }