Beispiel #1
0
        private void recoverBtn_Click(object sender, EventArgs e)
        {
            LogResult();
            QuizMain testDlg = new QuizMain();

            if (testDlg.InitQuiz(m_result.wrongWords, m_result.wrongWordsOptions))
            {
                Hide();
                Close();
                testDlg.ShowDialog(MainDlg.Instance);
            }
        }
Beispiel #2
0
        public QuizResult( QuizMain.Result result )
        {
            InitializeComponent();

            m_result = result;

            int hour = (int)result.costTime.TotalHours;
            int minute = ((int)result.costTime.TotalSeconds - hour * 3600) / 60;
            int second = (int)result.costTime.TotalSeconds - minute * 60 - hour * 3600;

            // format result text
            this.resultText.Text = "CorrectRate: " + 100 * result.CorrectRate + "%\r\n"
                + "TotalTime: " + hour.ToString() + ":" + minute.ToString() + ":" + second.ToString();

            this.resultText.Text += "\r\n\r\n";
            this.resultText.Text += FormatResultDetailText();
            this.resultText.DeselectAll();
            this.resultText.SelectedText = "";

            this.overBtn.Focus();
        }
Beispiel #3
0
        private void startBtn_Click(object sender, EventArgs e)
        {
            int wordCount = Decimal.ToInt32(wordCountSpin.Value);

            if (wordCount <= 0)
            {
                MessageBox.Show("Must choose at least one word for test!");
                return;
            }

            int testType   = this.quizTypeCombo.SelectedIndex;
            int familarity = this.familarityCombo.SelectedIndex;

            ArrayList candidateWordPads = new ArrayList();

            foreach (string wordPadName in wordPadsCheckedListBox.CheckedItems)
            {
                WordPad wordPad = MainDlg.Instance.GetWordPadByName(wordPadName);
                candidateWordPads.Add(wordPad);
            }

            DateTime startDate = DateTime.Now;
            DateTime endDate   = DateTime.Now;

            if (!checkBoxAllTime.Checked)
            {
                if (checkBoxRelativeMode.Checked)
                {
                    int daysBefore = Convert.ToInt32(comboBoxRelDays.Text);
                    startDate = endDate.AddDays(Math.Min(0, -daysBefore));
                }
                else
                {
                    startDate = startDateTimePicker.Value;
                    endDate   = endDateTimePicker.Value;

                    if (startDate.CompareTo(endDate) > 0)
                    {
                        startDate = new DateTime(endDate.Year, endDate.Month, endDate.Day);
                    }
                }
            }

            TimeSpan tp = new TimeSpan(startDate.Hour, startDate.Minute, startDate.Second);

            startDate = startDate.Subtract(tp);
            tp        = new TimeSpan(endDate.Hour, endDate.Minute, endDate.Second);
            endDate   = endDate.Subtract(tp);

            QuizMain quizDlg = new QuizMain();

            if (!quizDlg.InitQuiz(candidateWordPads, (QuizMain.QuizType)testType, wordCount,
                                  (NewWordItem.ProficiencyLevel)familarity,
                                  startDate, endDate, checkBoxAllTime.Checked))
            {
                return;
            }
            Hide();
            this.Close();
            quizDlg.ShowDialog(MainDlg.Instance);
        }
Beispiel #4
0
        private void startBtn_Click(object sender, EventArgs e)
        {
            int wordCount = Decimal.ToInt32( wordCountSpin.Value );
            if (wordCount <= 0)
            {
                MessageBox.Show("Must choose at least one word for test!");
                return;
            }

            int testType = this.quizTypeCombo.SelectedIndex;
            int familarity = this.familarityCombo.SelectedIndex;

            ArrayList candidateWordPads = new ArrayList();
            foreach( string wordPadName in wordPadsCheckedListBox.CheckedItems )
            {
                WordPad wordPad = MainDlg.Instance.GetWordPadByName( wordPadName );
                candidateWordPads.Add(wordPad);
            }

            DateTime startDate = DateTime.Now;
            DateTime endDate = DateTime.Now;

            if (!checkBoxAllTime.Checked)
            {
                if (checkBoxRelativeMode.Checked)
                {
                    int daysBefore = Convert.ToInt32(comboBoxRelDays.Text);
                    startDate = endDate.AddDays(Math.Min(0, -daysBefore));
                }
                else
                {
                    startDate = startDateTimePicker.Value;
                    endDate = endDateTimePicker.Value;

                    if (startDate.CompareTo(endDate) > 0)
                        startDate = new DateTime(endDate.Year, endDate.Month, endDate.Day);
                }
            }

            TimeSpan tp = new TimeSpan(startDate.Hour, startDate.Minute, startDate.Second);
            startDate = startDate.Subtract(tp);
            tp = new TimeSpan(endDate.Hour, endDate.Minute, endDate.Second);
            endDate = endDate.Subtract(tp);

            QuizMain quizDlg = new QuizMain();
            if ( !quizDlg.InitQuiz(candidateWordPads, (QuizMain.QuizType)testType, wordCount,
                (NewWordItem.ProficiencyLevel)familarity,
                startDate, endDate, checkBoxAllTime.Checked ) )
            {
                return;
            }
            Hide();
            this.Close();
            quizDlg.ShowDialog(MainDlg.Instance);
        }
Beispiel #5
0
 private void recoverBtn_Click(object sender, EventArgs e)
 {
     LogResult();
     QuizMain testDlg = new QuizMain();
     if ( testDlg.InitQuiz(m_result.wrongWords, m_result.wrongWordsOptions) )
     {
         Hide();
         Close();
         testDlg.ShowDialog(MainDlg.Instance);
     }
 }