Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }
 public static void SetTotalMarkOfAssignmentToRandomValue(StudentAssignment studentAssignment, Random random)
 {
     studentAssignment.TotalMark = random.Next(1, 101);
 }
Ejemplo n.º 5
0
 public void SetRandomMarkToAllStudentsAssignmetsOfACourse(int courseId, Random random)
 {
     StudentAssignment.SetTotalMarkOfAssignmentsToRandomValues(GetAllStudentAssignmentsForACourse(courseId), random);
 }