Semester API (WIP) - TechnionYearlyProject/Exam-Scheduler GitHub Wiki
The Semester class contain all the relevant data of one semester, and provide the API to manipulate the courses, study programs, schedules and constraints of the semester.
Overview
The Semester contain 4 types of entities that represent it:
- The
Study programs
are the possible programs in the faculty. Each program define which courses are mandatory to finish it, and the semester at which the course should be taken. - The
Courses
are self-explanatory. - The
Schedules
define an exam period, the dates at which it starts and it ends and the hours of each course exam during this period. - The
Constraints
are a range of days that restrict the date where the course exam can be scheduled.
Study programs methods
addStudyProgram()
Add a study program to the Semester.
Parameters:
program
: The name of the study program.
Exceptions:
StudyProgramAlreadyExist
: A study program with the same name already exists in the Semester.
removeStudyProgram()
Remove a study program to the Semester, and remove from all the courses in which semester it should be taken according to the study program. The method has no effect it the study program doesn't exist in the Semester.
Parameters:
program
: The name of the study program.
getStudyProgramCollection()
Return a list of the study programs existing in the Semester.
Courses methods
addCourse()
Add a course to the Semester.
Parameters:
courseId
: The ID number of the course.name
: The name of the course.
Exceptions:
CourseAlreadyExist
: A course with the same ID number already exists in the Semester.
removeCourse()
Remove a course from the Semester. The method has no effect if there is no course with the given course ID in the Semester.
Parameters:
courseId
: The ID number of the course.
registerCourse()
Set the semester at which the course should be taken, in the given study program.
Parameters:
courseId
: The ID number of the course.program
: The name of the study program.semesterNum
: The number of the semester at which the course should be taken.
Exceptions:
CourseUnknown
: There is no course with the given course ID.StudyProgramUnknown
: There is no study program with the given program name.
unregisterCourse()
Remove the semester at which the course should be taken, in the given study program. The method has no effect if the course is not registered in the given study program.
Parameters:
courseId
: The ID number of the course.program
: The name of the study program.
getCourseCollection()
Return a list of the courses in the Semester.
Schedules methods
setStartDate()
Set the date at which the exam period A or B starts.
Parameters:
moed
: The exam period to update.start
: The date at which the exam period will start.
Exceptions:
InvalidSchedule
: The given start date is after the end date defined to the exam period.
setEndDate()
Set the date at which the exam period A or B starts.
Parameters:
moed
: The exam period to update.end
: The date at which the exam period will stop.
Exceptions:
InvalidSchedule
: The given end date is before the start date defined to the exam period.
scheduleCourse()
Define the exam date of a course.
Parameters:
courseId
: The ID number of the course.moed
: The exam period to update.date
: The date and hour of the exam.
Exceptions:
CourseUnknown
: There is no course with the given course ID in the Semester.DateOutOfSchedule
: The given date is before the start date or after the end date of the exam period.UninitializedSchedule
: The exam period's start and/or end dates are not defined.ScheduleDateAlreadyTaken
: There is already an exam scheduled to the same date.
unscheduleCourse()
Remove the exam date defined to a course. The method has no effect if the course has no exam date.
Parameters:
courseId
: The ID number of the course.moed
: The exam period to update.
getSchedule()
Return a map of the courses that have an exam date and their exam date, in the given exam period.
Parameters:
moed
: The wanted exam period.
Constraints methods
setConstraint()
Define a range of days where it is allowed to schedule the exam of a course.
Parameters:
courseId
: The ID number of the course.moed
: The wanted exam period.start
: The start date of the constraint.end
: The end date of the constraint.
Exceptions:
CourseUnknown
: There is no course with the given course ID in the Semester.DateOutOfSchedule
: One of the given dates is not between the start and end date of the exam period.UninitializedSchedule
: The exam period's start and/or end dates are not defined.InvalidConstraint
: The start date of the constraint is after the end date.
removeConstraint()
Remove the defined range of days where it is allowed to schedule the exam of a course. The method has no effect if no constraint was defined for the course or if there is no course with the given ID in the Semester.
Parameters:
courseId
: The ID number of the course.moed
: The wanted exam period.
getConstraintList()
Return a map of the courses that have a constraint and their constraint in the given exam period.
Parameters:
moed
: The wanted exam period.