Allocation Completeness Report
For each SubjectAllocationStats
in semester, check if TeacherSubjectRequest
corresponds to TeacherSubjectAllocation
.
We need to implement validation to TeacherSubjectAllocation
with respect to the TeacherSubjectRequest
, CoursePreferences
and JoinedSubjectGroup
for the teacher and sujbect.
To do so, we need to define interface that will accept all these information and to implement multiple instances that will do the different validation logics. The interface should be:
public interface TeacherSubjectAllocationValidator {
String validateAndUpdateValidationMessage(TeacherSubjectAllocation allocation);
}
In the implementation methods, the allocation
should be updated with appending the validation message on its validationMessages
field.
In this task, we need to implement 3 versions of the interface:
-
MultipleLecturesValidator
adds message if the professor has not selected multiple lectures, but they are assigned to it (checks both lectures and auditorium exercises) -
AuditoriumExerciseValidation
adds message if the teacher is professor (not applicable for the assistants), does not prefer exercises , but exercises are allocated -
LabExerciseValidation
adds message if the teacher does not prefer lab exercises , but exercises are allocated and they are not consultations
We need a validation button to the admin/subject-teacher-allocation
page that will invoke the validation for all TeacherSubjectAllocation
by semester. The service should inject List<TeacherSubjectAllocationValidator> validators
via constructor injection and for each TeacherSubjectAllocation
in the semester we need to invoke the method validateAndUpdateValidationMessage
for all injected validators.