Low Xi Zhi - Project Portfolio Page

Overview

WhenFree is a Command Line scheduler chatbot for NUS students to find common free time among them and their friends, using just the NUSMODS links to their school timetable.

Summary of Contributions

Example Contributions to the User Guide:

Edit a contact’s timetable: edit

There are 2 use cases illustrated below: to edit a contact’s timetable to “busy” for a specified time slot, and to edit a contact’s timetable to “free” for a specified time slot.

Use case 1: Edits a contact’s timetable to be “busy” for a specified time slot. You need to key in <Contact Index> of the contact, and specify the time slot to be marked “busy” with <Start Date> <Start Time> <End Date> <End Time>.

Format:

edit busy <Contact Index> <Start Date> <Start Time> <End Date> <End Time>

Example of usage:

edit busy 0 11 09:00 11 10:00

Example output:

edit busy 0 11 09:00 11 10:00


Use case 2: Edits a contact’s timetable to be “free” for a specified time slot. You need to key in <Contact Index> of the contact, and specify the time slot to be marked “free” with <Start Date> <Start Time> <End Date> <End Time>.

Format:

edit free <Contact Index> <Start Date> <Start Time> <End Date> <End Time>

Example of usage:

edit free 0 11 09:00 11 10:00

Example output:

edit free 0 11 09:00 11 10:00

↑ Return to list of Features


Example Contributions to the Developer Guide:

3.5 Edit a contact’s timetable

EditContact
Fig 14. Sequence diagram of the implementation of the Edit a contact's timetable feature

Fig 14. shows the sequence diagram of editing the schedule (timetable) of a selected contact at a given time slot. It consists of 3 classes:LogicManager Commandhandler Contact.

Given below is an example usage scenario of the Edit a contact's timetable feature.

  1. The user invokes the LogicManager by entering edit <contact index> <time slot>.

    :information_source: The original user input formats for EditCommand are:
    edit busy <contact index> <start day> <start time> <end day> <end time> and
    edit free <contact index> <start day> <start time> <end day> <end time>,
    for editing the Contact’s schedule to “busy” and “free” at the given time slot respectively. We generalise edit busy and edit free as edit in the sequence diagram as their execution are similar. We also represent <start day> <start time> <end day> <end time> as <time slot> in the sequence diagram to keep it concise.

  2. The LogicManager requests to edit a contact’s schedule via CommandHandler.
  3. The CommandHandler retrieves Contact from ContactList using the contact’s index passed into the command.

    :information_source: This step is omitted in the sequence diagram to keep it concise.

  4. The CommandHandler calls editSchedule(time slot) of Contact. If edit busy, the schedule of Contact will be marked as “busy” for the given time slot. If edit free, the schedule of Contact will be marked as “free” for the given time slot.

The schedule of the Contact is edited and saved in the application.

3.5.1 Design Considerations

Aspect 1: Clash of Meeting’s time slot and EditContact’s time slot when editing main user’s schedule

The implementation described above would allow the overwrite of any time blocks in the Contact’s schedule. This
would be problematic when editing the main user’s schedule, which contains Meetings’ time slots. A possible problematic scenario is if we edit over a Meeting’s time slot and set the time slot to “free”, we would subsequently be able to schedule another meeting at the same time slot. This results in multiple Meetings occupying the same time slot.

We chose Alternative 1 for these reasons:

  1. The intended purpose of the edit function is to make amendments to schedules pulled from NUSMODS so that additional “busy” slots or “free” slots can be visualized in the timetable, not to edit over meetings.
  2. Editing of a Meeting’s time slot to be “free” will be equivalent to deleting the Meeting, for which there is a dedicated feature implemented. This causes unnecessary overhead in functionality.
  3. Alternative 1 is easier to implement. When a clash is detected, Alternative 1 requires only the throwing of exception, whereas Alternative 2 requires the removal of Meeting from MeetingList.

EditContact
Fig 15. Sequence diagram of checking if an edit is valid in the Edit a contact's timetable feature

Fig 15. shows the sequence diagram illustrating the implementation of Alternative 1. Checking validity of edit is done before editSchedule() of Contact is called, as shown in Fig 14.

  1. This path is optional, and is only implemented if Contact the main user.
  2. CommandHandler calls isValidEdit(time slot) of the Contact class.

  3. isValidEdit(time slot) uses the Contact’s schedule to check if any of the time blocks within the time slot is a “meeting” time block.
  4. If no “meeting” time block is detected within the time slot, the edit is valid. The program continues running and editSchedule() will be called.
  5. If a “meeting” time block is detected within the time slot, the edit is invalid. An invalid exception is thrown by Contact, and the user will be informed that the edit is invalid.

    :information_source: TextUI and Exception classes which are involved in generating the exception, and displaying the exception message to the user are omitted to keep the sequence diagram concise.