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 1: Line 1:
This wiki page describes changes made under the E2407 OODD assignment for Spring 2024, CSC/ECE 517.
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.
== Description of the project ==
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/>
[https://github.com/expertiza/expertiza/pull/2303 Link to the Pull Request Submitted] <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 ==
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.
== 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 <br/>
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for<br/>
-Replace switch statements with subclasses methods <br/>
-Create models for the subclasses<br/>
-Remove hardcoded parameters<br/>
== 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.

Revision as of 03:00, 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.


Description of the project

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.

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

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.

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.