Exemplo n.º 1
0
        private void picSentencesLock_Click(object sender, EventArgs e)
        {
            sentenceLevels sentenceLevels = new sentenceLevels();

            sentenceLevels.mainLevelsForm = this;
            sentenceLevels.Show();

            this.Hide();
        }
Exemplo n.º 2
0
        private void btnCheckAnswer_Click(object sender, EventArgs e)
        {
            radioButton1.ForeColor = Color.Black;
            radioButton2.ForeColor = Color.Black;
            radioButton3.ForeColor = Color.Black;

            lblFeedback.Visible = false;
            if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false)
            {
                lblFeedback.Visible   = true;
                lblFeedback.ForeColor = Color.Red;
                lblFeedback.Text      = "Please select at least one answer";
            }
            else if (btnCheckAnswer.Text == "Try Again")
            {
                //panel1.Enabled = true;
                btnCheckAnswer.Text = "Check your answer";

                picFeedback.Visible = false;
                //lblFeedback.Visible = false;
                //lblCorrectAns.Visible = false;
            }
            else if (btnCheckAnswer.Text == "Next Question")

            {
                int z = Convert.ToInt32(question.ToString());
                if (z <= 5)
                {
                    //panel1.Enabled = true;

                    attempts              = 3;
                    lblAttempts.Text      = attempts.ToString();
                    lblCorrectAns.Visible = false;
                    // question++;
                    picFeedback.Visible = false;
                    //lblFeedback.Visible = false;

                    GenIdioms();

                    lblNoOfQuestion.Text = "Question " + question.ToString() + " of 5";

                    radioButton1.Checked = false;
                    radioButton2.Checked = false;
                    radioButton3.Checked = false;


                    btnCheckAnswer.Text = "Check your answer";
                }
                else
                {
                    sentenceLevels sl = new sentenceLevels();
                    sl.Show();
                }
            }
            else if (btnCheckAnswer.Text == "View your reward")
            {
                GoToNextLevel();
            }
            else if (btnCheckAnswer.Text == "Start this level again")
            {
                //panel1.Enabled = true;

                Idioms_Load(sender, e);
            }
            else
            {
                //  panel1.Enabled = false;

                if (radioButton1.Checked)
                {
                    playerAnswer = radioButton1.Text;
                }
                if (radioButton2.Checked)
                {
                    playerAnswer = radioButton2.Text;
                }
                if (radioButton3.Checked)
                {
                    playerAnswer = radioButton3.Text;
                }

                picFeedback.Visible = true;


                if (playerAnswer.Trim() == ans1.Trim())
                {
                    CorrectAnswer();
                }
                else
                {
                    IncorrectAnswer();
                }
            }
        }