Exemplo n.º 1
0
        private void DistributeData()
        {
            PageList = new List <object>();
            foreach (var i in Contents)
            {
                if (i.type.ToString().Equals("mcq"))
                {
                    Models.Mcq q = new Models.Mcq
                    {
                        Question      = i.content.Question,
                        Answers       = i.content.Answers,
                        CorrectAnswer = i.content.CorrectAnswer
                    };
                    PageList.Add(q);
                }

                if (i.type.ToString().Equals("cloze"))
                {
                    Cloze c = new Cloze {
                        Sentence = i.content.sentence, MissingWords = i.content.MissingWords
                    };
                    PageList.Add(c);
                }
            }
        }
Exemplo n.º 2
0
 private void DoTransition()
 {
     question         = Questions[index];
     QuestionLbl.Text = question.Question;
     choices          = CallBackChoices(question);
     CreateButtons();
 }
Exemplo n.º 3
0
 private string[] CallBackChoices(Models.Mcq question)
 {
     string[] Choices = new string[question.Answers.Count];
     for (int i = 0; i < question.Answers.Count; i++)
     {
         Choices[i] = question.Answers[i];
     }
     return(Choices);
 }
Exemplo n.º 4
0
        private void RefreshButtons(Models.Mcq question)
        {
            choices = CallBackChoices(question);

            for (int i = 0; i < choices.Length; i++)
            {
                Btns[i].Text = choices[i];
            }
        }
Exemplo n.º 5
0
        private void ShowQuestion(Object page)
        {
            Question    = (Models.Mcq)page;
            QuestionLbl = new Label {
                Text = Question.Question, Padding = 35, TextColor = Color.Black
            };

            MyLayout.Children.Add(QuestionLbl);
            choices = CallBackChoices(Question);
            CreateMcqAnswerBtn();
            MyLayout.Children.Add(SubmitBtn);
        }
Exemplo n.º 6
0
        private void BtnAction(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            if (b.Text.Equals(question.CorrectAnswer))
            {
                Console.WriteLine("Correct");
                index++;
                question         = Questions[index];
                QuestionLbl.Text = question.Question;
                RefreshButtons(question);
            }
        }
Exemplo n.º 7
0
 private void ModifyData()
 {
     Questions = new List <Models.Mcq>();
     for (int i = 0; i < Contents.Count; i++)
     {
         Models.Mcq q = new Models.Mcq();
         //q.Question = Contents[i].Question;
         //q.Answers = Contents[i].Answers;
         //q.CorrectAnswer = Contents[i].CorrectAnswer;
         Questions.Add(q);
     }
     Console.WriteLine(Questions.Count);
 }