コード例 #1
0
ファイル: ResultsView.xaml.cs プロジェクト: nodirt/megadono
        public ResultsView(TestResults results)
        {
            if (results == null)
                throw new ArgumentNullException("results");
            _results = results;
            InitializeComponent();
            DataContext = results;

            App.Log.WriteLine(string.Format("Кончился тест {0}", results.Storage.Name));
            App.Log.WriteLine(string.Format("Баллов {0}/{1}. Вопросов {2}/{3}", results.GotPoints, results.MaxPoints, results.CorrectCount, results.QuestionCount));
        }
コード例 #2
0
ファイル: TestView.xaml.cs プロジェクト: nodirt/megadono
        private void finish(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show("Точно?", "Всё что-ли?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
                return;
            }

            SaveState();

            var answeredQuestions = _questions.Take(_maxIndex + 1).ToList();
            var results           = new TestResults
            {
                Storage       = _storage,
                QuestionCount = _maxIndex + 1,
                MaxPoints     = answeredQuestions.Sum(a => a.MaxPoints),
                GotPoints     = answeredQuestions.Sum(a => a.GotPoints)
            };

            App.MainWindow.Transition(new ResultsView(results));
        }
コード例 #3
0
ファイル: TestView.xaml.cs プロジェクト: nodirt/megadono
        private void finish(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show("Точно?", "Всё что-ли?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                return;

            SaveState();

            var answeredQuestions = _questions.Take(_maxIndex + 1).ToList();
            var results = new TestResults
            {
                Storage = _storage,
                QuestionCount = _maxIndex + 1,
                MaxPoints = answeredQuestions.Sum(a => a.MaxPoints),
                GotPoints = answeredQuestions.Sum(a => a.GotPoints)
            };
            App.MainWindow.Transition(new ResultsView(results));
        }