Exemplo n.º 1
0
        private void NextButton_Click(object sender, RoutedEventArgs e)
        {
            CheckQuestion();
            _currentQuestion = _questionManager.GetNext();
            LoadToLabels(_currentQuestion);
            DisplayProgress(_questionManager.GetCurrentPosition());

            var remain = !_settings.EnableLimit ?
                         _questionManager.GetCount() - _answered.Count :
                         _settings.QuestionLimitCount - _answered.Count;

            InformationLabel.Content = $"Осталось вопросов: {remain}";

            if (remain == 1)
            {
                NextButton.Content = Const.ShowResult;
            }
            foreach (var rb in _radioButtonsList)
            {
                rb.IsChecked = false;
            }
            var cond = _answered.Count == _questionManager.GetFirstListCount() ||
                       (_answered.Count == _settings.QuestionLimitCount && _settings.EnableLimit == true);

            if (cond)
            {
                FinishTesting();
            }
        }
Exemplo n.º 2
0
        private void NextButton_Click(object sender, RoutedEventArgs e)
        {
            var cond = _answered.Count == _questionManager.GetFirstListCount() ||
                       (_answered.Count == _settings.QuestionLimitCount && _settings.EnableLimit == true);

            if (cond)
            {
                //_settings = SettingsController.Load();
                //swearLabel.Content = _settings.ShowSwearing ? Const.SwearsEnabled : Const.SwearsDisabled;
                FinishTesting();
            }
            else
            {
                CheckQuestion();
                _currentQuestion = _questionManager.GetNext();
                LoadToLabels(_currentQuestion);
                DisplayProgress(_questionManager.GetCurrentPosition());

                var remain = !_settings.EnableLimit ?
                             _questionManager.GetCount() - _answered.Count :
                             _settings.QuestionLimitCount - _answered.Count;

                InformationLabel.Content = $"Осталось вопросов: {remain}";

                if (remain == 0)
                {
                    NextButton.Content = Const.ShowResult;
                }
            }
        }