CSC/ECE 517 Fall 2022 - E2278. Improve assessment360 controller
This is the design document for Expertiza project E2278 Improve assessment360_controller.rb. This document describes the current implementation of the assessment360 controller and the expected design changes 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.
Problems statement
- In the assessment controller > all_students_all_reviews view, it shows a summary including both meta-reviews and teammate reviews and this makes the UI a bit complicated. Thus, this needs to be updated in a way that, the user has the option to select a filter, to either see meta-reviews or teammate reviews but not both at the same time. This will eventually simplify the UI and make it easier to read through.
- Currently on the summary page, if the student hasn't attempted a quiz or they are yet to receive a grade, the view shows that row as '-'. Instead, it is preferable to depict it as '0', this will aid in the better calculation of total scores. One thing to ensure here is, while calculating the average such values must not be considered since the student hasn't attempted it yet, and it would be inaccurate to consider that value while calculating the average for the same.
- Currently the assessment controller > course_student_grade_summary view is missing the columns for average peer review score and average instructor assigned score. Thus, the view should be updated to reflect these scores as well.
- 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. Thus, a checkbox list of columns must be provided for users to select/unselect from and allow users to only see the columns of their interest.
- DB access must be minimized, and this should be implemented with the use of bullet gem.
- Basic refactoring changes need to be implemented, like updating the variable name @teamed_count and using a more appropriate variable name.
Planned work
assessment controller > all_students_all_reviews view
The current implementation of this view
The plan is to update this view, to take in a parameter in the controller function and based on that parameter, show either the meta-reviews or teammate reviews column.
Below, you can see the expected UI after the changes:
- Only Teammate Reviews:
- Similarly the above view will be visible if the parameter mentioned meta-reviews, the only difference will be the data.
assessment controller > course_student_grade_summary
The current implementation of this view:
- Replace '-' with '0' for the easier average calculation
- Include columns for average peer review scores and average instructor-assigned scores.
Find below the expected UI after the above changes are implemented:
Include checkboxes
Users should be able to hide/unhide any columns as per their interest. This will be included in both the above-mentioned pages.
Find an example view of how the page is expected to look after implementing the checkbox filter:
NOTE: Please note that the above expected UI views aren't finalized, instead, they are just a prediction of how the pages might look after the changes are implemented.
Improve performance
Implement bullet gem to reduce database queries and increase the application performance.
Refactor assessment360_controller
Adding appropriate comments and updating method/variable names wherever applicable. Currently following changes are identified:
- Update the variable name @teamed_count to @teammate_count
- Include comments for uncommented methods including assignment_grade_summary, insure_existence_of, format_topic, format_score
- Move helper methods format_topic, format_score out of the controller file to the controller_helper file
While the above work has been identified and planned, more scope could be included as and when the team starts implementing the above changes.
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.
Automated Testing using RSPEC
The primary goal of automated testing would be to increase code coverage by including new test cases and removing redundant and unnecessary tests.
1. Focus on functions which are the core of the controller - covering important aspects like who accesses the page, checking permissions for the page, how the page behaves on edge cases etc.
2. Since most of the work in this module is computations in the back and rendering data in the frontend, tests should be in place to ensure that the computations happen in their specific order and enough test cases are present.
3. Below edge cases are currently identified that will be tested:
- Differentiate between a student gettin 0 because he/she failed to attempt vs student getting 0 because he/she hasn't attempted yet. The first case we include while calculating average while the second case we don't.
- If an unauthorized user tries to access the page, they should be redirected to the home page.
Manual Testing
The following tests have been identified to ensure that the changes made work as anticipated:
1. Open any course 2. Go to all_students_all_reviews page 3. Verify that either of teammate or meta reviews are visible on the screen 4. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes 5. Go to course_student_grade_summary 6. Verify that unattempted scores show as 0 7. Verify that unattempted scores aren't counted towards average 8. Use checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes