# Teacher Assignment ## Purpose Open **Learning Management → Teacher Assignment** (`/teacher-assignment`). Distribute a subject's students among existing lecturer workload assignments. For example, a coordinator can allocate programming students between two lecturers while retaining their assigned teaching hours. First create the [department workload](/en/docs/workload), then create lecturer assignments with the required teaching types and groups in [workload details](/en/docs/workload-details). For shared and virtual classes, also review [united lesson student distribution](/en/docs/united-students) and [virtual group students](/en/docs/virtual-group-students). ## Find the subject Complete all eight required filters in order. | Field | Example | | --- | --- | | Workload academic year | 2026/27 | | Educational degree | Bachelor's | | Learning format | Full-time | | Faculty | Faculty of Informatics | | Profession | Computer Science | | Course | 2 | | Term | 1 (the selected course's first term) | | Subject kind | Mandatory or elective | Changing any of the first seven values clears subsequent selections and the subject kind. Each subsequent filter remains disabled until its predecessor is filled. Click Search to load results. Applied values are stored in the address, and a new search returns to page one. Reset removes the filters and hides results. Retry a failed load with Refresh. Year, degree and format refer to the department workload. Faculty, profession, course, term and subject kind refer to the linked learning plan row, including rows of plans participating in united classes. One united workload can therefore have several plan-row contexts. A 2026/27 workload can correspond to course 2 of a 2025/26 intake plan. ## Actions in the list Rows show the subject and its kind, course, term, credit, teaching hours, student count, lecturers and distribution status. Unassigned means the distribution has not been confirmed; existing lecturer assignments may already appear. After saving, the row is marked Updated, and reopening shows the saved distribution. Use the row action to distribute students. It is disabled if there are no lecturer workload assignments. With creation permissions, an option opens lesson allocation in workload details. Create the necessary lecturer assignments there, save, then return. ## Distribute students 1. Open the selected subject. The editor displays lecturers with existing assignments, destination group(s), and students with their IDs, groups, courses and current lecturers. Each lecturer appears once even when they have several assignments. 2. On opening, the editor selects the lecturer whose assignment has the most marked students; a tie uses the first assignment in the response. For an unconfirmed distribution, the server preselects unambiguous eligible memberships where no competing assignment has the same teaching type and language. 3. Select a lecturer and tick the students to assign. Inspect the destination groups and marked rows. When switching lecturers, the current selection is retained and applied to the new destination. Adjust the marks if other students are intended before saving. 4. Search works by student name, ID and group. Select all results marks eligible unlocked students across all pages of the current search; Clear selection removes those marks. Selection persists when changing pages, and clearing search results leaves marks outside those results intact. 5. Check the selected count and warnings. Ineligible students and those with protected journal history in overlapping assignments cannot be changed. 6. Click Save. The server validates the full subject distribution, saves memberships and refreshes the list. Return to subjects and reopen the editor to verify the result. Before assigning the next lecturer, check the marks and eligible students again. ## Assignment rules Eligibility uses the same underlying data as journal student selection: current enrollment, plan row, profession, degree, format, workload year and group membership. Elective students need a current subject selection. Virtual, united and custom elective groups follow their respective subgroup memberships; students cannot be moved to an ineligible assignment here. | Rule | Effect | | --- | --- | | Same student, teaching type and language | Competing assignments for the same workload year and plan row, teaching type and effective language are prohibited. Selecting a lecturer removes the student from competing assignments within the edited context. | | Different teaching types | A lecture can belong to one lecturer and practical classes to another. Assignments for nonoverlapping types/languages remain. | | Several workloads for one lecturer | The editor selects eligible assignments automatically. Overlapping types are not duplicated. Where comparable assignments compete, earlier group number and ID take precedence. | | Mandatory subject | Every eligible student must be covered for every required teaching type/language. An incomplete distribution cannot be saved. | | Elective subject | Some eligible students can remain unassigned, while duplicate competing assignments and ineligible students are rejected. | | Journal history | A saved journal record may lock a student against transfers that would change ownership of that history. Existing grades and attendance are not automatically transferred. | | Concurrent changes | The server compares the saved distribution revision and workload state. If either changed, refresh and repeat the edits on current data. | **Example.** Lecturers A and B have practical classes for mandatory programming in the same teaching language. Student 101 can be assigned to either A or B for practical classes, but not both. Their lecture assignment with lecturer C remains when moving between A and B. If B has no workload assignment, B will be absent from the selector. Before selecting all eligible students for B, make sure the intended students are marked and A's practical-class assignment remains correct. If student 101 already has journal history with A, this move is locked. Do not split the same regular student-group record into contradictory destination group numbers: the server rejects an inconsistent distribution. ## Saved data and workload Saving stores each assignment's student membership for the selected learning plan row. The server recalculates educator workload student counts. For a regular direct mandatory subject it can also synchronize student group numbers with the assignment's educational unit. Virtual, custom elective and united groups have their own membership rules; this regular group-number synchronization does not apply to them. The operation does not rewrite teaching hours, lecturer assignments themselves or existing grade history. Saved memberships represent the distribution between lecturers, while the individual journal also depends on its underlying group/subgroup memberships and student eligibility. Open workload details and the appropriate lecturer's journal to verify student names and counts. If the journal differs, check the underlying group relations and avoid deleting existing assignments to move grades. ## Permissions and scopes | Action | Permission | | --- | --- | | Open and read module | `teacher-assignment`, `teacher-assignments.index`. | | Load filters | UI requires `academic-years.index`, `educational-degrees.index`, `learning-formats.index`, `faculties.index`, `professions.index`. Distribution, lecturers and student read endpoints are bound to the module read permission. | | Save distribution | `teacher-assignments.update`; the backend validates department access and the ability to update the workload under its approval state. | | Open creation of lecturer assignments | `educator-workloads.store` and `employee-workloads.show`; workload details may require additional permissions. | The module's scope is the workload's academic department (`department`). Faculty and profession filters identify the learning plan. They do not replace department authorization. Read-only users can inspect the distribution without changing marks or saving. ## Common issues - **No subjects:** verify the relevant workload year, degree, format, plan-row relations and department access. - **Lecturer missing:** create and save the assignment with the correct group and teaching type in workload details. - **Student missing or checkbox disabled:** check current enrollment, course, workload year, elective selection, subgroup membership, eligible lecturer assignment and journal history. - **Cannot save:** resolve competing assignments, cover all eligible mandatory students and verify journal history, permissions and approval state. - **Stale data (`teacher_assignment.stale`):** refresh, review the current distribution and apply the edits again. - **Unexpected count or journal:** compare the saved membership for each plan row and the relevant subgroup composition. Reload workload details and the lecturer's journal. ## Implementation references - [index.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/index.tsx) - [TeacherAssignmentFilters.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/TeacherAssignmentFilters.tsx) - [DistributionEditor.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/DistributionEditor.tsx) - [useDistribution.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/useDistribution.ts) - [distribution.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/distribution.ts) - [types.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/types.ts) - [useTeacherAssignment.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/TeacherAssignment/useTeacherAssignment.ts) - [api.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/TeacherAssignment/routes/api.php) - [TeacherAssignmentService.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/TeacherAssignment/Services/TeacherAssignmentService.php) - [TeacherAssignmentMembershipService.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/TeacherAssignment/Services/TeacherAssignmentMembershipService.php) - [TeacherAssignmentRepository.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/TeacherAssignment/Repositories/TeacherAssignmentRepository.php) - [TeacherDistributionRequest.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/TeacherAssignment/Http/Requests/TeacherDistributionRequest.php) - [GradeBookRepository.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/GradeBook/Repositories/GradeBookRepository.php) - [EmployeeWorkloadPolicy.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/EmployeeWorkload/Policies/EmployeeWorkloadPolicy.php)