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

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 83: Line 83:


== Test Plan==
== 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 ===
=== Automated Testing using RSPEC ===
Please note that we have removed several older tests which tested functions that are now private and inaccessible outside the controller class itself. However, the methods that call these private functions are still tested and tests are passing successfully.
The primary goal of automated testing would be to increase code coverage by including new test cases and removing redundant and unnecessary tests.


1. After refactoring, most of our new test cases 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.
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. Using RSpec, the test cases cover various scenarios and tests each scenario in depth.
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.
Eg, for access control, we check the access for all roles for a user comprehensively to ensure that only people with permissions can view the page.  


3. Since most of the work in this module is computations in the back and rendering data in the frontend, we've ensured that the computations happen in their specific order and enough test cases are present for edge cases.
3. Below edge cases are currently identified that will be tested:


4. For backend computations, we've covered lot of edge cases like no participants to a course, when there are no reviews made by a participant, when assignment doesn't exists, insure existence_of being called before executing index page etc.
* 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.
5. For frontend, we've covered cases like formatting of the data in the page, null dataset, score being int, float, null, displaying percentages when data is int, float, null etc.
 
Even though we've moved most of the code into private functions, the core functionalities of the controller are refactored and appropriate test cases are written to ensure high coverage.  
 
Please run the following command to execute the tests:
 
rspec spec/controllers/assessment360_controller_spec.rb


=== Manual Testing ===
=== Manual Testing ===
The following steps needs to be performed to test this code from UI:
The following tests have been identified to ensure that the changes made work as anticipated:
 
1. Log in as instructor(username: instructor6 , password: password). Please either do step 2 or 3, as both are not required.
 
2. Select Courses, and the page will show a list of courses. Please select the rightmost icons for any course (we recommend CSC517 Fall 2017, CSC517 Fall 2011 so there’s more data, but it can take some time for it load since there’s a lot of pre-loaded data in the VCL)
 
3. Alternatively, you can log in and go to this URL: http://152.7.99.75:8080/assessment360/index?course_id=184
 
4. You should be able to see a webpage with a table and checkboxes at the top. This table is an instructor’s 360-degree view of a course, containing the scores of each students in the course for every assignment the instructor has added to Expertiza.


5. Unchecking some or all of the checkboxes removes and brings back various columns from/to the page. Please feel free to test this out.
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

Revision as of 22:06, 15 November 2022

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