コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 public static void SetTotalMarkOfAssignmentToRandomValue(StudentAssignment studentAssignment, Random random)
 {
     studentAssignment.TotalMark = random.Next(1, 101);
 }
コード例 #5
0
 public void SetRandomMarkToAllStudentsAssignmetsOfACourse(int courseId, Random random)
 {
     StudentAssignment.SetTotalMarkOfAssignmentsToRandomValues(GetAllStudentAssignmentsForACourse(courseId), random);
 }