public string GetResult() { string totalText = ""; foreach (KeyValuePair <KettelTest.Type, int> item in pointsDictionary) { int points = KettelTest.GetPoints(item.Key, item.Value); totalText += item.Key.ToString() + ": " + points.ToString() + " " + (points > 6 ? results[item.Key].high : results[item.Key].low) + "\n"; } totalText += "\nКраткая характеристика\n"; foreach (KeyValuePair <KettelTest.Type, int> item in pointsDictionary) { int points = KettelTest.GetPoints(item.Key, item.Value); totalText += item.Key.ToString() + ": " + BriefDescription.GetDescription(item.Key) + "\n\n"; } return(totalText); }
public ResultView() { userNameLabel = new Label(); userNameLabel.AutoSize = true; userNameLabel.Text = "Спасибо за уделенное время!"; userNameLabel.TabIndex = 0; Program.mainForm.Controls.Add(userNameLabel); userNameLabel.Location = new System.Drawing.Point((Program.mainForm.Size.Width - userNameLabel.Size.Width) / 2, 50); userNameLabel = new Label(); kettelLabel = new Label(); mathLabel = new Label(); memoryLabel = new Label(); encryptionLabel = new Label(); missLabel = new Label(); labelList = new List <Label>() { userNameLabel, kettelLabel, mathLabel, memoryLabel, encryptionLabel, missLabel }; int x = 0, y = 70; userNameLabel.Text = SQLData.user_name; kettelLabel.MaximumSize = new System.Drawing.Size(650, 1000); kettelLabel.Text = "Результат по фактору " + KettelTest.Type.B.ToString() + " " + KettelTest.GetAnswer(KettelTest.Type.B) + "\n" + BriefDescription.GetDescription(KettelTest.Type.B) + "\n" + "Результат по фактору " + KettelTest.Type.Q1.ToString() + " " + KettelTest.GetAnswer(KettelTest.Type.Q1) + "\n" + BriefDescription.GetDescription(KettelTest.Type.Q1) + "\n" + "Результат по фактору " + KettelTest.Type.Q3.ToString() + " " + KettelTest.GetAnswer(KettelTest.Type.Q3) + "\n" + BriefDescription.GetDescription(KettelTest.Type.Q2) + "\n" + "Результат по фактору " + KettelTest.Type.Q4.ToString() + " " + KettelTest.GetAnswer(KettelTest.Type.Q4) + "\n" + BriefDescription.GetDescription(KettelTest.Type.Q4) + "\n"; mathLabel.Text = "Результат по арифметической части " + MathematicalTest.GetAnswer() + "/" + MathematicalTest.questions.Count; //+ " бонусное время : " + MathematicalTest.GetBonusTime(); memoryLabel.Text = "Результат по тесту \"Ряды\"" + MemoryTest.GetAnswer().ToString() + " запомненых цифр"; encryptionLabel.Text = "Результат по тесту \"Шифрование\"" + EncryptionTest.answersCount.ToString() + " правильных расшифровок"; missLabel.Text = "Результат по тесту \"Недостащие детали\"" + MissingDetailsTest.GetAnswer().ToString() + "/" + MissingDetailsTest.GetInfo().Count; for (int i = 0; i < LABEL_COUNT; i++) { labelList[i].AutoSize = true; labelList[i].Location = new Point(x, y); labelList[i].TabIndex = 0; y += 40; if (i == 1) { y += 200; } } AlignX(); }