Пример #1
0
        public ActionResult Question()
        {
            Dictionary <string, string> inbound = new Dictionary <string, string>();

            inbound["aspNetUserID"] = User.Identity.GetUserId();

            QuestionViewModel QVM = FlagsAPIClient.GetAsync <QuestionViewModel>(
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIURLScheme],
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIHost],
                ConfigurationParams.FlagQuestionURN,
                inbound
                );

            return(View("Question", null, QVM));
        }
Пример #2
0
        public string SubmitAnswer(Guid questionID, Guid userAnswer)
        {
            Dictionary <string, string> incoming = new Dictionary <string, string>
            {
                ["questionID"] = questionID.ToString(),
                ["userAnswer"] = userAnswer.ToString()
            };

            string correctOrNot = FlagsAPIClient.GetAsync <string>(
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIURLScheme],
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIHost],
                ConfigurationParams.SubmitAnswerURN,
                incoming
                );

            return(correctOrNot);
        }
Пример #3
0
        public ActionResult GetAll()
        {
            Dictionary <string, string> inbound = new Dictionary <string, string>
            {
                ["all"] = "3"
            };


            List <Flag> fullList = FlagsAPIClient.GetAsync <List <Flag> >(
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIURLScheme],
                ConfigurationManager.AppSettings[ConfigurationParams.WCAPIHost],
                ConfigurationParams.FlagsAllURN,
                inbound

                ).OrderBy(x => x.Description).ToList();

            IEnumerable <IEnumerable <Flag> > thing = Paginate.splitList(fullList, 3);

            return(View(thing));
        }