Ejemplo n.º 1
0
 private void tBTestWord_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space)
     {
         if (defence.IsUnlocked())
         {
             if (globalStatus == TestStatus.IsGoing)
             {
                 if (status == TestStatus.NotStarted)
                 {
                     ShowNextQuestion();
                 }
                 else if (status == TestStatus.IsGoing)
                 {
                     HideQuestion();
                     defence.StartLock();
                 }
                 else if (!tBTestWord.ReadOnly && status == TestStatus.IsChecking)
                 {
                     CheckAnswer();
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void PerformAction()
        {
            if (defence.IsUnlocked())
            {
                if (train.IsTrainEnabled())
                {
                    train.Stop();
                }
                else
                {
                    train.TimeShowing = Convert.ToInt32(nUDVisibleTime.Value);

                    if (rbNormal.Checked)
                    {
                        train.TestOrder = Order.Normal;
                    }
                    else if (rbInverse.Checked)
                    {
                        train.TestOrder = Order.Inverse;
                    }
                    else if (rBRandom.Checked)
                    {
                        train.TestOrder = Order.Random;
                    }

                    train.Start();
                }

                defence.StartLock();
            }
        }
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (defence.IsUnlocked())
            {
                if (train.Status == MachineStatus.NotStarted || train.Status == MachineStatus.WaitingAnswer)
                {
                    train.MakeAction();

                    defence.StartLock();
                }
                else if (train.Status == MachineStatus.ShowingQuestion)
                {
                    AskCloseQuestion();

                    defence.StartLock();
                }
            }
        }
Ejemplo n.º 4
0
        private void PerformClick()
        {
            if (defence.IsUnlocked())
            {
                train.ShowNextQuestion();

                defence.StartLock();
            }
        }
Ejemplo n.º 5
0
 private void PerformClick()
 {
     if (train.Status == MachineStatus.NotStarted || train.Status == MachineStatus.ShowingQuestion)
     {
         if (defence.IsUnlocked())
         {
             train.ShowNextNumber();
         }
     }
 }
Ejemplo n.º 6
0
 private void PerformClick()
 {
     if (train.CanGetNewQuestion)
     {
         if (defence.IsUnlocked())
         {
             train.ShowNextQuestion();
         }
     }
 }
        private void tBTestWord_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (defence.IsUnlocked())
                {
                    train.MakeAction(tBTestWord.Text.Replace(" ", ""));

                    defence.StartLock();
                }
            }
        }
Ejemplo n.º 8
0
        private void tBTestWord_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (defence.IsUnlocked())
                {
                    string userText = tBTestWord.Text.Trim();

                    train.MakeAction(userText);

                    defence.StartLock();
                }
            }
        }
Ejemplo n.º 9
0
        private void tBTestWord_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (defence.IsUnlocked())
                {
                    e.Handled          = true;
                    e.SuppressKeyPress = true;

                    if (train.NetTestCount != 0)
                    {
                        train.MakeAction(tBTestWord.Text.Trim());
                    }
                    else
                    {
                        MessageBox.Show(this, "Не была сформирована коллекция вопросов по сетке.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
            }
            else if (e.KeyCode == Keys.F1 || e.KeyCode == Keys.Multiply || e.KeyCode == Keys.Divide || e.KeyCode == Keys.Decimal)
            {
                if (train.CanWriteAnswer)
                {
                    e.Handled          = true;
                    e.SuppressKeyPress = true;

                    train.ShowRightAnswer();
                }
            }
            else if (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.Add)
            {
                if (train.CanWriteAnswer && train.CurrentElementTestType == NetTestType.Number)
                {
                    e.Handled          = true;
                    e.SuppressKeyPress = true;

                    train.ShowRightAnswer();
                }
            }
        }
        private void tBTestWord_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space)
            {
                if (defence.IsUnlocked())
                {
                    if (this.train.CanGetNewQuestion)
                    {
                        this.train.ShowNextQuestion();
                    }
                    else if (this.train.CanWriteAnswer)
                    {
                        string userAnswer = tBTestWord.Text.Trim();

                        this.train.TryAnswer(userAnswer);
                    }

                    defence.StartLock();
                }
            }
        }