public void CreatePersonalAssigmentsForStudent(Student newStudent) { foreach (var assignment in Assignments) { var studentAssignmentTitle = assignment.Title; var studentAssignmentDescription = assignment.Description; var studentAssignmentSubmissionDateAndTime = assignment.SubmissionDateAndTime; StudentAssignment studentAssignment = new StudentAssignment(studentAssignmentTitle, studentAssignmentDescription, studentAssignmentSubmissionDateAndTime, this); newStudent.PersonalAssignments.Add(studentAssignment); } }
public void SetRandomTotalMarkToAllStudentsAssignments(Random random) { if (Courses.Count == 0) { throw new InvalidOperationException("There are no registered courses."); } foreach (var course in Courses) { StudentAssignment.SetTotalMarkOfAssignmentsToRandomValues(GetAllStudentAssignmentsForACourse(course.Id), random); } }
public void CreatePersonalAssignmentsForAllStudentsAppliedToCourse(Assignment newCourseAssignment) { foreach (var student in Students) { var studentAssignmentTitle = newCourseAssignment.Title; var studentAssignmentDescription = newCourseAssignment.Description; var studentAssignmentSubmissionDateAndTime = newCourseAssignment.SubmissionDateAndTime; var course = newCourseAssignment.Course; StudentAssignment studentAssignment = new StudentAssignment(studentAssignmentTitle, studentAssignmentDescription, studentAssignmentSubmissionDateAndTime, this); student.PersonalAssignments.Add(studentAssignment); } }
public static void SetTotalMarkOfAssignmentToRandomValue(StudentAssignment studentAssignment, Random random) { studentAssignment.TotalMark = random.Next(1, 101); }
public void SetRandomMarkToAllStudentsAssignmetsOfACourse(int courseId, Random random) { StudentAssignment.SetTotalMarkOfAssignmentsToRandomValues(GetAllStudentAssignmentsForACourse(courseId), random); }