예제 #1
0
        private void Level6_Click(object sender, RoutedEventArgs e)
        {
            _data level = new _data();

            level.writelevel_number("6");
            this.Frame.Navigate(typeof(Question));
        }
예제 #2
0
        public Question()
        {
            this.InitializeComponent();
            _data question_data = new _data();

            level_number      = question_data.readdata("Level_number").ToString();
            QuestionText.Text = question_data.readdata("Question_" + level_number).ToString(); // judul pertanyaan
            BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx://Anime_quiz_UWP/Assets/" + level_number + ".jpg"));

            image_chara.Source = bitmapImage; // ganti gambar
            Text_.Text         = question_data.readdata("QuestionQuestion_" + level_number).ToString();
            answer             = question_data.readdata("QuestionAnswer_" + level_number).ToString();
            TheAnswer.Text     = answer;
            if (question_data.readdata("QuestionDone_" + level_number).ToString() == "true")
            {
                TheAnswer.Visibility   = Visibility;
                AnswerPlayer.IsEnabled = false;
                answbutton.IsEnabled   = false;
            }
            else
            {
                AnswerPlayer.IsEnabled = true;
                answbutton.IsEnabled   = true;
            }
        }
예제 #3
0
        private void answbutton_Click(object sender, RoutedEventArgs e)
        {
            _data question_data = new _data();
            //nanti pke edit distance
            int beda = edit_distance(answer.ToLower(), AnswerPlayer.Text.Trim().ToLower());

            if (beda == 0)
            {
                //kasi bener
                AnswerPlayer.Visibility = Visibility.Collapsed;
                answbutton.Visibility   = Visibility.Collapsed;
                TheAnswer.Visibility    = Visibility;
                The1.Visibility         = Visibility;
                The.Visibility          = Visibility.Collapsed;
                The2.Visibility         = Visibility.Collapsed;
                question_data.writesuccess(level_number);
            }
            else if (beda < 3)
            {
                //hampir bener
                The2.Visibility = Visibility;
                The1.Visibility = Visibility.Collapsed;
                The.Visibility  = Visibility.Collapsed;
            }
            else
            {
                The.Visibility  = Visibility;
                The1.Visibility = Visibility.Collapsed;
                The2.Visibility = Visibility.Collapsed;
            }
        }
예제 #4
0
        private void PlayButton_Click(object sender, RoutedEventArgs e)
        {
            _data kontrol = new _data();

            kontrol.kontroldata();
            this.Frame.Navigate(typeof(MainPage));
        }