| | 1 | = UseCase2001 – Assign Grade to Student |
| | 2 | |
| | 3 | **Initiating actor:** Professor |
| | 4 | |
| | 5 | **Other actors:** Student |
| | 6 | |
| | 7 | **Description:** |
| | 8 | A professor records the final grade for a student enrolled in a subject. |
| | 9 | |
| | 10 | **Scenario:** |
| | 11 | |
| | 12 | 1. Professor logs in and selects “Enter Grades.” |
| | 13 | |
| | 14 | 2. System shows subjects the professor teaches: |
| | 15 | {{{ |
| | 16 | SELECT sub.Id, sub.Name, st.Id AS Student_Id, st.Name, st.Surname |
| | 17 | FROM Subject sub |
| | 18 | JOIN Subject_Professor sp ON sp.Subject_Id = sub.Id |
| | 19 | JOIN Student_Subject ss ON ss.Subject_Id = sub.Id |
| | 20 | JOIN Student st ON st.Id = ss.Student_Id |
| | 21 | WHERE sp.Professor_Id = :professor_id; |
| | 22 | }}} |
| | 23 | |
| | 24 | 3. Professor selects a student and enters the final grade. |
| | 25 | |
| | 26 | 4. System updates the database: |
| | 27 | {{{ |
| | 28 | UPDATE Student_Subject |
| | 29 | SET Final_Grade = :grade, Status = 'COMPLETED' |
| | 30 | WHERE Student_Id = :student_id AND Subject_Id = :subject_id; |
| | 31 | }}} |
| | 32 | |
| | 33 | 5. System confirms the update and allows professor to continue for other students. |