Пример #1
0
        private void Init()
        {
            lbAllQuestions.Text = EncodingCountConfiguration.GetCountByTest
                                      (EncoderType.RSA).ToString();
            btnCheck.Visible = true;
            btnNext.Visible  = false;

            InitQuestion();
        }
Пример #2
0
        private void Init()
        {
            lbAllQuestions.Text = EncodingCountConfiguration.GetCountByTest
                                      (EncoderType.Caesar).ToString();
            btnCheck.Visible = true;
            button1.Visible  = false;


            upLabel.Text   = Messages.InMessage;
            downLabel.Text = Messages.OutMessage;


            InitQuestion();
        }
Пример #3
0
        private void InitQuestion()
        {
            ClearAnswerInfo();

            if (_questionCount >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.Caesar))
            {
                _encodersForm.tabPage1.Controls.Remove(this);
            }

            lbDescription.Text = _mainPresentation.GenerateQuestion
                                     (CodingType.Encoding, EncoderType.Caesar).Description;

            tbAnswer.Text = string.Empty;
            _questionCount++;
            lbCurrentTask.Text = _questionCount.ToString();
        }
        private void InitQuestion()
        {
            if (_countQuestion >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.Elgamal))
            {
                _encodersForm.panelQuestion.Controls.Remove(this);

                _encodersForm.panelQuestion.Controls.Add(new FinishControl(_countCorrectQuestion, _countQuestion));
            }

            IElgamalQuestion elgamalQuestion = (IElgamalQuestion)_mainPresentation
                                               .GenerateQuestion
                                                   (_codingType, EncoderType.Elgamal);

            tbA.Text = elgamalQuestion.A.ToString();
            tbP.Text = elgamalQuestion.P.ToString();
            tbB.Text = elgamalQuestion.B.ToString();
            tbR.Text = elgamalQuestion.R.ToString();

            switch (_codingType)
            {
            case CodingType.Decoding:
                tbMessage.Text = elgamalQuestion.Description;
                // tbMessage.ReadOnly = true;
                tbO.Text = String.Empty;
                tbW.Text = String.Empty;
                break;

            case CodingType.Encoding:
                string descript = elgamalQuestion.Description;
                var    values   = descript.Split(',');
                tbO.Text = values[0];
                tbW.Text = values[1];
                //   tbO.ReadOnly = true;
                //   tbW.ReadOnly = true;
                tbMessage.Text = String.Empty;
                break;
            }


            _countQuestion++;
            lbCurrentTask.Text = _countQuestion.ToString();
        }
Пример #5
0
        private void InitQuestion()
        {
            ClearAnswerInfo();

            if (_questionCount >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.Caesar))
            {
                _encodersForm.panelQuestion.Controls.Remove(this);

                _encodersForm.panelQuestion.Controls
                .Add(new FinishControl(_correctQuestionCount, _questionCount));
            }

            lbDescription.Text = _mainPresentation.GenerateQuestion
                                     (_codingType, EncoderType.Caesar).Description;

            tbAnswer.Text = string.Empty;
            _questionCount++;
            lbCurrentTask.Text = _questionCount.ToString();
        }
Пример #6
0
        private void Init()
        {
            lbAllQuestions.Text = EncodingCountConfiguration.GetCountByTest
                                      (EncoderType.Caesar).ToString();
            btnCheck.Visible = true;
            button1.Visible  = false;

            switch (_codingType)
            {
            case CodingType.Encoding:
                upLabel.Text   = Messages.InMessage;
                downLabel.Text = Messages.OutMessage;
                break;

            case CodingType.Decoding:
                upLabel.Text   = Messages.OutMessage;
                downLabel.Text = Messages.InMessage;
                break;
            }

            InitQuestion();
        }
        private void InitQuestion()
        {
            if (_countQuestion >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.DiffiHelman))
            {
                _encodersForm.tabPage1.Controls.Remove(this);

                // _encodersForm.tabPage3.Controls.Add(new FinishControl(_encodersForm));
            }
            IDiffiHelmanQuestion diffiHelmanQuestion = (IDiffiHelmanQuestion
                                                        )_mainPresentation.GenerateQuestion
                                                           (CodingType.Decoding, EncoderType.DiffiHelman);

            tbN.Text = diffiHelmanQuestion.N.ToString();
            tbG.Text = diffiHelmanQuestion.Q.ToString();
            tbX.Text = diffiHelmanQuestion.X.ToString();
            tbY.Text = diffiHelmanQuestion.Y.ToString();

            tbKey.Text = string.Empty;
            _countQuestion++;
            lbCurrentTask.Text = _countQuestion.ToString();
        }
        private void InitQuestion()
        {
            if (_countQuestion >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.DiffiHelman))
            {
                _encodersForm.panelQuestion.Controls.Remove(this);

                _encodersForm.panelQuestion.Controls
                .Add(new FinishControl(_countCorrectQuestion, _countQuestion));

                // _encodersForm.tabPage3.Controls.Add(new FinishControl(_encodersForm));
            }

            tbN.Text = RandomGenerator.NextENGMessage(8);
            tbG.Text = RandomGenerator.NextENGMessage(8);
            tbX.Text = _codingType == CodingType.Decoding? EncoderFactory
                       .CreateEncoder(EncoderType.DSA)
                       .Configure(tbN.Text, tbG.Text).Encode(RandomGenerator.NextENGMessage(7)): RandomGenerator.NextENGMessage(7);

            tbKey.Text = string.Empty;
            _countQuestion++;
            lbCurrentTask.Text = _countQuestion.ToString();
        }
        private void InitQuestion()
        {
            string valueConfig = RandomGenerator.NextENGMessage(3);

            lbKey.Text = valueConfig;

            if (_countQuestion >= EncodingCountConfiguration.GetCountByTest
                    (EncoderType.Vigenere))
            {
                _encodersForm.panelQuestion.Controls.Remove(this);

                _encodersForm.panelQuestion.Controls
                .Add(new FinishControl(_countCorrectQuestion, _countQuestion));
            }

            lbDescription.Text = _mainPresentation.GenerateQuestion
                                     (_codingType, EncoderType.Vigenere).Description;

            tbAnswer.Text = string.Empty;
            _countQuestion++;
            lbCurrentTask.Text = _countQuestion.ToString();
            lbCorrectAnsw.Text = String.Empty;
        }