Exemple #1
0
        private async Task <bool> GetPageData()
        {
            //stackLoader.IsVisible = true;
            try
            {
                var responseData = await GetQuestions();

                var questionsData = Newtonsoft.Json.JsonConvert.DeserializeObject <QuizObject>(responseData);
                quizObject     = questionsData;
                totalQuestions = quizObject.questions_set.Count();

                labelQuestion.Text = quizObject.questions_set[0].Question;
                labelChoice1.Text  = quizObject.questions_set[0].Option1;
                labelChoice2.Text  = quizObject.questions_set[0].Option2;
                labelChoice3.Text  = quizObject.questions_set[0].Option3;
                labelChoice4.Text  = quizObject.questions_set[0].Option4;

                questioNumber           = 0;
                attemptedQuestions.Text = ((questioNumber + 1).ToString()) + "/" + totalQuestions;

                //labelQuestion.Text = "Which is the name of the robot that was given the saudi arabic Nationality ?";
                //labelChoice1.Text = "ELESA";
                //labelChoice2.Text = "Sofia";
                //labelChoice3.Text = "Jane";
                //labelChoice4.Text = "ChatBo";
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
            //stackLoader.IsVisible = false;
            return(true);
        }
Exemple #2
0
        public Quiz(QuizTopic selectedTopic)
        {
            timeSpan   = new Stopwatch();
            quizObject = new QuizObject();
            InitializeComponent();
            if (selectedTopic != null)
            {
                quizTopic         = selectedTopic;
                pageSubTitle.Text = quizTopic.TopicName;
            }
            else
            {
                pageSubTitle.Text = "";
            }
            footerText.Text = "A product of " + "\n" + "            " + "MactoSoft PVT LTD.";
            GetPageData();
            var height = (App.screenHeight * 1) / 100;
            var width  = (App.screenWidth * 1) / 100;

            pageTitle.FontSize = width * 6;

            var chcoiceIconMetrices = width * 8;

            defaultdimension = width * 5;
            changeDimension  = width * 10;

            imageChoice1.HeightRequest = chcoiceIconMetrices;
            imageChoice1.WidthRequest  = chcoiceIconMetrices;

            imageChoice2.HeightRequest = chcoiceIconMetrices;
            imageChoice2.WidthRequest  = chcoiceIconMetrices;

            imageChoice3.HeightRequest = chcoiceIconMetrices;
            imageChoice3.WidthRequest  = chcoiceIconMetrices;

            imageChoice4.HeightRequest = chcoiceIconMetrices;
            imageChoice4.WidthRequest  = chcoiceIconMetrices;
        }