コード例 #1
0
        private async void ImDoneBitches_Click(object sender, RoutedEventArgs e)
        {
            var Happyness = 0;

            var amountofQs = _generatedTest.Questions.Count;

            for (int i = 0; i < amountofQs; i++)
            {
                var controller         = (TextBox)QNA.FindName($"answerBox_{i}");
                var fuckingUsersAnswer = controller.Text;
                if (fuckingUsersAnswer == _generatedTest.Answers[i])
                {
                    Happyness++;
                }
            }

            var Results = new Results()
            {
                Difficulty  = _generatedTest.Difficulty,
                Grade       = _generatedTest.Grade,
                Person      = _generatedTest.Person,
                TestResults = $"{Happyness}/{_generatedTest.Questions.Count}"
            };

            ///
            var myResults = JsonConvert.SerializeObject(Results);

            await WriteResults(myResults);

            Frame.Navigate(typeof(Welcome), _myHacko.Account);
        }
コード例 #2
0
        private void showMeTheMoney_clicked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            var myButton = ((Button)sender).Name;
            //returns two values in array 0 = name of control  1 = controlIDNumber
            var     myChosenItem         = myButton.Split('_');
            var     answer               = _generatedTest.Answers[Convert.ToInt32(myChosenItem[1])];
            TextBox TheTextBoxYaChecking = (TextBox)QNA.FindName($"answerBox_{myChosenItem[1]}");

            // GET MY VALUE ::::  var bobbys_answer = TheTextBoxYaChecking.Text;
            TheTextBoxYaChecking.Text = answer;
            Debug.WriteLine(answer);
        }