Example #1
0
        public ActionResult Questions(int GameID)
        {
            if (CheckLoggedIn())
            {
                return(RedirectToAction("Index", "Login"));
            }

            QuestionsViewModel model = new QuestionsViewModel();

            model.game           = gameHandler.GetGame(GameID);
            model.game.Questions = question_Handler.GetQuestions(GameID);

            return(View("Questions", model));
        }
Example #2
0
        // GET: Game
        public ActionResult Index(string ID)
        {
            isLoggedIn();
            BrightLearn.ViewModels.Game.IndexViewModel model = new BrightLearn.ViewModels.Game.IndexViewModel();
            Game game = gameHandler.GetGame(ID);

            model.GameID    = game.ID;
            model.Lifes     = game.Lifes;
            model.bonusTime = game.BonusTime;
            model.Questions = questionHandler.GetQuestions(game.ID);

            if (model.Questions.Count == 0)
            {
                //Display error that there are no questions
            }

            return(View(model));
        }