CSC/ECE 517 Spring 2024 - E2407 Refactor review mapping controller.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:




== Description of the project ==
[ Link to the Pull Request Submitted] <br/>
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should be removed.  <br/> <br/>
[ Link to the deployed project] <br/>
[https://github.com/expertiza/expertiza/pull/2303 Link to the Pull Request Submitted] <br/>
[ Link to the Repository] <br/>
[http://152.7.98.87:8080/ Link to the deployed project] <br/>
[https://github.com/SriPallaviDamuluri/expertiza Link to the Repository] <br/>


== Functionality of review_mapping_controller ==
== Functionality of review_mapping_controller ==
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.
Review_mapping_controller's function is to supply reviewer and assignment mapping. In essence, the controller manages the assignment of reviews, such as peer and self-reviews, to several teams or to a single student user. Following assignment policy, this controller is also in charge of responding to requests from students for additional bonus evaluations.
 


== Problem Statement ==
== Problem Statement ==

Revision as of 03:09, 23 March 2024

This wiki page describes changes made under the E2407 OODD assignment for Spring 2024, CSC/ECE 517.

Expertiza Background

Expertiza is an open-source initiative that educators and students at NCSU create and manage. It contains several features that facilitate teacher-student interactions and is built on the Ruby on Rails architecture. Teachers can set homework and grade student submissions. Students organize into groups, turn in assignments, and evaluate the work of their colleagues.


[ Link to the Pull Request Submitted]
[ Link to the deployed project]
[ Link to the Repository]

Functionality of review_mapping_controller

Review_mapping_controller's function is to supply reviewer and assignment mapping. In essence, the controller manages the assignment of reviews, such as peer and self-reviews, to several teams or to a single student user. Following assignment policy, this controller is also in charge of responding to requests from students for additional bonus evaluations.


Problem Statement

The review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.

Tasks

-Refactor the long methods in review_mapping_controller.rb
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for
-Replace switch statements with subclasses methods
-Create models for the subclasses
-Remove hardcoded parameters

Design Pattern

We followed several design patterns while refactoring our code. One of the most common ones is the “Extract Method.” There were several instances where the method was too long and complex. We moved some of the functionality to a different method to make it more readable. This way, it became easier and clearer to understand what the method achieved. Another issue we observed with the code was that it had too many conditional statements. We used the “Refactoring conditionals” design pattern, which aims to place the block of code in the conditional statement in a different method and call that method. This improves the readability of our code.