protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.IsAuthenticated && Session["SessionId"] != null) { Guid sessionId = new Guid(Session["SessionId"].ToString()); GamesWS.GamesService gamesService = new GamesWS.GamesService(); ProfileQuizQuestionRequest result = gamesService.FetchRandomQuizQuestions(sessionId, 10); if (result.Success) { QuizInfo = new ProfileQuizInformation(); QuizInfo.QuizQuestions = result.QuestionList.ToList(); QuizInfo.StartTime = DateTime.Now; QuizInfo.CurrentQuestionIndex = 0; UpdateScreen(); } else // Show some error information. { } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.IsAuthenticated) { GamesWS.GamesService gamesService = new GamesWS.GamesService(); ColorGameResult result = gamesService.FetchColorGame(); if (result.Success) { ColorGameInfo = new ColorGameInformation(); ColorGameInfo.QuestionList = result.Questions; ColorGameInfo.StartTime = DateTime.Now; ColorGameInfo.CurrentQuestionIndex = 0; UpdateScreen(); } else // Show some error information. { } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["SessionId"] != null) { GamesWS.GamesService gameClient = new GamesWS.GamesService(); Guid sessionId = (Guid)Session["SessionId"]; ShortTermQuizResult questionResults = gameClient.FetchShortTermMemoryQuiz(sessionId); SaveQuestionsIntoSession(questionResults.Quiz); SetupUI(); } else { FormsAuthentication.RedirectToLoginPage(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["SessionId"] != null) { GamesWS.GamesService gameClient = new GamesWS.GamesService(); Guid sessionId = (Guid)Session["SessionId"]; UserProfileQuestionsResults questionResults = gameClient.FetchUserProfileQuestions(sessionId); QuestionNumber = 0; SaveQuestionsIntoSession(questionResults.QuestionList.ToList()); SetupUI(); } else { FormsAuthentication.RedirectToLoginPage(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["SessionId"] != null) { GamesWS.GamesService gameClient = new GamesWS.GamesService(); Guid sessionId = (Guid)Session["SessionId"]; IdentifyResults questionResults = gameClient.FetchIdentifyQuestions(sessionId); SaveQuestionsIntoSession(questionResults.QuestionList); Session.Add("BeginTime", DateTime.Now); QuestionNumber = 0; SetupUI(); } else { FormsAuthentication.RedirectToLoginPage(); } } }
protected void uxNextFinish_Click(object sender, EventArgs e) { SaveScreen(); if (QuestionNumber.Value + 1 >= ProfileQuestions.Count) { // need to save and redirect. GamesWS.GamesService gameClient = new GamesWS.GamesService(); Guid sessionId = (Guid)Session["SessionId"]; gameClient.SaveUserProfileQuestions(ProfileQuestions.ToArray(), sessionId); Response.Redirect("~/Games/UserProfileComplete.aspx"); } else { QuestionNumber = QuestionNumber + 1; SetupUI(); } }