-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Introduction
Project Team Members
Jeremy De Freitas
Lorenzo La Caille
Nicholas Smith
Nickal Winter
Project Scope
The scope of this project is to create a java application called FileFixer, which locates and process zero or more pdf files that can be found in a specified directory to be renamed. This will be done by accepting a CSV file containing students marks and feedback information as well as a collection of marked up assignment files named according to a specific convention (convention 1). The application will extract the relevant information from the CSV file and use this information to rename the collection of assignment files according to a specific naming convention (convention 2). The FileFixer application will also produce a list of missing submission files based on the CSV file’s student list. This list will vary depending on whether the student file is missing or if there is a problem with their submission and their file needs to be reviewed. In addition, a test suite will be developed for evaluation of the application’s performance. The application code will be documented on a GitHub repository. Additionally, the application will be developed using two design patterns, Composite and Iterator which will conform to SOLID design principles and will be evaluated using a Test-Driven Design.
Purpose
The myeLearning content management platform provides students with a medium to submit files such as PDFs or word documents. Submissions can be individually, or batch downloaded by lecturers for grading and annotations, and then re-uploaded to provide feedback to the relevant students. Files submitted on the myeLearning platform must conform to a specific naming convention in order to be accepted by the platform. A common problem that arises when students submit files with names that do not conform to the myeLearning naming convention is that the platform rejects submissions by the lecturer when they’re attempting to reupload the graded file. The lecturer is then faced with the tedious task of individually renaming the files to meet the platform’s naming convention. This is where File Fixer will help prevent such cases from occurring and relieve such unnecessary stress from the lecturer.
User Requirements
*The user shall place the project folder on their desktop.
*The user shall place the filesToRename folder in the project folder.
*The user shall place the relevant files in the filesToRename folder “ .csv / .pdf “.
*The user shall press enter to start the program.
System Requirements
*The program directories shall be dynamic and cater for both Mac and Windows.
*The program shall check the project /filesToRename directory for the “ .csv “ file and throw the appropriate error message if file is missing or read and store file data in a Student instance and array.
*The program shall check the project /filesToRename directory for the “ .pdf “ files and throw the appropriate error message if files are missing or read and store the files data in a ToRename instance, array and its list.
*The program shall create a renamedFiles folder in the /filesToRename directory.
*The program shall iterate through the ToRename array and rename all files which don’t match the required naming convention and copy all files to the renamedFiles folder.
*The program shall list all missing or problematic files in the missingSubmissions.txt in the /project directory.
Use Cases
Use Case: Test1 - Missing .pdf files
Actors: User (initiator)
Purpose: Test outcome of present “.csv “ file and missing “ .pdf “.
Type: primary
Overview: A user places a .csv file in the /filesToRename directory and 0 PDF files. The user starts the program and the missing files are listed in the missingSubmissions.txt in the /project directory.
Use Case: Test2 – All Valid
Actors: User (initiator)
Purpose: Test renaming outcome of present “.csv “ and “ .pdf “ files conforming to convention(1).
Type: primary
Overview: A user places a .csv file in the /filesToRename directory and 49 PDF files. The user starts the program and the files are renamed to conform to convention(2) and copied to the renamedFiles folder in the /filesToRename directory.
Use Case: Test3 – 30 Valid Actors: User (initiator)
Purpose: Test renaming outcome of present “.csv “ and “ .pdf “ files conforming and not conforming to convention(1).
Type: primary
Overview: A user places a .csv file in the /filesToRename directory and 30 PDF files. The user starts the program and the files which are successfully renamed to conform to convention(2) are copied to the renamedFiles folder in the /filesToRename directory. Those which can’t be renamed are listed in the missingSubmissions.txt in the /project directory.
Target Students
The target students are those who don’t follow assignment instructions and disregard the listed naming convention example.
Design patterns used: The FileFixer application utilizes two design patterns, namely, the composite design pattern and the iterator design pattern. The composite design pattern was used to create an interface, Individual View code snippet, which defines methods that are fundamental to the functionality of the program that the leaf class View code snippet, Student and the composite class View code snippet, ToRename implements. The Student class allows for Student objects to be created which consists of a particular student's information such as their name, participant ID and student ID. The information that is stored in an instance of the Student object comes from the CSV file that the program requires. The composite class, ToRename is used to store a collection, toRename, that consists of all the names of the files that need to be renamed. The composite class was used as the collection stored in the composite class can be compared to Student objects in order to determine which assignment submission belongs to which student. The second design pattern, the iterator design pattern, is made up of four classes. Namely, the IIterator interface View code snippet, the IContainer interface View code snippet, the FileCollection class View code snippet that implements the IContainer interface and the FileIterator class View code snippet that implements the IIterator interface. The iterator design pattern was used to iterate the collection of file names stored in the composite class. This allows for each file name to be compared against different pieces of information in order for the file to be renamed correctly. The iterator design pattern was also useful as it eliminated the need for multiple for loops in each rename class in order to get the objects from the composte collection.
Conformance to SOLID: The two design patterns used allow the program to conform to SOLID design principles, namely, the Single Responsibility principle as each class has a different responsibility, the Interface Segregation Principle as interfaces as segregated and the Open/Close Principle as interfaces are closed to modification but open to extension.
Class diagram:
Composite Design Pattern Class Diagram
Iterator Design Pattern Class Diagram

Setup requirements:
- Place a CSV file that contains student information in the filesToRename folder in the root directory of the program folder. (This folder is created automatically upon running the program)
- Place files that need to be renamed in filesToRename folder in the root directory of the program folder.
How to run:
- To run the program, place the program folder, FileFixer, on the Desktop of your machine.
- Open the program folder in the IDE of your choice and run the main class, FileFixer.java
- A prompt will appear on the console telling you to place the files you wish to rename as well as your CSV in a folder named filesToRename The filesToRename folder is created automatically upon running the program and is located in the root directory of the program folder
- After placing the files you wish to rename as well as your CSV file in the filesToRename folder, return to the console and press the ENTER key to start the program. You can also type HELP for the program's help page or EXIT to exit the program.
- After pressing ENTER to start the program, the program will rename the files in the filesToRename folder and place them in a nested folder in the filesToRename folder named renamedFiles
- A txt file will also be created in the root directory of the project folder that contains a list of missing submissions as well as flagged submissions.
Test Cases and Suites ReaderTest:
- testLoadCsvData()
- testLoadDirectoryFiles()
StudentTest:
- testStudentInstantiation()
- testGetNameOfStudent()
- testGetIDOfStudent()
- testGetPIDOfStudent()
- testGetStudentAttendance()
- testToStringOfStudentClass()
ToRenameTest:
- testGetToBeRenamedList()
- testAddToList()
- testStudentInstantiation()
- testGetNameOfStudent()
- testGetIDOfStudent()
- testGetPIDOfStudent()
- testGetStudentAttendance()
- testToStringOfStudentClass()