CSC/ECE 517 Fall 2015/oss E1560 PSV: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 38: Line 38:
=Changes Made<ref>https://github.com/viveksubbarao/expertiza/commits/master</ref>=
=Changes Made<ref>https://github.com/viveksubbarao/expertiza/commits/master</ref>=


<p>'''1 PopUpController.rb'''</p>
==Case 1.1: Modified <code>Action_allowed</code> method to return true only if .. ==
==Case 1.2: ==
==Case 1.3: ==
==Case 1.4: ==
<p></p>
<p>'''2 ParticipantsController.rb'''</p>
==Case 2.1: ==
==Case 2.2: ==
==Case 2.3: ==
==Case 2.4: ==


= References=
= References=
<references/>
<references/>

Revision as of 04:57, 31 October 2015

E1560. Refactoring PopUpController.rb and ParticipantsController.rb

This page provides a description of the Expertiza based OSS project. This project is aimed at refactoring PopUpController.rb and ParticipantsController.rb.


Introduction to Expertiza

Expertiza is an Open Source Rails application which is used by instructors and students for creating assignments and submitting peer reviews. Expertiza allows the instructor to create and customize assignments, create a list of topics the students can sign up for, have students work on teams and then review each other's assignments at the end. The Source code of the application can be cloned from Github, and the latest active branch is "Rails 4".

Project Desicription<ref>https://docs.google.com/document/d/1uWs3zyrupTmrOFuv5IbVWCF4NRvCXqJmg8dZ0wCqgus/edit</ref>

Files involved:

PopUpController.rb

ParticipantsController.rb

What they do

PopUpController displays a review when a user (instructor or student) clicks on a list of reviews.

ParticipantsController handles participants in an assignment.

What's wrong with them:

PopUpController contains only two prominent methods, but they are very big.

ParticipantsController contains redundant code.

What needs to be done:

1 PopUpController.rb

1.1 Action_allowed method always returns true

1.2 Team_user_popup method needs refactoring. @teamId is assigned but never used, what is id2.Comments can be added at make code more readable. Rename variables based on their usage

1.3 Change instance variables to local variables where possible.

1.4 Participants_popup and team_users_popup methods must be refactored into smaller private methods.

2 ParticipantsController.rb

2.1 In add and update_authorization methods, permissions collection object can be used to reference its elements without assigning each element to individual private variables. It will make the code more concise.

2.2 Inherit and bequeath_all methods are similar. Common statements can be migrated to private method. Add comments in code to make it easy to understand.

2.3 Cluster all the flash messages under one private method. It will make them easy to manage.

2.4 Fix email_sent method. It contains a dummy email address. Check if this method can be removed.

Changes Made<ref>https://github.com/viveksubbarao/expertiza/commits/master</ref>

1 PopUpController.rb

Case 1.1: Modified Action_allowed method to return true only if ..

Case 1.2:

Case 1.3:

Case 1.4:

2 ParticipantsController.rb

Case 2.1:

Case 2.2:

Case 2.3:

Case 2.4:

References

<references/>