/// <summary> /// Displays all students test results for one chosen test in the StudentResultView /// </summary> /// <param name="testId"></param> public void DisplayStudentResult(int testId) { DisplayResult.Clear(); foreach (TestResult tr in StudentTestResults.ToList()) { foreach (Student student in AllStudents) { if (tr.TestId == testId && student.StudentId == tr.StudentId) { DisplayResult.Add($"TestId: {tr.TestId}\nNamn: {student.FirstName} {student.LastName}\nPoäng: {tr.TotalPoints}"); } } } }
private void Num_Click(object sender, EventArgs e) { if (DisplayResult.Text == "0" || operandPerformed) { DisplayResult.Clear(); } Button btn = (Button)sender; // DisplayResult.Text += btn.Text; operandPerformed = false; if (btn.Text == ".") { if (!DisplayResult.Text.Contains(".")) { DisplayResult.Text = DisplayResult.Text + btn.Text; } } else { DisplayResult.Text = DisplayResult.Text + btn.Text; } }
private void BtnClear_Click(object sender, RoutedEventArgs e) { DisplayPrint.Clear(); DisplayResult.Clear(); }