Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool answer = false;

            if (sign == 1)
            {
                if (Convert.ToInt32(textBox1.Text) == num2 + num1)
                {
                    answer = true;
                    score  = 1;
                }
            }
            if (sign == 2)
            {
                if (Convert.ToInt32(textBox1.Text) == num1 - num2)
                {
                    answer = true;
                    score  = 1;
                }
            }
            if (answer)
            {
                correct correct = new correct();
                correct.Show();
            }
            else
            {
                wrong wrong = new wrong();
                wrong.Show();
            }
            timer1.Enabled = false;
            grade          = main_menu.Grade;
            user           = main_menu.User;
            timer2.Enabled = true;
        }
Exemplo n.º 2
0
        private void answer_check()
        {
            if (input == answer_str)
            {
                correct correct = new correct();
                correct.Show();
                score++;
                number_of_questions++;
                if (number_of_questions == 20)
                {
                    timer1.Enabled = false;
                    final_score final = new final_score();
                    System.Threading.Thread.Sleep(500);


                    final.grade        = "k";
                    final.score        = score;
                    final.time         = time_elasped;
                    final.user         = Form1.username;
                    final.problem_list = problem_list;
                    final.Show();
                    this.Close();
                }
                else
                {
                    new_problem();
                }
            }
            else
            {
                wrong wrong = new wrong();
                wrong.answer = correct_answer;
                wrong.Show();
                number_of_questions++;
                if (number_of_questions == 20)
                {
                    timer1.Enabled = false;
                    final_score final = new final_score();
                    System.Threading.Thread.Sleep(500);

                    final.grade        = "k";
                    final.score        = score;
                    final.time         = time_elasped;
                    final.user         = Form1.username;
                    final.problem_list = problem_list;
                    final.Show();
                    this.Close();
                }
                else
                {
                    new_problem();
                }
            }
        }
Exemplo n.º 3
0
 public void check_answer()
 {
     if (input == answer)
     {
         correct correct = new correct();
         correct.Show();
         score++;
         number_of_questions++;
         if (number_of_questions == 20)
         {
             timer1.Enabled = false;
             final_score final = new final_score();
             System.Threading.Thread.Sleep(500);
             final.grade        = "5";
             final.score        = score;
             final.time         = time_elasped;
             final.user         = Form1.username;
             final.problem_list = problem_list;
             final.Show();
             this.Close();
         }
         else
         {
             new_problem();
         }
     }
     else
     {
         wrong wrong = new wrong();
         if (wrong_frac)
         {
             wrong.frac    = true;
             wrong.answer  = correct_answer;
             wrong.ans_bot = correct_bot;
         }
         else
         {
             wrong.answer = correct_answer;
             wrong.frac   = false;
         }
         wrong.Show();
         number_of_questions++;
         if (number_of_questions == 20)
         {
             timer1.Enabled = false;
             final_score final = new final_score();
             System.Threading.Thread.Sleep(500);
             final.grade        = "5";
             final.score        = score;
             final.time         = time_elasped;
             final.user         = Form1.username;
             final.problem_list = problem_list;
             final.Show();
             this.Close();
         }
         else
         {
             new_problem();
         }
     }
 }