public StatisticForm(UserProgressStorage storage) { InitializeComponent(); Progress = storage.LoadProgress(); foreach (var item in Progress) { var correctAnswersPercent = ((float)item.CorrectAnswers / (float)item.Questions * 100) / 1; statisticChart.Series["Общее число вопросов"].Points.AddXY(item.TestDate.Day, item.Questions); statisticChart.Series["Лучшая серия ответов"].Points.AddXY(item.TestDate.Day, item.BestQueue); statisticChart.Series["Процент правильных ответов"].Points.AddXY(item.TestDate.Day, correctAnswersPercent); } }
private void finishPracticeButton_Click(object sender, EventArgs e) { UserProgressStorage userProgressStorage = new UserProgressStorage(user); userProgressStorage.AddUserProgress(new UserProgress() { ClefType = typeof(TClef).Name, TestDate = DateTime.Today, CorrectAnswers = Trainer.CorrectAnswers, BestQueue = Trainer.BestQueue, Questions = Trainer.TotalQuestions }); userProgressStorage.SaveProgress(); this.Close(); }