CSC/ECE 517 Fall 2017/E1786 OSS Project Juniper: Bookmark enhancements
Peer Review Information
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor login: username -> instructor6, password -> password Student login: username -> student4340, password -> password Student login: username -> student4405, password -> password
Expertiza Background
Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.
Description of the current project
The following is an Expertiza based OSS project which deals primarily with the GradesController and GradesHelper. It focusses on refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing some redundant code. The goal of this project is to attempt to make this part of the application easier to read and maintain.
Files modified in current project
A controller and a helper file were modified for this project namely: 1. GradesController 2. GradesHelper
GradesController
This is a controller that helps students and instructors view grades and reviews, update scores, check for grading conflicts and calculate penalties. A couple of long and complex methods were refactored from this controller along with removal of some non-functional code and a few language changes to make it Ruby style. Three methods in particular, namely conflict_notification ,calculate_all_penalties and edit were found to be too long and were in need of refactoring into smaller, easier to manage methods. Few more compact methods were created for this purpose. There were no existing test cases for the controller. We have added a spec file named 'grades_spec.rb' under the spec folder. As no changes were done for the model, no tests for the model were included.
GradesHelper
This is a helper class which contains methods for constructing a table(construct_table) and to check whether an assignment has a team and metareveiw(has_team_and_metareview)
List of changes
We worked on the following work items(WIs)
WI1 : Refactor calculate_all_penalties method into smaller methods WI2 : Move the repeated code in conflict_notification & edit methods to a separate method list_questions. WI3 : Refactor the code as per the Ruby style guidelines and incorporate the good practices WI4 : Test the conflict_notification method to test the changes made. WI5 : Move the repeated code in view and view_my_scores methods to a separate method retrieve_questions [edit] Solutions Implemented and Delivered Refactoring calculate_all_penalties method This is used to calculate various penalty values for each assignment if penalty is applicable.
The following changes were made: 1. This method was very complex, performing too many functions within a single method and had to be broken into 3 smaller methods each having a more well defined function. 2. The following 3 methods were created after splitting the first method</nowiki>