▶ run configuration · instructor session
Instructor session
Type instructor at the role prompt. Five options cover rosters, grading and course details. Course and profile edits are saved immediately; grades wait until exit.
▶ Student▶ Instructor▶ Administrator
Run as Instructor
Demo login 4000000001 / Teacher1234
5 options
At a glance# Helpers.showInstructorMenu() ---------Instructor Menu---------
1. View enrolled students.
2. Grade assignments.
3. Update course information.
4. Update personal information.
5. Logout.
role instructor
login Helpers.login<Instructor>
menu Helpers.showInstructorMenu()
option getSafeIntInput("Option: ")
handle switch (choice)
loop until Logout
2 of 5 options write to disk straight away. The rest change the in-memory lists, which are saved when someone types exit.
# Menu text main() calls Persistence 1 View enrolled students. loggedInInstructor.viewEnrolledStudents (loggedInInstructor, getAllCourses ())on exit 2 Grade assignments. loggedInInstructor.gradeStudent (getAllAssessments (), getAllCourses ())on exit 3 Update course information. Helpers .updateCourseInfo (loggedInInstructor, getAllCourses ()); saveCourses ()saves courses.txt 4 Update personal information. Helpers .updateInstructorProfile (loggedInInstructor); saveInstructors ()saves instructors.txt 5 Logout. loggedInInstructor.logout (loggedInInstructor)on exit
flow + example output
Every option#
process Loop over every course check Course instructor ID matches yours output Course header, then each student's name, ID, email and phone Roster (Course: Programming II) (Code: CS102)
-Student: Sara Khalid, ID: 2200000001, Email: sara.k@uni.example, Phone number: 0500000101 Empty roster No students enrolled in this course. No courses Instructor Lina Haddad is not assigned to any courses.
output Courses you're assigned to: input Select a course to grade: input Select a student to grade: input Choice: (Quiz_1 … Project) input Enter score (0-100): check Score between 0 and 100 process Update the matching Assessment or add a new one New grade Grade recorded successfully. Existing grade Grade updated successfully. Out of range Score must be between 0 and 100. Empty course No students enrolled in this course. No courses You're not assigned to any courses.
input Enter the course code of the course you would like to update: input Enter new schedule: input Enter new description: check Course exists and you are its instructor save courses.txt is rewritten straight away Updated Instructor Lina Haddad's course information updated for Programming II Not yours Omar Faris with the ID number: 4000000002 is not assigned to Discrete Mathematics. Unassigned No instructor assigned to Physics I. Unknown code Course with code XYZ1 not found.
input Do you want to change your password? 1.Yes 2.No check Each new value must pass its validator save instructors.txt is rewritten straight away Saved (printed twice) Instructor Lina Haddad's information updated.
process logout() returns a message, but main() does not print it Back to Enter your role from the current options: (Student/Instructor/Admin) or exit to finish.