CSC/ECE 517 Fall 2022 - E2282. Fix teammate-review view
Problem Description
Both students and instructors can view teammate reviews. Students view them from the heatgrid at the bottom of the “Your scores” page. Instructors view them from “View scores”, then clicking on a particular team, then clicking on the Teammate Reviews tab. In both cases a single heatgrid is shown. It is not clear whether this is the heatgrid for the reviews that the student has written of his/her teammates or if it is the heatgrid for the reviews that the student has received from his/her teammates. Nothing in the view identifies which. For instructors, the problem is compounded. Instructors can choose from a list of the students on the team, but they have no way to tell whether the heatgrid shows the reviews done by or done for the team member. Further, the heatmaps do not provide a clear indication of a student/teams performance. By adding a composite score to the top of each heatmap, the student or instructor will instantly understand how well they performed. Finally, to add a layer of privacy for both students and instructors, an anonymized mode has been enabled to mask identity.
In summary, our team has been tasked to make the following code changes:
- Show reviews by the student and reviews of the student’s contribution. The code must be cognizant of the fact that an instructor can uncheck “Show teammate reviews?” on the General tab of assignment creation. If it is unchecked, teammate reviews of a student’s contribution should not be shown to the student. These reviews should still be shown to the instructor.
- Show a composite score derived from all reviews. This will be functional for all styles of heatmap.
- Display an anonymized view, where no names are to be shown, but only “Student nnn”, “Instructor mmm”, etc for live demos where student or instructor privacy needs to be protected
Proposed Changes
Calculate Composite Review Score
Problem
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.
Solution
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.
The problem will have to be solved through changes in the two files listed below:
vm_question_response.rb
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 composite_score
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.
_view_heatgrid.html.erb
This file will call the _view_compompsite_score.html.erb
partial view which calls the composite_score
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!
view_team.html.erb
This file uses the _view_compompsite_score.html.erb
partial to display the composite score for student views. It uses the same logic as the above description.
_view_compompsite_score.html.erb
This file was created to add the composite_score
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.
The following changes can be seen in the output of the image below.
The composite score calculation can also be seen on the student view here. A bug was received on the previous semesters work that resulted in the composite score calculation breaking the average peer review score by setting it to zero. This issue has been resolved as you can see both scores are being displayed in a correct manner.
Improved Display of Review Heatmap
Problem
This problem contains many parts. Firstly, the student scores view does not even show a heatmap of reviews at all as seen below.
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.
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.
Solution
The problem will have to be solved through changes in two erb files listed below:
_view_heatgrid.html.erb
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.
view_team.html.erb
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.
Preservation of Anonymized View Naming Convention
Problem
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.)
Solution
We plan to remove the team member name from being displayed when using anonymized view by adding some changes to the following files.
user.rb
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.
_view_heatgrid.html.erb
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.
Use Case Flow diagram for Anonymized View
Bugs
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.
These bugs can be found by logging in as an instructor, going to the Manage->Assignments tab, clicking View Scores of Final project (and design doc) and then selecting any team.
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.
The top image shows the student 9022 review which you can see is populated in student 9020 column from the bottom image.
Testing
Flow to access affected views
_view_heatgrid.html.erb
This file can be accessed through the GUI differently when logged in as an instructor or a student. When logged in as a student:
- Click "Assignments" at the top of the screen
- Click desired assignment to view reviews from
- Click on "Your scores" button
- Scroll down past assignment score heatgrid
- You will see the reviews that others have made about you if the instructor has enabled that setting on this assignment
If you are logged in as an instructor:
- Click "Manage..." then "Assignments" at the top of the screen
- Click on the "view scores" button on the desired assignment
- Click the plus next to the team that you are interested in
- Click on the "Teammate Reviews" tab at the top of the panel
- Select the student that you wish to see the reviews about
- The relevant heatgrid will display with a descriptive title
Test Login Credentials
Instructor
- username: instructor6
- password: password
Student
- username: student7185
- password: password
Added Unit Tests
view_team_spec.rb
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:
expect(page).to_not have_text 'Teammate Review'
Added System Tests
For calculating the composite score, we built Rspec tests to ensure the correct calculation was being performed. We implemented factories in the vm_question_response_spec.rb
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.
Many variations of score arrays were passed into the composite_score
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.
Added Manual Tests
The following tests were conducted as follows:
- Sign in as test student7185 above
- Navigate to assignments
- Click on the Final Project assignment
- Click on "Your scores" button
1) View teammate reviews as a student when enabled
The teammate reviews will be shown at the bottom of the screen because it has been enabled by the instructor:
2) Show descriptive name for heatmaps from an instructor view
The displayed heatgrid has a new, descriptive title describing exactly what reviews are being displayed:
Added System Tests
We have added test case to ensure that when the user is in anonymized view the user name or ID is not displayed.
Manual Testing for Anonymized User View:
The following tests were conducted as follows:
- Sign in as test student7185 above
- Navigate to assignments
- Click on the Final Project assignment
- Click on "Your scores" button
1) View your teammates names in the Team members section of review scores
In Normal user view the Users name or ID is displayed.
2) Switch to Anonymized View and view your teammates names in the Team members section of review scores
In Anonymized view the Users name or ID is not displayed.
Relevant Links
- Github Repository: https://github.com/colin-odowd/expertiza
- Pull Request: https://github.com/expertiza/expertiza/pull/2476
- VCL Server: http://152.7.178.100:8080/
- Video: https://youtu.be/Hcqr4uLzU38