<?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=Mgfiles</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=Mgfiles"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mgfiles"/>
	<updated>2026-09-09T10:32:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=147141</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=147141"/>
		<updated>2022-12-06T00:12:45Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from 1) all of the reviews a team has received and 2) all of the reviews a student has received from teammates and 3) all of the reviews a student has given to teammates. This would be calculated in a similar fashion to the average peer review score shown at the top of a student's review page. Currently, all review tables only display the average score for each row as shown on the figure below. As each row hosts a unique question, the average row score is the average score given/received for each question. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a team's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the HTML view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== vm_question_response.rb =====&lt;br /&gt;
This file hosts the methods required to build a review table. It has methods for linking an assignment to a questionnaire, adding reviews and score with color coding, displaying team members, etc. It also contains more computational based functions that calculate the number of comments greater than 20 words, for example. This file made sense to add a &amp;lt;code&amp;gt;composite_score&amp;lt;/code&amp;gt; method that loops through each question and calculates the average score given/received for that specific question. It returns an array containing the average review score and the maximum possible score which is further discussed in the below section. The method is smart in the sense that it can filter out questions that do not have a numeric response. &lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the &amp;lt;code&amp;gt;_view_compompsite_score.html.erb&amp;lt;/code&amp;gt; partial view which calls the &amp;lt;code&amp;gt;composite_score&amp;lt;/code&amp;gt; method to populate a string tag that displays the average score for all reviews out of the maximum possible score. The maximum possible score value sets a reference for how well the student performed. This was a requirement for showing a composite score with a reference point because not all questions are required to have the same maximum score. For example, take a review table with two questions with maximum scores of 1 and 5. If the student received a 1 / 1 and 5 / 5, the composite score would show 3 as calculated by the scores received divided by the number of questions. This would be confusing so a reference point must be added. This is done by summing the maximum scores possible 1 and 5 and again dividing by the number of questions. The view will now show 3 / 3 which are perfect marks!&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file uses the &amp;lt;code&amp;gt;_view_compompsite_score.html.erb&amp;lt;/code&amp;gt; partial to display the composite score for student views. It uses the same logic as the above description.&lt;br /&gt;
&lt;br /&gt;
===== _view_compompsite_score.html.erb =====&lt;br /&gt;
This file was created to add the &amp;lt;code&amp;gt;composite_score&amp;lt;/code&amp;gt; method call. This was broken out into a separate partial for any future view changes that may go into the composite score. This was also done to adhere to the DRY principle as several views are required to call this method. &lt;br /&gt;
&lt;br /&gt;
The following changes can be seen in the output of the image below. &lt;br /&gt;
[[File:Composite score fixes.png|center|border|1000px|Instructor view of a team's reviews showing a composite score]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The composite score calculation can also be seen on the student view here. A bug was received on the previous semesters work that their composite score calculation was breaking the average peer review score by setting it to zero. This issue has been resolved as you can see you can see both scores are being displayed in a correct manner.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Working peer review.PNG|center|border|1000px|Functional peer review score]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. So the display when in an anonymized view, where no names are to be shown, but only “Student nnn”,“Instructor mmm”, etc. (Anonymized view is intended to be used in demos, so we can use live data to demo the system without showing anyone’s name.)&lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
==== Use Case Flow diagram for Anonymized View ====&lt;br /&gt;
[[File:uml_1.PNG|center|border|500px|UML for Anonymized]]&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
The following bugs were discovered and still need to be fixed. These bugs were well outside of the scope of our project, however, we wanted to document them for future reference.&lt;br /&gt;
&lt;br /&gt;
These bugs can be found by logging in as an instructor, going to the Manage-&amp;gt;Assignments tab, clicking View Scores of Final project (and design doc) and then selecting any team.&lt;br /&gt;
&lt;br /&gt;
As a temporary debugging feature, we added column averages in an attempt to solve the issues we were seeing the review tables. You can see these averages in the bottom row of the image. Up until student 9020 all scores and averages are correct. It is theorized that the average score for student 9020 is being pulled from student 8977's scores on table 1. Student 9020 is showing review scores of student 9022 so the cells have become shifted by 1. The student 9020 review has essentially disappeared from the view which we could not determine the root cause of. The average of each row is being populated in student 9042 due to this shift by 1. &lt;br /&gt;
&lt;br /&gt;
The top image shows the student 9022 review which you can see is populated in student 9020 column from the bottom image.&lt;br /&gt;
&lt;br /&gt;
[[File:9022_student_review.PNG|center|border|1000px|Student 9022 review]]&lt;br /&gt;
&lt;br /&gt;
[[File:Reviews page.png|center|border|1000px|Instructors reviews page should bugs on the table]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
==== view_team_spec.rb ====&lt;br /&gt;
This test file was at first failing even without making any changes so first we fixed the failing test by filling in some incomplete factory creations in the set up of the test. Then, a negative check was added to make sure the teammate review scores are not displayed to the student while the assignment has show teammate reviews set to false. We had to do a negative case instead of positive because it was overly complicated to create a teammate review submission and a vm with that teammate review for the html file to register that there was a review to display. The added negative check looks like the code segment below:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
expect(page).to_not have_text 'Teammate Review'&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
For calculating the composite score, we built Rspec tests to ensure the correct calculation was being performed. We implemented factories in the &amp;lt;code&amp;gt;vm_question_response_spec.rb&amp;lt;/code&amp;gt; test file to improve modularity and code readability. Factories provide more flexibility in generating models to meet the requirements of the test, as opposed to fixtures. As you can see from the below image, the code uses a before section to streamline the creation of the many objects required to build a review table. Without these factories, each individual test would have required the reuse of object creation code which would have violated DRY principles.&lt;br /&gt;
&lt;br /&gt;
[[File:Spec factories.PNG|center|border|1000px|Use of RSpec testing factories]]&lt;br /&gt;
&lt;br /&gt;
Many variations of score arrays were passed into the &amp;lt;code&amp;gt;composite_score&amp;lt;/code&amp;gt; method for evaluation. All tests were passed after running the spec file. The score arrays included nil values, strings, etc. and ensured that the return value was correct. These tests can be seen here.&lt;br /&gt;
&lt;br /&gt;
[[File:Spec tests.PNG|center|border|1000px|Rspec tests for the composite_score method]]&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View teammate reviews as a student when enabled ====&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_student_heatmap.png|center|border|1000px|Student view shows teammate reviews of student if allowed]]&lt;br /&gt;
&lt;br /&gt;
==== 3) View composite score of reviews from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as instructor above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click Manage -&amp;gt; Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the View Scores of Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click into any team&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View composite score of reviews from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 3) Show descriptive name for heatmaps from an instructor view ====&lt;br /&gt;
The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_description_on_heatmap.png|center|border|1000px|Teammate Review Heatmap has descriptive title]]&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing for Anonymized User View: === &lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View your teammates names in the Team members section of review scores  ====&lt;br /&gt;
In Normal user view the Users name or ID is displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:student_view_scores.png|center|border|900px|Anonymized View]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== 2) Switch to Anonymized View and view your teammates names in the Team members section of review scores ====&lt;br /&gt;
In Anonymized view the Users name or ID is not displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:anonymized_view.png|center|border|900px|Anonymized View]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/colin-odowd/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2476&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.100:8080/&lt;br /&gt;
* '''Video:''' https://youtu.be/Hcqr4uLzU38&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146951</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146951"/>
		<updated>2022-12-04T15:17:05Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* view_team_spec.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. So the display when in an anonymized view, where no names are to be shown, but only “Student nnn”,“Instructor mmm”, etc. (Anonymized view is intended to be used in demos, so we can use live data to demo the system without showing anyone’s name.)&lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
==== Use Case Flow diagram for Anonymized View ====&lt;br /&gt;
[[File:uml_1.PNG|center|border|500px|UML for Anonymized]]&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
In addition to our required changes, we plan to explore the following bugs that we have found on the reviews page for the instructor: &lt;br /&gt;
&lt;br /&gt;
Up until student 9020 all scores and averages are correct. It is theorized that the average score for student 9020 is being pulled from student 8977's scores on table 1. Student 9020 is showing review scores of student 9022 so the cells have become shifted by 1. The student 9020 review has essentially disappeared from the view. The average of each row is being populated in student 9042 due to this shift. &lt;br /&gt;
&lt;br /&gt;
The top image shows the student 9022 review which you can see is populated in student 9020 column from the bottom image.&lt;br /&gt;
&lt;br /&gt;
[[File:9022_student_review.PNG|center|border|1000px|Student 9022 review]]&lt;br /&gt;
&lt;br /&gt;
[[File:Reviews page.png|center|border|1000px|Instructors reviews page should bugs on the table]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
==== view_team_spec.rb ====&lt;br /&gt;
This test file was at first failing even without making any changes so first we fixed the failing test by filling in some incomplete factory creations in the set up of the test. Then, a negative check was added to make sure the teammate review scores are not displayed to the student while the assignment has show teammate reviews set to false. We had to do a negative case instead of positive because it was overly complicated to create a teammate review submission and a vm with that teammate review for the html file to register that there was a review to display. The added negative check looks like the code segment below:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
expect(page).to_not have_text 'Teammate Review'&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
RSpec tests will be added as a component of the first code submission.&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View teammate reviews as a student when enabled ====&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_student_heatmap.png|center|border|1000px|Student view shows teammate reviews of student if allowed]]&lt;br /&gt;
&lt;br /&gt;
==== 3) View composite score of reviews from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as instructor above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click Manage -&amp;gt; Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the View Scores of Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click into any team&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View composite score of reviews from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 3) Show descriptive name for heatmaps from an instructor view ====&lt;br /&gt;
The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_description_on_heatmap.png|center|border|1000px|Teammate Review Heatmap has descriptive title]]&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing for Anonymized User View: === &lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View your teammates names in the Team members section of review scores  ====&lt;br /&gt;
In Normal user view the Users name or ID is displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:student_view_scores.png|center|border|900px|Anonymized View]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== 2) Switch to Anonymized View and view your teammates names in the Team members section of review scores ====&lt;br /&gt;
In Anonymized view the Users name or ID is not displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:anonymized_view.png|center|border|900px|Anonymized View]]&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146950</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146950"/>
		<updated>2022-12-04T15:16:45Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added description of changes to view_team_spec.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. So the display when in an anonymized view, where no names are to be shown, but only “Student nnn”,“Instructor mmm”, etc. (Anonymized view is intended to be used in demos, so we can use live data to demo the system without showing anyone’s name.)&lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
==== Use Case Flow diagram for Anonymized View ====&lt;br /&gt;
[[File:uml_1.PNG|center|border|500px|UML for Anonymized]]&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
In addition to our required changes, we plan to explore the following bugs that we have found on the reviews page for the instructor: &lt;br /&gt;
&lt;br /&gt;
Up until student 9020 all scores and averages are correct. It is theorized that the average score for student 9020 is being pulled from student 8977's scores on table 1. Student 9020 is showing review scores of student 9022 so the cells have become shifted by 1. The student 9020 review has essentially disappeared from the view. The average of each row is being populated in student 9042 due to this shift. &lt;br /&gt;
&lt;br /&gt;
The top image shows the student 9022 review which you can see is populated in student 9020 column from the bottom image.&lt;br /&gt;
&lt;br /&gt;
[[File:9022_student_review.PNG|center|border|1000px|Student 9022 review]]&lt;br /&gt;
&lt;br /&gt;
[[File:Reviews page.png|center|border|1000px|Instructors reviews page should bugs on the table]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
==== view_team_spec.rb ====&lt;br /&gt;
This test file was at first failing even without making any changes so first we fixed the failing test by filling in some incomplete factory creations in the set up of the test. Then, a negative check was added to make sure the teammate review scores are not displayed to the student while the assignment has show teammate reviews set to false. We had to do a negative case instead of positive because it was overly complicated to create a teammate review submission and a vm with that teammate review for the html file to register that there was a review to display. The added negative check look like the code segment below:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
expect(page).to_not have_text 'Teammate Review'&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
RSpec tests will be added as a component of the first code submission.&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View teammate reviews as a student when enabled ====&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_student_heatmap.png|center|border|1000px|Student view shows teammate reviews of student if allowed]]&lt;br /&gt;
&lt;br /&gt;
==== 3) View composite score of reviews from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as instructor above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click Manage -&amp;gt; Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the View Scores of Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click into any team&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View composite score of reviews from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 3) Show descriptive name for heatmaps from an instructor view ====&lt;br /&gt;
The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_description_on_heatmap.png|center|border|1000px|Teammate Review Heatmap has descriptive title]]&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing for Anonymized User View: === &lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View your teammates names in the Team members section of review scores  ====&lt;br /&gt;
In Normal user view the Users name or ID is displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:student_view_scores.png|center|border|900px|Anonymized View]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== 2) Switch to Anonymized View and view your teammates names in the Team members section of review scores ====&lt;br /&gt;
In Anonymized view the Users name or ID is not displayed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:anonymized_view.png|center|border|900px|Anonymized View]]&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146906</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146906"/>
		<updated>2022-11-21T19:22:05Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Added System Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
In addition to our required changes, we plan to explore the following bugs that we have found on the reviews page for the instructor: &lt;br /&gt;
&lt;br /&gt;
Up until student 9020 all scores and averages are correct. It is theorized that the average score for student 9020 is being pulled from student 8977's scores on table 1. Student 9020 is showing review scores of student 9022 so the cells have become shifted by 1. The student 9020 review has essentially disappeared from the view. The average of each row is being populated in student 9042 due to this shift. &lt;br /&gt;
&lt;br /&gt;
The top image shows the student 9022 review which you can see is populated in student 9020 column from the bottom image.&lt;br /&gt;
&lt;br /&gt;
[[File:9022_student_review.PNG|center|border|1000px|Student 9022 review]]&lt;br /&gt;
&lt;br /&gt;
[[File:Reviews page.png|center|border|1000px|Instructors reviews page should bugs on the table]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
RSpec tests will be added as a component of the first code submission.&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as test student7185 above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Navigate to assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View teammate reviews as a student when enabled ====&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_student_heatmap.png|center|border|1000px|Student view shows teammate reviews of student if allowed]]&lt;br /&gt;
&lt;br /&gt;
==== 3) View composite score of reviews from a student view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
The following tests were conducted as follows:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Sign in as instructor above&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click Manage -&amp;gt; Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click on the View Scores of Final Project assignment&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
- Click into any team&lt;br /&gt;
&lt;br /&gt;
==== 1) View student reviews received from teammates and given to teammates from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 2) View composite score of reviews from an instructor view ====&lt;br /&gt;
&lt;br /&gt;
---Code still being developed---&lt;br /&gt;
&lt;br /&gt;
==== 3) Show descriptive name for heatmaps from an instructor view ====&lt;br /&gt;
The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_description_on_heatmap.png|center|border|1000px|Teammate Review Heatmap has descriptive title]]&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146785</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146785"/>
		<updated>2022-11-20T18:37:59Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Added System Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
==== 1) View teammate reviews as a student when enabled ====&lt;br /&gt;
This test was conducted as follows:&lt;br /&gt;
# Sign in as test student7185 above&lt;br /&gt;
# Navigate to assignments&lt;br /&gt;
# Click on the Final Project assignment&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_student_heatmap.png|center|border|1000px|Student view shows teammate reviews of student if allowed]]&lt;br /&gt;
&lt;br /&gt;
==== 2) Show descriptive name for heatmaps ====&lt;br /&gt;
This test runs consecutive to test 1 above. If not run consecutive, re-conduct steps 1-4 above. The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:yes_description_on_heatmap.png|center|border|1000px|Teammate Review Heatmap has descriptive title]]&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146784</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146784"/>
		<updated>2022-11-20T18:34:17Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Added System Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;br /&gt;
==== 1) View teammate reviews as a student when enabled ====&lt;br /&gt;
This test was conducted as follows:&lt;br /&gt;
# Sign in as test student7185 above&lt;br /&gt;
# Navigate to assignments&lt;br /&gt;
# Click on the Final Project assignment&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
&lt;br /&gt;
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Yes_student_heatmap.png&amp;diff=146783</id>
		<title>File:Yes student heatmap.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Yes_student_heatmap.png&amp;diff=146783"/>
		<updated>2022-11-20T18:31:31Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Yes_description_on_heatmap.png&amp;diff=146782</id>
		<title>File:Yes description on heatmap.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Yes_description_on_heatmap.png&amp;diff=146782"/>
		<updated>2022-11-20T18:31:18Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146781</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146781"/>
		<updated>2022-11-20T18:25:56Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Flow to access affected views */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146780</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146780"/>
		<updated>2022-11-20T18:18:47Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Test Login Credentials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will always see a heatgrid showing the reviews that you have written and if the instructor has enabled it on this assignment you will also see the reviews that others have made about you&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
* username: instructor6&lt;br /&gt;
* password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
* username: student7185&lt;br /&gt;
* password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146779</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146779"/>
		<updated>2022-11-20T18:18:19Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Test Login Credentials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will always see a heatgrid showing the reviews that you have written and if the instructor has enabled it on this assignment you will also see the reviews that others have made about you&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
==== Instructor ====&lt;br /&gt;
username: instructor6&lt;br /&gt;
password: password&lt;br /&gt;
==== Student ====&lt;br /&gt;
username: student7185&lt;br /&gt;
password: password&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146778</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146778"/>
		<updated>2022-11-20T18:17:07Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: /* Flow to access affected views */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. The image below shows where we would like to display the composite score.&lt;br /&gt;
&lt;br /&gt;
[[File:Composite score.png|center|border|1000px|Instructor view of a student's reviews does not show a composite score]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews received from a students teammates as well as external reviews. The image below shows that the students can not see their teammates reviews even when the instructor checkbox for viewing teammate reviews is selected. &lt;br /&gt;
&lt;br /&gt;
[[File:TeammateReviewsMissing.png|center|border|1000px|The &amp;quot;Your Scores&amp;quot; page for students does not show teammate reviews]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from each team participant.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
[[File:Anonnymized.jpg|center|border|1000px|]]&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
==== _view_heatgrid.html.erb ====&lt;br /&gt;
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click desired assignment to view reviews from&lt;br /&gt;
# Click on &amp;quot;Your scores&amp;quot; button&lt;br /&gt;
# Scroll down past assignment score heatgrid&lt;br /&gt;
# You will always see a heatgrid showing the reviews that you have written and if the instructor has enabled it on this assignment you will also see the reviews that others have made about you&lt;br /&gt;
&lt;br /&gt;
If you are logged in as an instructor:&lt;br /&gt;
&lt;br /&gt;
# Click &amp;quot;Manage...&amp;quot; then &amp;quot;Assignments&amp;quot; at the top of the screen&lt;br /&gt;
# Click on the &amp;quot;view scores&amp;quot; button on the desired assignment&lt;br /&gt;
# Click the plus next to the team that you are interested in&lt;br /&gt;
# Click on the &amp;quot;Teammate Reviews&amp;quot; tab at the top of the panel&lt;br /&gt;
# Select the student that you wish to see the reviews about&lt;br /&gt;
# The relevant heatgrid will display with a descriptive title&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146403</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146403"/>
		<updated>2022-11-14T17:33:24Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Edited the size of images for readability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews given to other teammates as well as reviews received. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from all a team's participants.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1000px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1000px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146402</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146402"/>
		<updated>2022-11-14T17:32:29Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added images to describe my problem section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
In Expertiza, both students and instructors are able to view a student's teammate reviews. On the reviews page, only a single heatmap is shown which does not provide a full representation of the student's performance. In addition, it is unclear if the heatmap is displaying information about the reviews the student has written or received. The heatmaps on the instructor and student views are not labeled and do not provide clarity on the information they are displaying.&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
It would be useful for the instructor to see a composite score derived from all of the reviews similar to the average score shown on the students review page. Currently, the code only displays the average score for each row of the review table on the instructors view. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The previous semester's team calculated the composite value within the view page which does not follow the design principles of this course. We plan to move this mathematical operation to the appropriate model where it where will be accessible to any view that requires a composite score for its heatmap.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in the two files listed below:&lt;br /&gt;
&lt;br /&gt;
===== rscore.rb =====&lt;br /&gt;
This file contains the logic for doing mathematical functions for review tables. In the init function, the average score for each table is calculated. A new method can push the average score for each review into an array that can later be used to calculate the average across all reviews. Another method can reference this array to calculate the composite score across each review.&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
This file will call the composite score method described above to populate a string tag that displays the average score for all reviews on a view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
The heatmap displayed on the Student view does not give the full representation of the group performance. The view should show both the reviews given to other teammates as well as reviews received. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We will need to improve how the review table(s) intended for display are generated.&lt;br /&gt;
&lt;br /&gt;
The problem will have to be solved through changes in file listed below:&lt;br /&gt;
&lt;br /&gt;
===== grades_controller.rb =====&lt;br /&gt;
This file contains the logic for orchestrating the build of the heatmap tables. The logic is this controller will need to be updated to populate the table array with reviews from all a team's participants.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
This file controls what tables are displayed when an instructor views a team. This view will needed to be updated to include the display the missing tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_student_heatmap.png|center|border|1400px|The my scores view page for the student doesn't show any teammate review heatmaps]]&lt;br /&gt;
&lt;br /&gt;
This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in as seen below.&lt;br /&gt;
&lt;br /&gt;
[[File:no_description_on_heatmap.png|center|border|1400px|The heatmap printout doesn't specify if showing reviews by or for a certain student]]&lt;br /&gt;
&lt;br /&gt;
A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
Student names are visible in the teammate reviews tab, even when the user is in the anonymized view. &lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files. &lt;br /&gt;
&lt;br /&gt;
=====user.rb===== &lt;br /&gt;
In user file the anonymized user function is defined and when called it checks and returns True if a particular user is in anonymized view or else returns False. We will be improving the conditional logic to display the user name only when not present in anonymized view.&lt;br /&gt;
&lt;br /&gt;
=====_view_heatgrid.html.erb===== &lt;br /&gt;
The file contains the logic to display the heatgrid to the user. When we make the changes to user file we will need to make some changes in this file to not display the user name in anonymized view.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:No_description_on_heatmap.png&amp;diff=146401</id>
		<title>File:No description on heatmap.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:No_description_on_heatmap.png&amp;diff=146401"/>
		<updated>2022-11-14T17:28:12Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:No_student_heatmap.png&amp;diff=146400</id>
		<title>File:No student heatmap.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:No_student_heatmap.png&amp;diff=146400"/>
		<updated>2022-11-14T17:28:01Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146324</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146324"/>
		<updated>2022-11-11T14:37:05Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added description of changes to fix the improved display of heatmap problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
=== Improved Handling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all. This will have to be included with the condition that the instructor has selected that the student can view the reviews in the assignment options. Additionally, in the display of the heatmap itself there is no indication if the reviews displayed are reviews about the student signed in or made by the student signed in. A more descriptive label will have to be added to show this. Lastly, a composite score will have to be displayed under each heatmap to average the scores that the student received.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The problem will have to be solved through changes in two erb files listed below:&lt;br /&gt;
&lt;br /&gt;
===== _view_heatgrid.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the actual heatgrid to the user. It will have to be modified in two ways. Firstly, we will have to add a conditional header that will either display that the heatgrid shows reviews for the student or by the student depending on the type of questionnaire that it is displaying. Secondly, we will have to add a place under the heatgrid to display the composite score of that heatgrid. In the previous attempt at this project, the group added the calculation logic for the composite score to this file which is incorrect because it is an erb file. Instead, this file will contain a call to a funtion in the model that will calculate the value and return it for display.&lt;br /&gt;
&lt;br /&gt;
===== view_team.html.erb =====&lt;br /&gt;
&lt;br /&gt;
This file contains the logic to display the page where the student views the questionnaires. We will have to add logic to display the reviews of that student if the assignment is set to have show teammate reviews be true.&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146316</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146316"/>
		<updated>2022-11-11T00:06:21Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Establish Section Headings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Calculate Composite Review Score ===&lt;br /&gt;
&lt;br /&gt;
=== Improved Haling of Relevant Reviews ===&lt;br /&gt;
&lt;br /&gt;
=== Improved Display of Review Heatmap ===&lt;br /&gt;
&lt;br /&gt;
=== Preservation of Anonymized View Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Flow to access affected views ===&lt;br /&gt;
&lt;br /&gt;
=== Test Login Credentials ===&lt;br /&gt;
&lt;br /&gt;
=== Added Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
=== Added System Tests ===&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146315</id>
		<title>CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2282._Fix_teammate-review_view&amp;diff=146315"/>
		<updated>2022-11-10T23:56:15Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: beginning edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Todo: Write page&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146207</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146207"/>
		<updated>2022-11-01T18:32:52Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added pictures for the completed manual/system tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updated at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Bugfix: Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze. This was beyond the scope of our work but we wanted to improve the page functionality. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method. We wanted to enhance the test suite of this controller by increasing the coverage of its Rspec tests.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/a90b1aada9878c7cdf7319dd022432cca8eadd2f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method to check nil or blank input for email&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method pertaining to checking invalid inputs in the request params&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/1d2d2d94ef730ab427bb326049bc5ec800a0dfc9 Commit]&amp;lt;br&amp;gt;[https://github.com/greyfiles/expertiza/commit/781d6f42ca37829e0e514de8bcef1c85b2a035a2 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; factories and removed hardcoded variables&lt;br /&gt;
|Cleaned up hardcoded &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; models with premade factories to improve readability of the code&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/commit/96376e0b633e6b6e08d472a4cb4600d20e0c024f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/factories/password_retrieval_factory.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Created a file to host the &amp;lt;code&amp;gt;password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; fixtures&lt;br /&gt;
|We implemented factories in the rspec test file to improve modularity and code readability.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|*Not in required chagnes* Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Improved existing tests for &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; to explicitly test for a redirect&lt;br /&gt;
|When looking over the existing test cases, I noticed that the test that was verifying that the &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; method would redirect the user only &amp;quot;allowed&amp;quot; the redirect and did not &amp;quot;expect&amp;quot; it. I changed it to &amp;quot;expect&amp;quot; the redirect to ensure that functionality is working.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; when the role is found to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the current role was set.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the user's info was cleared.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
'''Everything in the testing segment was beyond the scope of our work. However, we wanted to validate our code through RSpec testing before merging into the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; Expertiza branch. In the second submission phase, we plan to further enhance the testing suite of the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; through factories and fixtures.''' &lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to auth_controller.rb was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_password_retrieval_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 63.3% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_before.png|center|frame|rspec test coverage report before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After adding tests, the tests covered 91.1% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_after.png|center|frame|rspec test coverage report after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
We implemented factories in the rspec test file to improve modularity and code readability. Factories provide more flexibility in generating models to meet the requirements of the test, as opposed to fixtures. As you can see from the below images, the code is significantly cleaner as many lines of hardcoded strings have been removed. &lt;br /&gt;
[[File:prefactory.png|center|frame|rspec tests before factories were implemented]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:postfactory.png|center|frame|rspec tests after factories were implemented]]&lt;br /&gt;
&lt;br /&gt;
The below image shows the output of the following command after all tests were added: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:After refactor password retrieval controller.png|center|frame|rspec tests all passing after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. Next we looked at the existing tests to see if they could be improved. As listed in the files changed above, there were a few improvements to be made to &amp;lt;code&amp;gt;auth_controller_spec.rb&amp;lt;/code&amp;gt;. We improved a check for redirecting the user after logging in and added two tests to make sure the role cache was being rebuilt after both setting the current role and clearing the user info. We ran the tests again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_improving_auth_controller_spec.png|center|frame|rspec tests continuing to all pass after improving and adding to the auth_controller tests]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 91.94% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:coverage_before.png|center|frame|rspec test coverage report before the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
This is already a good coverage but after my changes I wanted to ensure my changes were also tested thoroughly. After adding tests, the tests covered 95.24% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. It improved slightly to be an even better coverage.&lt;br /&gt;
[[File:coverage_after.png|center|frame|rspec test coverage report after the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
=== Test Plan - Additional Manual/System Test Cases ===&lt;br /&gt;
Along with the unit tests that we have written to test our files, we conducted a few system tests manually to verify the functionality works as expected. The &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; is difficult for us to test because we don't have access to the email used to make the sample account, but the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; is very testable. Below is the tests we completed listed in the order of completion.&lt;br /&gt;
&lt;br /&gt;
==== 1) Test instructor login &amp;amp; redirect to home page ====&lt;br /&gt;
When navigating to the expertiza website, our branch correctly displayed the login page as shown below.&lt;br /&gt;
[[File:before_login.png|center|border|Form shown to the user before logging in to expertiza]]&lt;br /&gt;
After typing in the sample login credentials of &amp;quot;instructor6&amp;quot; and &amp;quot;password,&amp;quot; the user is then correctly logged in and redirected to the home page for instructors shown below.&lt;br /&gt;
[[File:after_login.png|center|border|1400px|Page shown to the user after logging in to expertiza]]&lt;br /&gt;
==== 2) Test instructor logout &amp;amp; redirect to login page ====&lt;br /&gt;
Then, when the user clicks the logout button, they are correctly logged out and redirected once again to the login page as shown below.&lt;br /&gt;
[[File:after_logout.png|center|border|Form shown to the user after logging out of expertiza]]&lt;br /&gt;
==== 3) Test incorrect login ====&lt;br /&gt;
When the user attempts to login but enters the incorrect login information of &amp;quot;instructor6&amp;quot; and &amp;quot;incorrect,&amp;quot; the user is shown the error message and then correctly redirected to the forgot password page shown below.&lt;br /&gt;
[[File:after_incorrect_login.png|center|border|1400px|Form shown to the user after an incorrect login attempt to expertiza]]&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
* '''VCL Server:''' http://152.7.98.115:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin O'Dowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_login.png&amp;diff=146206</id>
		<title>File:Before login.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_login.png&amp;diff=146206"/>
		<updated>2022-11-01T18:25:33Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Screen shown before the user logs in&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screen shown before the user logs in&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_logout.png&amp;diff=146205</id>
		<title>File:After logout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_logout.png&amp;diff=146205"/>
		<updated>2022-11-01T18:25:19Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Screen shown after the user logs out&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screen shown after the user logs out&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_login.png&amp;diff=146204</id>
		<title>File:After login.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_login.png&amp;diff=146204"/>
		<updated>2022-11-01T18:25:00Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Screen shown after a correct login&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screen shown after a correct login&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_incorrect_login.png&amp;diff=146203</id>
		<title>File:After incorrect login.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_incorrect_login.png&amp;diff=146203"/>
		<updated>2022-11-01T18:24:42Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Screen shown after an incorrect login&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screen shown after an incorrect login&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146202</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146202"/>
		<updated>2022-11-01T18:24:16Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added explanation of manual system tests completed on the branch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updated at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Bugfix: Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze. This was beyond the scope of our work but we wanted to improve the page functionality. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method. We wanted to enhance the test suite of this controller by increasing the coverage of its Rspec tests.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/a90b1aada9878c7cdf7319dd022432cca8eadd2f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method to check nil or blank input for email&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method pertaining to checking invalid inputs in the request params&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/1d2d2d94ef730ab427bb326049bc5ec800a0dfc9 Commit]&amp;lt;br&amp;gt;[https://github.com/greyfiles/expertiza/commit/781d6f42ca37829e0e514de8bcef1c85b2a035a2 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; factories and removed hardcoded variables&lt;br /&gt;
|Cleaned up hardcoded &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; models with premade factories to improve readability of the code&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/commit/96376e0b633e6b6e08d472a4cb4600d20e0c024f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/factories/password_retrieval_factory.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Created a file to host the &amp;lt;code&amp;gt;password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; fixtures&lt;br /&gt;
|We implemented factories in the rspec test file to improve modularity and code readability.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|*Not in required chagnes* Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Improved existing tests for &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; to explicitly test for a redirect&lt;br /&gt;
|When looking over the existing test cases, I noticed that the test that was verifying that the &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; method would redirect the user only &amp;quot;allowed&amp;quot; the redirect and did not &amp;quot;expect&amp;quot; it. I changed it to &amp;quot;expect&amp;quot; the redirect to ensure that functionality is working.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; when the role is found to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the current role was set.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the user's info was cleared.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
'''Everything in the testing segment was beyond the scope of our work. However, we wanted to validate our code through RSpec testing before merging into the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; Expertiza branch. In the second submission phase, we plan to further enhance the testing suite of the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; through factories and fixtures.''' &lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to auth_controller.rb was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_password_retrieval_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 63.3% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_before.png|center|frame|rspec test coverage report before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After adding tests, the tests covered 91.1% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_after.png|center|frame|rspec test coverage report after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
We implemented factories in the rspec test file to improve modularity and code readability. Factories provide more flexibility in generating models to meet the requirements of the test, as opposed to fixtures. As you can see from the below images, the code is significantly cleaner as many lines of hardcoded strings have been removed. &lt;br /&gt;
[[File:prefactory.png|center|frame|rspec tests before factories were implemented]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:postfactory.png|center|frame|rspec tests after factories were implemented]]&lt;br /&gt;
&lt;br /&gt;
The below image shows the output of the following command after all tests were added: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:After refactor password retrieval controller.png|center|frame|rspec tests all passing after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. Next we looked at the existing tests to see if they could be improved. As listed in the files changed above, there were a few improvements to be made to &amp;lt;code&amp;gt;auth_controller_spec.rb&amp;lt;/code&amp;gt;. We improved a check for redirecting the user after logging in and added two tests to make sure the role cache was being rebuilt after both setting the current role and clearing the user info. We ran the tests again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_improving_auth_controller_spec.png|center|frame|rspec tests continuing to all pass after improving and adding to the auth_controller tests]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 91.94% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:coverage_before.png|center|frame|rspec test coverage report before the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
This is already a good coverage but after my changes I wanted to ensure my changes were also tested thoroughly. After adding tests, the tests covered 95.24% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. It improved slightly to be an even better coverage.&lt;br /&gt;
[[File:coverage_after.png|center|frame|rspec test coverage report after the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
=== Test Plan - Additional Manual/System Test Cases ===&lt;br /&gt;
Along with the unit tests that we have written to test our files, we conducted a few system tests manually to verify the functionality works as expected. The &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; is difficult for us to test because we don't have access to the email used to make the sample account, but the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; is very testable. Below is the tests we completed listed in the order of completion.&lt;br /&gt;
&lt;br /&gt;
==== 1) Test instructor login &amp;amp; redirect to home page ====&lt;br /&gt;
When navigating to the expertiza website, our branch correctly displayed the login page as shown below.&lt;br /&gt;
//before_login.png&lt;br /&gt;
After typing in the sample login credentials of &amp;quot;instructor6&amp;quot; and &amp;quot;password,&amp;quot; the user is then correctly logged in and redirected to the home page for instructors shown below.&lt;br /&gt;
//after_login.png&lt;br /&gt;
==== 2) Test instructor logout &amp;amp; redirect to login page ====&lt;br /&gt;
Then, when the user clicks the logout button, they are correctly logged out and redirected once again to the login page as shown below.&lt;br /&gt;
//after_logout.png&lt;br /&gt;
==== 3) Test incorrect login ====&lt;br /&gt;
When the user attempts to login but enters the incorrect login information of &amp;quot;instructor6&amp;quot; and &amp;quot;incorrect,&amp;quot; the user is shown the error message and then correctly redirected to the forgot password page shown below.&lt;br /&gt;
//after_incorrect_login.png&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
* '''VCL Server:''' http://152.7.98.115:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin O'Dowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146006</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=146006"/>
		<updated>2022-10-26T20:37:43Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added code coverage numbers for auth_controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updates at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method. We wanted to enhance the test suite of this controller by increasing the coverage of its Rspec tests.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/a90b1aada9878c7cdf7319dd022432cca8eadd2f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method to check nil or blank input for email&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method pertaining to checking invalid inputs in the request params&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/1d2d2d94ef730ab427bb326049bc5ec800a0dfc9 Commit]&amp;lt;br&amp;gt;[https://github.com/greyfiles/expertiza/commit/781d6f42ca37829e0e514de8bcef1c85b2a035a2 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|*Not in required chagnes* Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Improved existing tests for &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; to explicitly test for a redirect&lt;br /&gt;
|When looking over the existing test cases, I noticed that the test that was verifying that the &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; method would redirect the user only &amp;quot;allowed&amp;quot; the redirect and did not &amp;quot;expect&amp;quot; it. I changed it to &amp;quot;expect&amp;quot; the redirect to ensure that functionality is working.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; when the role is found to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the current role was set.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the user's info was cleared.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to auth_controller.rb was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_password_retrieval_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 63.3% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_before.png|center|frame|rspec test coverage report before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After adding tests, the tests covered 91.1% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_after.png|center|frame|rspec test coverage report after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
The below image shows the output of the following command after all tests were added: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:After refactor password retrieval controller.png|center|frame|rspec tests all passing after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. Next we looked at the existing tests to see if they could be improved. As listed in the files changed above, there were a few improvements to be made to &amp;lt;code&amp;gt;auth_controller_spec.rb&amp;lt;/code&amp;gt;. We improved a check for redirecting the user after logging in and added two tests to make sure the role cache was being rebuilt after both setting the current role and clearing the user info. We ran the tests again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_improving_auth_controller_spec.png|center|frame|rspec tests continuing to all pass after improving and adding to the auth_controller tests]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 91.94% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:coverage_before.png|center|frame|rspec test coverage report before the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
This is already a good coverage but after my changes I wanted to ensure my changes were also tested thoroughly. After adding tests, the tests covered 95.24% of &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. It improved slightly to be an even better coverage.&lt;br /&gt;
[[File:coverage_after.png|center|frame|rspec test coverage report after the improvements to the auth_controller unit tests]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
* '''VCL Server:''' http://152.7.98.115:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin Odowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_after.png&amp;diff=146005</id>
		<title>File:Coverage after.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_after.png&amp;diff=146005"/>
		<updated>2022-10-26T20:34:05Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Code coverage of auth_controller.rb after adding tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Code coverage of auth_controller.rb after adding tests&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_before.png&amp;diff=146004</id>
		<title>File:Coverage before.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_before.png&amp;diff=146004"/>
		<updated>2022-10-26T20:33:41Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Code coverage of auth_controller.rb before adding tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Code coverage of auth_controller.rb before adding tests&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145997</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145997"/>
		<updated>2022-10-26T19:35:05Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added the image showing the improved auth_controller_spec.rb running and passing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updates at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method. We wanted to enhance the test suite of this controller by increasing the coverage of its Rspec tests.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/a90b1aada9878c7cdf7319dd022432cca8eadd2f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method to check nil or blank input for email&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method pertaining to checking invalid inputs in the request params&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/1d2d2d94ef730ab427bb326049bc5ec800a0dfc9 Commit]&amp;lt;br&amp;gt;[https://github.com/greyfiles/expertiza/commit/781d6f42ca37829e0e514de8bcef1c85b2a035a2 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|*Not in required chagnes* Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Improved existing tests for &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; to explicitly test for a redirect&lt;br /&gt;
|When looking over the existing test cases, I noticed that the test that was verifying that the &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; method would redirect the user only &amp;quot;allowed&amp;quot; the redirect and did not &amp;quot;expect&amp;quot; it. I changed it to &amp;quot;expect&amp;quot; the redirect to ensure that functionality is working.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; when the role is found to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the current role was set.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the user's info was cleared.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to auth_controller.rb was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_password_retrieval_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 63.3% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_before.png|center|frame|rspec test coverage report before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After adding tests, the tests covered 91.1% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_after.png|center|frame|rspec test coverage report after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
The below image shows the output of the following command after all tests were added: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:After refactor password retrieval controller.png|center|frame|rspec tests all passing after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. Next we looked at the existing tests to see if they could be improved. As listed in the files changed above, there were a few improvements to be made to &amp;lt;code&amp;gt;auth_controller_spec.rb&amp;lt;/code&amp;gt;. We improved a check for redirecting the user after logging in and added two tests to make sure the role cache was being rebuilt after both setting the current role and clearing the user info. We ran the tests again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_improving_auth_controller_spec.png|center|frame|rspec tests continuing to all pass after improving and adding to the auth_controller tests]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
* '''VCL Server:''' http://152.7.98.115:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin Odowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_improving_auth_controller_spec.png&amp;diff=145995</id>
		<title>File:After improving auth controller spec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_improving_auth_controller_spec.png&amp;diff=145995"/>
		<updated>2022-10-26T19:33:08Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Tests running for auth_controller.rb after improving and adding more tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tests running for auth_controller.rb after improving and adding more tests&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145994</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145994"/>
		<updated>2022-10-26T19:31:50Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added description of auth_controller part of project and auth_controller_spec changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updates at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; method. We wanted to enhance the test suite of this controller by increasing the coverage of its Rspec tests.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/a90b1aada9878c7cdf7319dd022432cca8eadd2f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added two new RSpec tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method to check nil or blank input for email&lt;br /&gt;
|There were no tests for the &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method pertaining to checking invalid inputs in the request params&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/1d2d2d94ef730ab427bb326049bc5ec800a0dfc9 Commit]&amp;lt;br&amp;gt;[https://github.com/greyfiles/expertiza/commit/781d6f42ca37829e0e514de8bcef1c85b2a035a2 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|*Not in required chagnes* Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Improved existing tests for &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; to explicitly tests for a redirect&lt;br /&gt;
|When looking over the existing test cases, I noticed that the test that was verifying that the &amp;lt;code&amp;gt;after_login&amp;lt;/code&amp;gt; method would redirect the user only &amp;quot;allowed&amp;quot; the redirect and did not &amp;quot;expect&amp;quot; it. I changed it to &amp;quot;expect&amp;quot; the redirect to ensure that functionality is working.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; when the role is found to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;set_current_role&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the current role was set.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added a test for &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; to make sure it rebuilds the role cache&lt;br /&gt;
|In the unit tests for the &amp;lt;code&amp;gt;clear_user_info&amp;lt;/code&amp;gt; method, my new addition of a private helper method allowed us to ensure that the role cache was being rebuilt when the user's info was cleared.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/23b3eaa888810f93a4af18c2ca6904ab21580a4b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to auth_controller.rb was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_password_retrieval_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
Tests prior to the changes covered 63.3% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_before.png|center|frame|rspec test coverage report before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After adding tests, the tests covered 91.1% of &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:E2252_password_retrieval_coverage_report_after.png|center|frame|rspec test coverage report after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
The below image shows the output of the following command after all tests were added: &amp;lt;code&amp;gt;rspec spec/controllers/password_retrieval_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:After refactor password retrieval controller.png|center|frame|rspec tests all passing after the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;. Next we looked at the existing tests to see if they could be improved. As listed in the files changed above, there were a few improvements to be made to &amp;lt;code&amp;gt;auth_controller_spec.rb&amp;lt;/code&amp;gt;. We improved a check for redirecting the user after logging in and added two tests to make sure the role cache was being rebuilt after both setting the current role and clearing the user info. We ran the tests again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
* '''VCL Server:''' http://152.7.98.115:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin Odowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145840</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145840"/>
		<updated>2022-10-26T02:15:09Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added information of the participants in the group&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
TODO: Describe the objectives of the project and what issues we were attempting to address.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code for re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, this action involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method called &amp;lt;code&amp;gt;self.rebuild_role_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
TODO: Add testing description for password_retrieval_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Grey Files (unityid: mgfiles, github: greyfiles)&lt;br /&gt;
* Colin Odowd (unityid: cdodowd, github: colin-odowd)&lt;br /&gt;
* Pradyumna Khawas (unityid: ppkhawas, github: therealppk)&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145754</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145754"/>
		<updated>2022-10-25T22:35:27Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added testing description for the auth_controller.rb existing tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
TODO: Describe the objectives of the project and what issues we were attempting to address.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code for both handling a failed login and re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, these two actions involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
TODO: Add testing description for password_retrieval_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Before any refactoring to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; was done, we ran the rspec tests created for the controller with the following command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:before_refactor_auth_controller.png|center|frame|rspec tests all passing before the refactoring was completed]]&lt;br /&gt;
&lt;br /&gt;
After making all of the above changes to &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;, we ran the rspec tests for the controller again with the command: &amp;lt;code&amp;gt;rspec spec/controllers/auth_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:after_refactor_auth_controller.png|center|frame|rspec tests continuing to all pass after completing the refactoring]]&lt;br /&gt;
&lt;br /&gt;
We have successfully preserved the passing tests after the improvements we made to the &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_refactor_auth_controller.png&amp;diff=145753</id>
		<title>File:After refactor auth controller.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_refactor_auth_controller.png&amp;diff=145753"/>
		<updated>2022-10-25T22:22:21Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: rspec tests for auth_controller after refactoring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;rspec tests for auth_controller after refactoring&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_refactor_auth_controller.png&amp;diff=145752</id>
		<title>File:Before refactor auth controller.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_refactor_auth_controller.png&amp;diff=145752"/>
		<updated>2022-10-25T22:21:36Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: rspec tests for auth_controller.rb before refactoring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;rspec tests for auth_controller.rb before refactoring&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145751</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145751"/>
		<updated>2022-10-25T22:20:17Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added description of expertiza and changes to auth_controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open source software written using Ruby on Rails which functions as a learning management software system. It has man different functions and abilities including the ability to create assignments, quizzes, assignment groups and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system for user authentication with different user roles and permissions that determine how each user interacts with the content. The &amp;lt;code&amp;gt;auth_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; which are the files primarily addressed in this project are both critical controllers in providing this functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
TODO: Describe the objectives of the project and what issues we were attempting to address.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated &amp;lt;code&amp;gt;check_reset_url&amp;lt;/code&amp;gt; method name to &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code in lines 35-36 and 62-63&lt;br /&gt;
|The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Change token expiration time to constant in line 41&lt;br /&gt;
|This time should not be hardwired; it should be a constant or a parameter. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Reload page if email is nil or empty on &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view&lt;br /&gt;
|An empty email parameter was causing the send password button to freeze.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Improve overall comments and rewrite error messages&lt;br /&gt;
|The comments and error messages in the controller need to be more meaningful, specific and clear.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;config/routes.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Updated URL path and controller action to updated method name &amp;lt;code&amp;gt;check_token_validity&amp;lt;/code&amp;gt;&lt;br /&gt;
|The action and URL path must be renamed to generate pathing to the controller method and views.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/auth_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Move logger messages to &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; blocks wherever possible&lt;br /&gt;
|Logger messages are inserted to log important events occurring in the code and do not relate directly to the logic. When possible, moving them to either &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;after_action&amp;lt;/code&amp;gt; blocks makes the code more readable and easier to understand. It also separates the functionality of the method itself and the logging functionality.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/7069f5d3cbfa2b7259e85e39dbfbf6fb41a0ce1d Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Replaced repeated code for both handling a failed login and re-caching the user role&lt;br /&gt;
|We noticed that although not listed on the recommended changes, these two actions involved exactly repeated code in the controller. The use of repeated code violates the DRY principle and so it was moved to a new method.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/9ef20cffa0fe7b8440b97856a6db4b5351eece35 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Improved helper function names&lt;br /&gt;
|Originally we made the new helper functions used in logging have unhelpful, confusing names. Making them more clear helps the code to be more understandable.&lt;br /&gt;
|[https://github.com/greyfiles/expertiza/commit/32f8435255add7b44b38fd747f81f435d331d14d Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;password_retrieval_controller.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
TODO: Add testing description for password_retrieval_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Testing &amp;lt;code&amp;gt;auth_controller_.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/greyfiles/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2460&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145712</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145712"/>
		<updated>2022-10-24T22:29:44Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Added descriptions of each section to guide group members when contributing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview of Expertiza ==&lt;br /&gt;
TODO: Add description of general expertiza system and how our controllers relate to the overall functionality.&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
TODO: Describe the objectives of the project and what issues we were attempting to address.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
TODO: List all files that were modified and the changes made to them. Include what principle was violated/what the problem was and how the change fixed it.&lt;br /&gt;
== Testing ==&lt;br /&gt;
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145711</id>
		<title>CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp; password retrieval controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2252._Refactor_auth_controller.rb_%26_password_retrieval_controller.rb&amp;diff=145711"/>
		<updated>2022-10-24T22:23:44Z</updated>

		<summary type="html">&lt;p&gt;Mgfiles: Establish basic outline of page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of Expertiza&lt;br /&gt;
Description of Project&lt;br /&gt;
Files Modified&lt;br /&gt;
Testing&lt;/div&gt;</summary>
		<author><name>Mgfiles</name></author>
	</entry>
</feed>