<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Smulkur</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Smulkur"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Smulkur"/>
	<updated>2026-05-13T16:36:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144369</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144369"/>
		<updated>2022-04-06T20:07:19Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* RSpec Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143625</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143625"/>
		<updated>2022-03-27T22:28:54Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Running Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is an object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the ''show_calibration_results_for_student'' method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the ''show_calibration_results_for_student'' method, a call to the ''calibration_results_info'' method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the ''Save'' method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge model and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Resp_test_p1.jpeg|800px|]]&lt;br /&gt;
[[File:Resp_test_p2.jpeg|800px|]]&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143624</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143624"/>
		<updated>2022-03-27T22:28:29Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is an object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the ''show_calibration_results_for_student'' method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the ''show_calibration_results_for_student'' method, a call to the ''calibration_results_info'' method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the ''Save'' method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge model and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Resp_test_p1.jpeg|800px|]]&lt;br /&gt;
[[File:Resp_test_p2.jpeg|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_test_p2.jpeg&amp;diff=143623</id>
		<title>File:Resp test p2.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_test_p2.jpeg&amp;diff=143623"/>
		<updated>2022-03-27T22:27:58Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_test_p1.jpeg&amp;diff=143622</id>
		<title>File:Resp test p1.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_test_p1.jpeg&amp;diff=143622"/>
		<updated>2022-03-27T22:27:37Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143621</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143621"/>
		<updated>2022-03-27T22:24:27Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is an object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the ''show_calibration_results_for_student'' method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the ''show_calibration_results_for_student'' method, a call to the ''calibration_results_info'' method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the ''Save'' method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge model and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Resp_test_p1.png|800px|]]&lt;br /&gt;
[[File:Resp_test_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143618</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143618"/>
		<updated>2022-03-27T22:14:41Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is an object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the ''show_calibration_results_for_student'' method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the ''show_calibration_results_for_student'' method, a call to the ''calibration_results_info'' method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the ''Save'' method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge model and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143617</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143617"/>
		<updated>2022-03-27T22:14:07Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is an object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the '''show_calibration_results_for_student''' method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the '''show_calibration_results_for_student''' method, a call to the '''calibration_results_info''' method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the '''Save''' method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge model and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143615</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143615"/>
		<updated>2022-03-27T22:08:19Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: In&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
1) After providing a review of a particular project, calibration results are useful to differentiate the review given by the reviewer and that of the instructor's review for the same project. The main problem solved is to refactor the show_calibration_results_for_student method in the response controller. This method is called when the user clicks on show calibration results as shown in the UI Testing section. &lt;br /&gt;
&lt;br /&gt;
Inside the show_calibration_results_for_student method, a call to the calibration_results_info method is made which is part of the response model. This particular method is returning three values calibration_response, review_response, questions. In general, it is not a good approach to return the array of three values from the model method as the controller method has no idea what would be the return value from the model method. We have done refactoring for this which is explained in the Modified files and Refactorization section.&lt;br /&gt;
&lt;br /&gt;
2) In the Save method inside the response controller, changes are made which are specific to awarded badge model. But those changes should be part of a method present inside the awarded badge method and the controller should call that method. Changes are made for the same which are described in the below section.&lt;br /&gt;
&lt;br /&gt;
3) There are code climate issues that are being fixed and are described in detail in the below section.&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
This is a refactoring project, so we have refactored response controller while ensuring that existing tests don't break.&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143549</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143549"/>
		<updated>2022-03-22T22:26:30Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p5.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p5.png&amp;diff=143548</id>
		<title>File:Resp p5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p5.png&amp;diff=143548"/>
		<updated>2022-03-22T22:26:05Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143547</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143547"/>
		<updated>2022-03-22T22:05:43Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Running Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/response_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143546</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143546"/>
		<updated>2022-03-22T22:05:11Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Running Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143545</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143545"/>
		<updated>2022-03-22T22:03:43Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/models/responses_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. User Name: student432 Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143544</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143544"/>
		<updated>2022-03-22T22:01:26Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/models/responses_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. Username: student432, Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on the assignment Design Exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143543</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143543"/>
		<updated>2022-03-22T22:00:55Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/models/responses_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. Username: student432, Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on Design exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143542</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143542"/>
		<updated>2022-03-22T21:59:58Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/models/responses_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. Username: student432, Password: password&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p1.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
2) Click on Design exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
&lt;br /&gt;
[[File:resp_p2.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
3) Click on other's work&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p3.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
[[File:resp_p4.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p4.png&amp;diff=143541</id>
		<title>File:Resp p4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p4.png&amp;diff=143541"/>
		<updated>2022-03-22T21:58:21Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p3.png&amp;diff=143540</id>
		<title>File:Resp p3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p3.png&amp;diff=143540"/>
		<updated>2022-03-22T21:57:56Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p2.png&amp;diff=143539</id>
		<title>File:Resp p2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p2.png&amp;diff=143539"/>
		<updated>2022-03-22T21:57:24Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p1.png&amp;diff=143538</id>
		<title>File:Resp p1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Resp_p1.png&amp;diff=143538"/>
		<updated>2022-03-22T21:56:41Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143537</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143537"/>
		<updated>2022-03-22T21:54:52Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, '''E2218 refactor response_controller.rb''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar Mengani (amengan@ncsu.edu)&lt;br /&gt;
* Samson Reddy Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Modified Files and Refactorization ==&lt;br /&gt;
A. '''response_controller.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   '''authorize_show_calibration_results'''&lt;br /&gt;
   This method is used to authorize if the user(reviewer) is allowed to view the calibration results for the corresponding &lt;br /&gt;
   ''calibration_response_map_id'' and ''review_response_map_id'' &lt;br /&gt;
   passed as parameters in the URL.&lt;br /&gt;
   Ex: https://expertiza.ncsu.edu/response/show_calibration_results_for_student?calibration_response_map_id=165688&amp;amp;review_response_map_id=165790&lt;br /&gt;
   When someone tries to change the map_id's, the request should be authorized to check if the user can access the calibration result or not. &amp;lt;br&amp;gt;&lt;br /&gt;
   [[File:Authorize_show_calibration_results.png|1180px|]]&lt;br /&gt;
&lt;br /&gt;
   '''set_response'''&lt;br /&gt;
   @response and @map instance variables are initialized the same way across multiple methods.&lt;br /&gt;
   In order to avoid duplication, we created a before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
   [[File:Set_response_method.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. '''response_helper.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   Following methods are moved from the ''response_controller.rb'' class to ''response_helper.rb'' class since these methods are called from the &lt;br /&gt;
   controller action methods.&lt;br /&gt;
    i) '''current_user_is_reviewer''' &lt;br /&gt;
    ii) '''sort_questions'''&lt;br /&gt;
    iii) '''store_total_cake_score'''&lt;br /&gt;
    iv) '''set_content''' &amp;lt;br&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    [[File:Response_helper_1.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Response_helper_2.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
C. '''assignment_questionnaire.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''get_questions_by_assignment_id'''&lt;br /&gt;
   Parameters : assignment_id &lt;br /&gt;
   When a user clicks on 'calibration results' from UI, questions in the assignment that has been reviewed are displayed.&lt;br /&gt;
   A new method is added in the ''AssignmentQuestionnaire'' model class that returns the appropriate questions by querying the &lt;br /&gt;
   ''AssignmentQuestionnaire'' using the ''assignment_id''.&lt;br /&gt;
   This method is added to separate the business logic of retrieving the questions from the controller class.&lt;br /&gt;
     &lt;br /&gt;
   [[File: Get_questions_by_assignment_id.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
D. '''awarded_badge.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''award_badge'''&lt;br /&gt;
   Parameters :  participant_id, badge_name&lt;br /&gt;
   This method adds the ''badge_name'' to a specific ''participant_id'' in the AwardedBadges table. &lt;br /&gt;
   A separate method is created in the ''AwardedBadges'' model class to avoid the controller class from knowing the business logic of adding a badge &lt;br /&gt;
   name to a participant.&lt;br /&gt;
   &lt;br /&gt;
   [[File:RespControllerAwardBadge.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
   [[File:AwardBadgeMethod.png|1170px|]]&lt;br /&gt;
    &lt;br /&gt;
E. '''cake.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''store_total_cake_score'''&lt;br /&gt;
   This method clearly exposes the logic of retrieving the score for a cake question in the ''response_controller.rb'' class which is an incorrect &lt;br /&gt;
   design.  &lt;br /&gt;
   So, a model class method ''get_total_score_for_questions'' is added and the same logic of iterating over the Cake questions is moved there.&lt;br /&gt;
   Return results for this method remains same here.&lt;br /&gt;
   [[File:Cake.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
F. '''response.rb'''  &amp;lt;br&amp;gt;&lt;br /&gt;
   '''calibration_results_info'''&lt;br /&gt;
   This method in ''response.rb'' model is completely removed because this method only adds more complexity to the model class.&lt;br /&gt;
   We refactored the method ''show_calibration_results_for_student'' in the ''response_controller.rb'' class. &lt;br /&gt;
   Previously, ''calibration_results_info'' was just doing nothing but getting responses using ''calibration_response_map_id'' and &lt;br /&gt;
   ''review_response_map_id'', and querying ''AssignmentQuestionnaire''.&lt;br /&gt;
   Both of these operations can be done by using ''find'' method of model class and adding model class ''get_questions_by_assignment_id'' method.&lt;br /&gt;
&lt;br /&gt;
   '''create_or_get_response'''&lt;br /&gt;
   Method name ''populate_new_response'' is changed to ''create_or_get_response'' to convey the functionality of the method.&lt;br /&gt;
     &lt;br /&gt;
   [[File:Create_or_get_response.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
G. '''Code Climate issues''' &amp;lt;br&amp;gt;&lt;br /&gt;
   '''Update'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Update_line_long.png|1170px|]]&lt;br /&gt;
   &lt;br /&gt;
   '''Create'''&lt;br /&gt;
   Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
   [[File:Create_line_long.png|1170px|]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/models/responses_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
1) Login using the following details. Username: student432, Password: password&lt;br /&gt;
2) Click on Design exercise pertaining to course CSC/ECE 517, Spring 2017 &lt;br /&gt;
3) Click on other's work&lt;br /&gt;
4) Click on show calibration results, verify if the calibration results are displayed on the UI.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143236</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143236"/>
		<updated>2022-03-21T21:40:09Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Code Modifications and Refactorization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, &amp;quot;E2218 refactor response_controller.rb&amp;quot; project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar (amengan@ncsu.edu)&lt;br /&gt;
* Samson Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Code Modifications and Refactorization ==&lt;br /&gt;
Described below are the code refactoring tasks and issues addressed by this team. We have also included any pertinent details, reasonings, comments, warnings, etc., corresponding to each task.&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def set_response ===&lt;br /&gt;
@response and @map instance variables are initialized the same way across multiple methods. In order to avoid duplication, we created a &lt;br /&gt;
before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Set_response_method.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def award_badge ===&lt;br /&gt;
The code for awarding the badge to a participant is written inside the response controller. It is moved to the AwardedBadge model file and called from the response controller.&lt;br /&gt;
&lt;br /&gt;
[[File:RespControllerAwardBadge.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:AwardBadgeMethod.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: update ===&lt;br /&gt;
Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
&lt;br /&gt;
[[File:Update_line_long.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: create ===&lt;br /&gt;
Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_line_long.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;response_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;assignment_questionnaire.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awarded_badge.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cake.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_line_long.png&amp;diff=143235</id>
		<title>File:Create line long.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_line_long.png&amp;diff=143235"/>
		<updated>2022-03-21T21:39:08Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Update_line_long.png&amp;diff=143234</id>
		<title>File:Update line long.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Update_line_long.png&amp;diff=143234"/>
		<updated>2022-03-21T21:38:52Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143233</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143233"/>
		<updated>2022-03-21T21:38:32Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* Code Modifications and Refactorization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, &amp;quot;E2218 refactor response_controller.rb&amp;quot; project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar (amengan@ncsu.edu)&lt;br /&gt;
* Samson Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Code Modifications and Refactorization ==&lt;br /&gt;
Described below are the code refactoring tasks and issues addressed by this team. We have also included any pertinent details, reasonings, comments, warnings, etc., corresponding to each task.&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def set_response ===&lt;br /&gt;
@response and @map instance variables are initialized the same way across multiple methods. In order to avoid duplication, we created a &lt;br /&gt;
before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Set_response_method.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def award_badge ===&lt;br /&gt;
The code for awarding the badge to a participant is written inside the response controller. It is moved to the AwardedBadge model file and called from the response controller.&lt;br /&gt;
&lt;br /&gt;
[[File:RespControllerAwardBadge.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:AwardBadgeMethod.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: update ===&lt;br /&gt;
Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
&lt;br /&gt;
=== METHOD: create ===&lt;br /&gt;
Made changes to split a line into multiple lines because it is too long.&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;response_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;assignment_questionnaire.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awarded_badge.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cake.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143201</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143201"/>
		<updated>2022-03-21T20:37:47Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: /* METHOD: def award_badge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, &amp;quot;E2218 refactor response_controller.rb&amp;quot; project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar (amengan@ncsu.edu)&lt;br /&gt;
* Samson Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Code Modifications and Refactorization ==&lt;br /&gt;
Described below are the code refactoring tasks and issues addressed by this team. We have also included any pertinent details, reasonings, comments, warnings, etc., corresponding to each task.&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def set_response ===&lt;br /&gt;
@response and @map instance variables are initialized the same way across multiple methods. In order to avoid duplication, we created a &lt;br /&gt;
before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Set_response_method.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def award_badge ===&lt;br /&gt;
The code for awarding the badge to a participant is written inside the response controller. It is moved to the AwardedBadge model file and called from the response controller.&lt;br /&gt;
&lt;br /&gt;
[[File:RespControllerAwardBadge.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:AwardBadgeMethod.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;response_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;assignment_questionnaire.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awarded_badge.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cake.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:RespControllerAwardBadge.png&amp;diff=143198</id>
		<title>File:RespControllerAwardBadge.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:RespControllerAwardBadge.png&amp;diff=143198"/>
		<updated>2022-03-21T20:36:09Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:AwardBadgeMethod.png&amp;diff=143197</id>
		<title>File:AwardBadgeMethod.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:AwardBadgeMethod.png&amp;diff=143197"/>
		<updated>2022-03-21T20:35:52Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143191</id>
		<title>CSC/ECE 517 Spring 2022 - E2218: Refactor response controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2218:_Refactor_response_controller&amp;diff=143191"/>
		<updated>2022-03-21T20:29:43Z</updated>

		<summary type="html">&lt;p&gt;Smulkur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details project documentation for the CSC/ECE 517 Spring 2022, &amp;quot;E2218 refactor response_controller.rb&amp;quot; project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A response is the object that is created when someone fills out a review rubric, such as when one writes a review, gives feedback to a reviewer, or fills out a survey.  Responses to the individual rubric items are kept in Answer objects; each Answer object has a response_id to say what Response it is part of.  Since response_controller needs to work with many kinds of responses, its code is pretty general.  It is not the worst controller in the system, but it would be much clearer if its method names were more descriptive of what they do.&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer, efg@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
&lt;br /&gt;
* Sai Naga Vamshi Chidara (schidar@ncsu.edu)&lt;br /&gt;
* Akhil Kumar (amengan@ncsu.edu)&lt;br /&gt;
* Samson Mulkur (smulkur@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Code Modifications and Refactorization ==&lt;br /&gt;
Described below are the code refactoring tasks and issues addressed by this team. We have also included any pertinent details, reasonings, comments, warnings, etc., corresponding to each task.&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def set_response ===&lt;br /&gt;
@response and @map instance variables are initialized the same way across multiple methods. In order to avoid duplication, we created a &lt;br /&gt;
before_action action which will be called first before calling the corresponding methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Set_response_method.png|1200px|]]&lt;br /&gt;
&lt;br /&gt;
=== METHOD: def award_badge ===&lt;br /&gt;
The code for awarding the badge to a participant is written inside the response controller. It is moved to the AwardedBadge model file and called from the response controller.&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;response_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;assignment_questionnaire.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awarded_badge.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cake.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/vamshi-chidara/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2327 here]&lt;/div&gt;</summary>
		<author><name>Smulkur</name></author>
	</entry>
</feed>