Ejemplo n.º 1
0
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (globalStatus == TestStatus.NotStarted)
            {
                DeactivateControls();

                globalStatus = TestStatus.IsGoing;

                btnStartStop.Text = "Закончить";

                FormTextBoxes();

                tBTestWord.Select();

                defence.StartLock();
            }
            else if (globalStatus == TestStatus.IsGoing)
            {
                ActivateControls();

                btnStartStop.Text = "Начать";

                globalStatus = TestStatus.NotStarted;

                defence.StartLock();
            }
        }
        void train_TrainQuestionResult(object sender, QuestionResultEventArgs e)
        {
            tSSTestTimer.Stop();

            tBTestWord.Text        = string.Empty;
            lblTestWord.Visible    = true;
            lblCheckResult.Visible = true;

            double time = tSSTestTimer.TimeInterval().TotalSeconds;

            string timeString = "\r\n" + time.ToString("F1") + " с" + (e.IsAutoCheck ? " Авто" : "");

            lblTestWord.Text = e.Text;

            if (e.IsAnswerRight)
            {
                lblCheckResult.Text      = "Правильно" + timeString;
                lblCheckResult.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                errorPictureBox.StartShowing();

                lblCheckResult.Text      = "Неправильно!!!" + timeString;
                lblCheckResult.ForeColor = System.Drawing.Color.Red;

                defence.StartLock();
            }
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
        void train_TrainShowErrorMessage(object sender, EventArgs e)
        {
            defence.StartLock();

            tBTestWord.Text = string.Empty;

            errorPictureBox.StartShowing();
        }
Ejemplo n.º 5
0
        private void PerformClick()
        {
            if (defence.IsUnlocked())
            {
                train.ShowNextQuestion();

                defence.StartLock();
            }
        }
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (this.train.Status == MachineStatus.NotStarted)
            {
                DeactivateControls();

                btnStartStop.Text = "Закончить";

                FormTextBoxes();

                tBTestWord.Select();

                defence.StartLock();

                this.train.ShowNextQuestion();
            }
            else if (this.train.Status != MachineStatus.NotStarted)
            {
                ActivateControls();

                btnStartStop.Text = "Начать";

                this.train.Stop();

                defence.StartLock();
            }
        }
        void train_TrainNewQuestion(object sender, EventArgs e)
        {
            if (cBCounter.Checked)
            {
                tStStatusCounter.Text = string.Format("{0} из {1}.", (train.QuestionIndex + 1).ToString(), train.QuestionsCount.ToString());
            }

            lblNextWord.Text = train.QuestionText;

            if (train.QuestionIndex % 2 == 0)
            {
                lblNextWord.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                lblNextWord.ForeColor = System.Drawing.Color.RoyalBlue;
            }

            tSSTestTimer.StartNew();

            lblNextWord.Select();

            defence.StartLock();
        }
Ejemplo n.º 8
0
        void train_NextElement(object sender, EventArgs e)
        {
            Common.SetLabelText(lblTestWord, baseFontSize, train.Element);

            lblTestWord.Select();

            tSSOneTestTimer.StartNew();

            if (train.IsFileSource)
            {
                tSSLCurrentIndex.Text = string.Format("Элемент № {0}.", train.CurrentIndex.ToString());
            }
            else
            {
                tSSLCurrentIndex.Text = string.Empty;
            }

            defence.StartLock();
        }
Ejemplo n.º 9
0
 void train_TrainAnswerAutoCheck(object sender, AutoCheckEventArgs e)
 {
     e.UserAnswer = tBTestWord.Text.Trim();
     defence.StartLock();
 }