CSC/ECE 517 Fall 2022 - E2278. Improve assessment360 controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Initial template commit)
 
mNo edit summary
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Background==
This is the design document for Expertiza project E2278 Improve assessment360_controller.rb. This document describes the existing implementation of the assessment360 controller and the updates made to it as part of this project which is primarily UI-focused.
Most of the projects and assignments in CSC517 and on Expertiza are peer-reviewed, and these peer-reviews are graded by the teaching staff. When the staff grade reviews, they are viewed in the review-grader interface. The staff can assign the score and provide feedback using the textboxes provided in the right columns of the table. The staff are also allowed to read the reviews in the summary view.


There appears to be certain sections of the main review-grader page as well as the summary page that are not working correctly or there is a desire for them to be updated. These issues have to do with calculation of a student's score / average score, the visual representation of the scores, efficient usage of space within the view, and a need for rows of the table(s) to be numbered. We go into further depth about the issues later in this document.
== Introduction ==


==The Project==
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on the [http://rubyonrails.org/ Ruby on Rails] framework.
Certain aspects of the UI and minor score calculation logic of the review grader system in Expertiza need to be enhanced/refactored. These issues are not major and mainly have to do with UI, and therefore should not require the development of new unit tests. Below is a detailed description of actionable issues that will be addressed in this work.
Expertiza provides functionality that allows instructors to get a full or 360-degree overview of a course they teach that includes all students in the course, all assignments, and the scores of every student in each assignment, averages, and final scores as well. This feature is supported by the assessment360 controller.  


===The Main Review-Grader Page===
The assessment360 controller is mainly responsible for the following two views:
[[File:Expertiza_review_report.PNG|1200px|]]
====Issue Description====
#This project eventually morphed into a bug-fixing and beautification project. There were some serious inconsistencies, bugs, and syntax issues with the beta branch review grader section. These were found and solved to the best of our ability.
#Fix the “Score awarded/average score” column so that it is populated with the correct numbers.  It is supposed to report the score by the current student reviewer in the first round, the average score by all reviewers in the first round, and ditto for the second round.  If the number of rounds ≠ 2, then the number of scores should be adjusted appropriately.
## There is a bug having to do with "Avg. score" not being calculated sometimes, like when the team that was reviewed should definitely have an average score to be displayed, even if the current student reviewer did not complete the review. This bug will have to be examined further.
#Number the rows of the table (e.g., “2. Student 8370”) so it is easy to count the lines.  This will help assign each TA (and the instructor) an equal number of reviews to grade.


====Design Strategy====
1) all_students_all_reviews: This view displays all the meta reviews and the teammate reviews of students for all the programs they have worked on in that semester. Additionally it provides an aggregate of these review scores as well.
# The "Scores" issue. Unfortunately, this task was more complicated than we originally believed. The team was advised to try to find out as much as possible about the bug, and fix it if possible, but it involves many different classes within Expertiza.
## The variable @avg is computed in the file app/models/answer.rb, and is initially set to nil if an assessment is not present. The variable @avg is also set to a placeholder "----" in the file app/helpers/review_mapping_help.rb. If "@avg_and_ranges[team_id][round][metric]" is not nil, the "@avg" will be set to the average scores. The "@avg_and_ranges" is set to the result returned by method compute_avg_and_ranges_hash in method "review_response_map" in file "app/helpers/report_formatter_helper.rb". The method "compute_avg_and_ranges_hash" is defined in file "app/models/on_the_fly_calc.rb".
## The "Score awarded/average score" column in the table is actually composed of two rendered partials: views/reports/_team_score.html.erb and views/reports/_team_score_score_awarded.html.erb. Within these partials, the method get_awarded_review_score is called, which is defined in the /helpers/review_mapping_helper.rb helper file (line 138). It is within this helper file that the @avg instance variable is also defined. It appears as though the previous team spent some time tracking down the source of the bug in the presentation of the "Avg. score" in the table, but were unable to fix it.
## The @avg instance variable is defined in the method get_review_volume, found in line 152 in /helpers/review_mapping_helper.rb - however, in the beta branch, the method that is called within views/reports/_team_score.html.erb and views/reports/_team_score_score_awarded.html.erb is called get_review_metrics. It appears this error is not present in the master branch of Expertiza.
## Another issue with the scores was that a "nil" value was showing - this issue was simply due to a forgotten check that needed to be added into the app/views/reports/_team_score.html.erb.
#In the _review_report.html.erb file, Line 61, we need to replace the 'each' method with 'each_with_index' to make sure that all rows are indexed. In line 69 add a line to display the index number and make sure that the value of the variable must be index+1, since the values are zero indexed


====Design Pattern====
2) course_student_grade_summary: This view displays the summary of all the programs that students have worked on, its topic, peer score and instructor grade. This includes the total and average of these scores as well.
This project mainly focuses on the UI, so no specific GoF design pattern is particularly being considered. Comments will be added where deemed necessary to further illuminate the functionality of the code. If needed, (if new methods/classes/views are added) this will be updated to reflect those changes.


===The Summary Page===
[[File: assessment_360_class_diagram.png|700px]]
[[File:Summary_page.PNG|1200px|]]
====Issue Description====
#Checkbox items take up far too much space.  Remove duplicated header lines and show just columns of checkboxes to the right of the “questions.”  Also, it is unnecessary to prefix each by “[Question]”.
#Adjust column width intelligently.  The “Reviewee” and “Score” columns are much wider than necessary.  The “Comments” column is also too wide for easy reading.  So consider how the page might be reorganized to take better advantage of the available space.  One option might be to show the comments vertically, astride each other, rather than horizontally, above and below each other.  Mock up your proposal and discuss it with your mentor.
#Get rid of “Review: Round1”.  It should be, “Review Round 1”


====Design Strategy====
==Problem statement==
# To get rid of the duplicated header lines, we will modify view_review_scores_popup.html.erb either by implementing comments vertically, astride each other or by displaying the header columns only once. To tackle the problem of Checkbox items taking up too much space we plan to implement the following mock up."[Question]" would be deleted.


''Original :''
* In the assessment controller > all_students_all_reviews view, it shows columns even if all the data in those columns is nil. Additionally, the empty data is just shown as blank and thus leads to confusion.


[[File:Og_checkbox.PNG|1200px|]]
* Currently the assessment controller > course_student_grade_summary view is missing the columns for average peer review score. Additionally, the same issue of columns being shown even if all data is empty also exists.


[[File:Og_checkbox1.PNG|1200px|]]
* Currently both the pages all_students_all_reviews & course_student_grade_summary show all columns by default and the user has no control to hide/unhide these columns as per their needs.


''Mock_up:''
* Basic refactoring changes need to be implemented, like updating the variable name @teamed_count and using a more appropriate variable name.


[[File:Mock_up.PNG|1200px|]]
==Problems & Solutions==


# Concerning column width, we will play around the preset width in /app/views/popup/view_review_scores_popup.html.erb, the previous team went with 10% for "Reviewee", 5% for "Score" and it looks reasonable.
===assessment controller > all_students_all_reviews view===
# "Review Round" header is located at /app/models/review_response_map.rb, and can be easily modified by adding white space.


====Files to be Viewed/Modified====
The current implementation of this view
Below is a rough list of files that we estimate this particular action item will involve:
#/app/views/popup/view_review_scores_popup.html.erb
#/app/models/review_response_map.rb
#/app/assets/stylesheets/grades.scss


==Test Plan==
[[File: assessment_360_all_student_all_reviews.png|700px]]
Most of the changes in this project are UI focused. Due to this, most of the testing was done via manual functionality testing. However, because of the changes in review_mapping_helper.rb, we did have to make changes to the review_mapping_helper_spec.rb file in order to reflect this. The code diff is shown below, and the process for manual testing is also displayed.


[[File: Review_mapping_helper_spec_diff.png|1200px]]
Following problems were identified in this view:


According to Expertiza Bot, our code test coverage increased by 3.6%.
* Empty rows just show as blank
* Column is visible even if no data is present
* No option to filter columns to allow users to only see particular columns


====Solution====


Below, you can see the updates made to the view to fix the above identified problems:


Just for reference-
[[File: assessment_360_current_all_students_all_reviews.png|700px]]
The processes for testing accessing the review reports:


====Testing Review Grader View====
* When the meta reviews checkbox is unchecked:
#Login using an instructor account, such as: instructor6 / password
#Go to "Manage >> Assignments" and choose one assignment with reviews, i.e., "Program 1", and click on "View Reports".
#There will be a dropdown selector to choose which report to view - select "Review report" from the dropdown, and click "View".
#Check to make sure that the "Avg. score" for reviewed assignments is being shown correctly.
#Check if column widths are appropriate. Make sure the text "Score awarded / Avg. score" instead reads "Score / Avg. score".
#Verify the bar graph display of scores.


[[File: assessment_360_hidden_all_students_all_reviews.png|700px]]


==Modifications==
====Code changes====


===The Main Review-Grader Page===
GitHub Commit: https://github.com/expertiza/expertiza/pull/2490/commits/dc9a3ea8b88809c1c3bcb4a3e4b900d1a1eced53
====Files Modified====
Below is a rough list of files that we estimate this particular action item will involve:


#/app/helpers/review_mapping_helper.rb
'''Controller code updates'''
#/app/views/reports/_review_report.html.erb
#/app/views/reports/_team_score.html.erb


====Review Mapping Helper====
[[File:assessment_360_all_students_all_reviews_controller_code.png|700px]]
The review mapping helper is a module that is used extensively throughout the peer review system in Expertiza to perform a number of things (perhaps too many) including calculating scores, finding team colours, preparing grade data visuals, and other useful computations. In this project, we wanted to fix the inconsistencies between the beta and master branch with specific regard to the get_review_volume() and get_review_metrics() method. These performed the same computation, yet get_review_metrics was called but not defined in the beta branch. This was fixed, and the code diff is presented below. The comments were added later, and a separate picture is shown below.
[[File:Get_review_metrics.png|1200px|]]


Comments:
* In the controller we introduced the hashmaps meta_review_exists, teammate_review_exists, which store boolean values for particular assignments indicating if at least one data point exists for that particular column or not. These values are utilized in the UI, to determine whether or not these columns should be displayed or not.


[[File:review_metrics_comments.png|600px]]
'''UI code updates'''


====Review Report View====
[[File: assessment_360_all_students_all_reviews_html_code.png|700px]]
The addition of indices to each of the reviews for this assignment was a simple fix. Replacing each with each_with_index and printing to HTML solves the issue.
[[File:Index_review_report_html.png|1200px]]


====Team Score====
* Checkboxes have been introduced here to allow users to hide/unhide the columns.
This is a partial HTML that is rendered within the Review Grader view. Changes were made to it to reflect that changes made to get_review_metrics, and the diff is shown below.
[[File:Team_score_html.png|1200px]]


===The Summary Page ===
* Here, the variables from controller are used to conditionally check whether or not a particular column must be displayed or not.
====Files Modified====
Below is a rough list of files that we estimate this particular action item will involve:


# app/views/popup/view_review_scores_popup.html.erb
[[File: assessment_360_all_students_all_reviews_js_code.png|700px]]
#app/assets/stylesheets/grades.scss
#app/models/review_response_map.rb


====New Look Summary Page====
* The javascript is used to listen to checkbox change events and dynamically modify the view.
[[File: New_summary_page.PNG|1200px]]


====Issues Fixed====
===assessment controller > course_student_grade_summary===


*We decided to fix all of our issues with summary page like columns taking too much width, header texts like "Reviewee" and "Score" repeated unnecessarily by reorganizing the page to take better advantage of the available space. We placed the questions vertically, astride each other, rather than horizontally.
The current implementation of this view:
*"Scores" and "comments" column were merged together for aesthetic reasons and to improve readability. The scores are displayed with a colorful background indicating its value.
''Before Modification''
                                                                                         
[[File: Scores_comments_old.PNG|600px]]


''After Modification''
[[File: assessment_360_course_student_grade_current.png|700px]]


[[File: Scores_comments_new.PNG|600px]]
* Missing average peer review column
*“Review: Round1” was changed to “Review : Round1”. Also the title "Review scores: student5061" was changed to "Review scores by student5061" as its more indicative as a title.
* Column is visible even if no data is present
''Before Modification''
* No option to filter columns to allow users to only see particular columns
                                                                                         
[[File: Header_old.PNG|300px]]


''After Modification''
====Solution====


[[File: Header_new.PNG|300px]]
Below, you can see the updates made to the view to fix the above identified problems:


[[File: Review_round.PNG|1200px]]
[[File: assessment_360_course_student_grade_expected.png|700px]]
 
* When the peer reviews checkbox is unchecked:
 
[[File: assessment_360_course_student_grade_hidden.png|700px]]
 
====Code changes====
 
GitHub Commit: https://github.com/expertiza/expertiza/pull/2490/commits/884c5a3eb9323b9a1b5744755dbbc064f7fcb00d
 
'''Controller code updates'''
 
[[File: assessment_360_course_student_grade_controller_code.png|700px]]
 
* In the controller we introduced the hashmaps topic_exists, assignment_grade_exists and peer_review_score_exists, which store boolean values for particular assignments indicating if at least one data point exists for that particular column or not. These values are utilized in the UI, to determine whether or not these columns should be displayed or not.
 
* To calculate the average peer score, the objects total_peer_score and total_peer_reviews are being utilized.
 
'''UI code updates'''
 
[[File: assessment_360_course_student_grade_html_code.png|700px]]
 
* Checkboxes have been introduced here to allow users to hide/unhide the columns.
 
* Here, the variables from controller are used to conditionally check whether or not a particular column must be displayed or not.
 
[[File: assessment_360_course_student_grade_js_code.png|700px]]
 
* The javascript is used to listen to checkbox change events and dynamically modify the view.
 
===Refactor assessment360_controller - Ensure design principles & patterns===
 
Adding appropriate comments and updating method/variable names wherever applicable. In addition to this, the plan is to ensure the SOLID design principles are followed and code will be refactored accordingly.
 
Currently following changes are identified:
 
* Update the variable name @teamed_count to @team_members_count
* Include appropriate comments wherever applicable
 
The above changes have been implemented as part of the project.
 
== Test Plan==
 
The following test plan has been identified to ensure that the above changes don't break the existing system and the new code being introduced is thoroughly tested.
 
=== Manual Testing ===
The following tests have been identified to ensure that the changes made work as anticipated:
 
1. Open any course
 
2. Go to the all_students_all_reviews page
 
3. Verify that only those columns are visible with at least one data point.
 
4. Verify empty data is shown as '--'
 
5. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes
 
6. Go to course_student_grade_summary
 
7. Verify that unattempted scores show up as '--'
 
8. Verify that average peer score column is visible and has correct values.
 
7. Verify that unattempted scores aren't counted toward average.
 
8. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes
 
==References==
 
#[https://github.com/expertiza/expertiza Expertiza on GitHub]
#[https://github.com/OODD-OSS/expertiza GitHub Project Repository Fork]
#[http://expertiza.ncsu.edu/ The live Expertiza website]
#[http://yoururl.tech/expertiza  Demo link]
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]
#[https://github.com/expertiza/expertiza/pull/2490 PR Link]
#[https://youtu.be/iOz4lAbyWnQ Demo Video]

Latest revision as of 04:07, 7 December 2022

This is the design document for Expertiza project E2278 Improve assessment360_controller.rb. This document describes the existing implementation of the assessment360 controller and the updates made to it as part of this project which is primarily UI-focused.

Introduction

Expertiza is an open-source project based on the Ruby on Rails framework. Expertiza provides functionality that allows instructors to get a full or 360-degree overview of a course they teach that includes all students in the course, all assignments, and the scores of every student in each assignment, averages, and final scores as well. This feature is supported by the assessment360 controller.

The assessment360 controller is mainly responsible for the following two views:

1) all_students_all_reviews: This view displays all the meta reviews and the teammate reviews of students for all the programs they have worked on in that semester. Additionally it provides an aggregate of these review scores as well.

2) course_student_grade_summary: This view displays the summary of all the programs that students have worked on, its topic, peer score and instructor grade. This includes the total and average of these scores as well.

Problem statement

  • In the assessment controller > all_students_all_reviews view, it shows columns even if all the data in those columns is nil. Additionally, the empty data is just shown as blank and thus leads to confusion.
  • Currently the assessment controller > course_student_grade_summary view is missing the columns for average peer review score. Additionally, the same issue of columns being shown even if all data is empty also exists.
  • Currently both the pages all_students_all_reviews & course_student_grade_summary show all columns by default and the user has no control to hide/unhide these columns as per their needs.
  • Basic refactoring changes need to be implemented, like updating the variable name @teamed_count and using a more appropriate variable name.

Problems & Solutions

assessment controller > all_students_all_reviews view

The current implementation of this view

Following problems were identified in this view:

  • Empty rows just show as blank
  • Column is visible even if no data is present
  • No option to filter columns to allow users to only see particular columns

Solution

Below, you can see the updates made to the view to fix the above identified problems:

  • When the meta reviews checkbox is unchecked:

Code changes

GitHub Commit: https://github.com/expertiza/expertiza/pull/2490/commits/dc9a3ea8b88809c1c3bcb4a3e4b900d1a1eced53

Controller code updates

  • In the controller we introduced the hashmaps meta_review_exists, teammate_review_exists, which store boolean values for particular assignments indicating if at least one data point exists for that particular column or not. These values are utilized in the UI, to determine whether or not these columns should be displayed or not.

UI code updates

  • Checkboxes have been introduced here to allow users to hide/unhide the columns.
  • Here, the variables from controller are used to conditionally check whether or not a particular column must be displayed or not.

  • The javascript is used to listen to checkbox change events and dynamically modify the view.

assessment controller > course_student_grade_summary

The current implementation of this view:

  • Missing average peer review column
  • Column is visible even if no data is present
  • No option to filter columns to allow users to only see particular columns

Solution

Below, you can see the updates made to the view to fix the above identified problems:

  • When the peer reviews checkbox is unchecked:

Code changes

GitHub Commit: https://github.com/expertiza/expertiza/pull/2490/commits/884c5a3eb9323b9a1b5744755dbbc064f7fcb00d

Controller code updates

  • In the controller we introduced the hashmaps topic_exists, assignment_grade_exists and peer_review_score_exists, which store boolean values for particular assignments indicating if at least one data point exists for that particular column or not. These values are utilized in the UI, to determine whether or not these columns should be displayed or not.
  • To calculate the average peer score, the objects total_peer_score and total_peer_reviews are being utilized.

UI code updates

  • Checkboxes have been introduced here to allow users to hide/unhide the columns.
  • Here, the variables from controller are used to conditionally check whether or not a particular column must be displayed or not.

  • The javascript is used to listen to checkbox change events and dynamically modify the view.

Refactor assessment360_controller - Ensure design principles & patterns

Adding appropriate comments and updating method/variable names wherever applicable. In addition to this, the plan is to ensure the SOLID design principles are followed and code will be refactored accordingly.

Currently following changes are identified:

  • Update the variable name @teamed_count to @team_members_count
  • Include appropriate comments wherever applicable

The above changes have been implemented as part of the project.

Test Plan

The following test plan has been identified to ensure that the above changes don't break the existing system and the new code being introduced is thoroughly tested.

Manual Testing

The following tests have been identified to ensure that the changes made work as anticipated:

1. Open any course

2. Go to the all_students_all_reviews page

3. Verify that only those columns are visible with at least one data point.

4. Verify empty data is shown as '--'

5. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes

6. Go to course_student_grade_summary

7. Verify that unattempted scores show up as '--'

8. Verify that average peer score column is visible and has correct values.

7. Verify that unattempted scores aren't counted toward average.

8. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes

References

  1. Expertiza on GitHub
  2. GitHub Project Repository Fork
  3. The live Expertiza website
  4. Demo link
  5. Expertiza project documentation wiki
  6. PR Link
  7. Demo Video