CS102/enrolment
Report
enrolment›run configurations›Instructor session

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.

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.
  1. roleinstructor
  2. loginHelpers.login<Instructor>
  3. menuHelpers.showInstructorMenu()
  4. optiongetSafeIntInput("Option: ")
  5. handleswitch (choice)
  6. loopuntil 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 textmain() callsPersistence
1View enrolled students.loggedInInstructor.viewEnrolledStudents(loggedInInstructor, getAllCourses())on exit
2Grade assignments.loggedInInstructor.gradeStudent(getAllAssessments(), getAllCourses())on exit
3Update course information.Helpers.updateCourseInfo(loggedInInstructor, getAllCourses()); saveCourses()saves courses.txt
4Update personal information.Helpers.updateInstructorProfile(loggedInInstructor); saveInstructors()saves instructors.txt
5Logout.loggedInInstructor.logout(loggedInInstructor)on exit

flow + example output

Every option#

1

View enrolled students.

Rosters for every course you are assigned to.

  1. processLoop over every course
  2. checkCourse instructor ID matches yours
  3. outputCourse 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.
2

Grade assignments.

Course → student → exam type → score, then update or record.

  1. outputCourses you're assigned to:
  2. inputSelect a course to grade:
  3. inputSelect a student to grade:
  4. inputChoice: (Quiz_1 … Project)
  5. inputEnter score (0-100):
  6. checkScore between 0 and 100
  7. processUpdate 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.
3

Update course information.

New schedule and description for a course you teach.

  1. inputEnter the course code of the course you would like to update:
  2. inputEnter new schedule:
  3. inputEnter new description:
  4. checkCourse exists and you are its instructor
  5. savecourses.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.
4

Update personal information.

Yes/No for password, email, phone and address, each validated.

  1. inputDo you want to change your password? 1.Yes 2.No
  2. checkEach new value must pass its validator
  3. saveinstructors.txt is rewritten straight away
Saved (printed twice)
Instructor Lina Haddad's information updated.
5

Logout.

Return to the role prompt.

  1. processlogout() 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.