Allard Quek's Project Portfolio Page
ProgrammerError is a desktop application which helps CS2100 tutors manage their students’ lab results in a simple and efficient manner, allowing them to spend less time on administrative processes and more time teaching students.
The following is a summary of my contributions to the project. (View Reposense)
Features
-
Added the ability to upload student data
- What it does: Allows the TA to upload a CSV file containing students’ student ID, class ID, name and email
- Justification: So that the TA can automate the process of adding students to their classes without having to manually type the add command
- Highlights: This feature involved using different third-party libraries and evaluating their suitability (based on their size, ease-of-use, functionality offered). Challenges included handling the multiple possibilities for invalid user input with intuitive error messages and good design.
- Credits: opencsv (third-party library), Stackoverflow
-
Added the ability to download student data
- What it does: Allows the TA to download the current student data into a CSV format
- Justification: So that the TA can upload the students’ lab results onto Luminus gradebook or share them with other TAs.
- Highlights: This feature was challenging as it required integrating a third-party library into the project for the first time and ensuring the feature works across different devices. To improve the user experience, I also created a popup message to be which required significant exploration with CSS properties and display sizes.
- Credits: org.json (third-party library), Stackoverflow
-
Added the ability to view a dashboard of student and lab data
- What it does: Shows the total number of students, labs, classes, and the number of labs left to marked for each class
- Justification: So that the TA can track their progress in marking their students’ labs conveniently, especially when they have many students
- Highlights: This feature required using a TreeMap to store and retrieve students’ lab data efficiently so that the dashboard can be updated dynamically with minimal delay without using a database. Additionally, this feature required learning more about javafx components and CSS properties to make the dashboard interface more user-friendly.
Other Contributions
-
Project management:
- Managed releases 1.3-1.3b (2 releases) and issue tracker on GitHub
- Set up the GitHub team org, repo, issue labels, Gradle and Notion
- Recorded and edited demo videos for v1.3-v1.4 (2 videos)
- Enhancements to existing features:
-
Documentation:
- User Guide: Added documentation for table of contents, command syntax information,
upload
,download
,dashboard
- Developer Guide: Added implementation details for the
download
command, diagrams to explain the Ui component structure, and effort section detailing the team’s challenges and achievements
- User Guide: Added documentation for table of contents, command syntax information,
- Review and Mentoring Contributions:
Sample User Guide Contribution
3.3 Upload Data: upload
or F4 on keyboard
Uploads student data via a CSV file with the following header: studentId,classId,name,email
. Note that the data
should contain only the student ID, class ID, name and email field respectively and spaces directly before or after
commas should be avoided.
Here is an example CSV file on GitHub. You may download files from GitHub following the instructions here.
Note: the CSV should not contain students’ lab results since this functionality is only meant for the TA to automate the adding of students to PE.
- If there are already existing students, the upload will overwrite the existing data rather than append to it. This is because in a typical use case, the TA would not want to have the existing data kept if they would like to use student data from their own CSV file.
- Furthermore, simply uploading the CSV obtained via the
download
command will result in the file being rejected
In summary:
- Select a valid CSV file (with header:
studentId,classId,name,email
) from the file chooser. - Note that this command is not meant for uploading lab results. Rather, it is only for automating the adding of students to PE.
Sample Developer Guide Contributions
UI Component
The API of this component is specified
in Ui.java
At a high level, the MainWindow
component interacts with 3 other main components: Logic
, PopupManager
and FileManager
(Figure 4.2.1).
Note that the components under MainWindow
have been omitted for simplicity and will be shown in greater detail in the next diagram.
- Firstly,
MainWindow
interacts with theLogic
component to determine which data to display to the user. - Secondly,
MainWindow
conducts file operations on the Ui through aFileManager
. For instance, theFileManager
handles situations where the user is required to select files or directories. - Thirdly, to manage the display of popup windows to the user,
MainWindow
interacts with aPopupManager
which handles the configuration, creation and showing of popups on the Ui.
In addition, there are two additional windows that the UI can display: HelpWindow
and DashboardWindow
. They inherit
from the abstract class PopupWindow
, which captures the commonalities between classes that represent popup information
to be displayed to the user.
Now taking a closer look at the MainWindow
component, it consists of a number of parts e.g.CommandBox
, ResultDisplay
, StudentListPanel
, StatusBarFooter
etc. (Figure 4.2.2). These components, including the MainWindow
, inherit from the abstract UiPart
class which captures
the commonalities between classes that represent parts of the visible GUI. The following is a summary of the parts of the MainWindow
.
Note that the UI
component uses the JavaFx UI framework.
-
The layout of these UI parts are defined in matching
.fxml
files that are in thesrc/main/resources/view
folder. For example, the layout of theMainWindow
is specified inMainWindow.fxml
-
The styling of the UI components are defined in the
src/main/resources/view/css
folder.
The UI
component,
- executes user commands using the
Logic
component. - listens for changes to
Model
data so that the UI can be updated with the modified data. - keeps a reference to the
Logic
component, because theUI
relies on theLogic
to execute commands. - depends on some classes in the
Model
component, as it displaysStudent
object residing in theModel
.
Download Command
Implementation
The implementation details of this feature can be found mainly in MainWindow
as most of the necessary operations are
related to the UI. In addition, the following classes are utilized:
-
DownloadCommand
: for generating theDownloadCommandResult
-
DownloadCommandResult
: for displaying the feedback to the CS2100 TA -
MainWindow.fxml
: for the addition of a ‘Download’ button on the MainWindow -
Popup.css
: for the customisation of styles for pop-up messages
In the Logic
components, the download
command works in a similar fashion to the show
command, except that it does
not require its own parser.
This sequence diagram in Figure 5.5.1 shows how the download
command works at a lower level:
The following activity diagram in Figure 5.5.2 summarizes what happens when a CS2100 TA executes the download command:
Design Considerations
One of the main considerations was to deal with reading and writing files only when necessary. This meant checking if there is any data to begin with. Only if there exists any data will the CS2100 TA be prompted to select a folder destination.
Additionally, a pop-up message was chosen to be displayed for two reasons. First, it provides the user a clear visual indicator of the result of their command, as compared to the typical textual output they would see. Second, we would only know if the data was successfully downloaded after the textual response is shown to the user. Using a pop-up message right at the end of this operation means we can customize the message depending on whether the download was a success.
Alternatives
-
One alternative could be to not use a third-party package (
org.json
), and instead manually parse the json file and write the corresponding values to a CSV file which ProgrammerError would create. We chose not to go down this route as it is much more tedious with little reward in terms of code management and code quality. -
Another alternative with respect to the CS2100 TA experience could be to disallow the user from selecting a folder to save their data to. Instead, a default location could be chosen so as to save the CS2100 TA some time in getting their data downloaded quickly. However, since we wanted to make ProgrammerError more flexible and adaptable to different users, we opted to include the functionality of allowing the CS2100 TA to select a folder destination.