CSC/ECE 517 Fall 2022 - E2278. Improve assessment360 controller

From Expertiza_Wiki
Revision as of 22:14, 5 December 2022 by Dmmehta2 (talk | contribs)
Jump to navigation Jump to search

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

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

  • When the meta reviews checkbox is unchecked:

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

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


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 - 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 @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 - Ensuring Single Responsibility design principle

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 that 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 front end, tests should be in place to ensure that the computations happen in their specific order and that enough test cases are present.

3. Below edge cases are currently identified that will be tested:

  • Differentiate between a student getting 0 because he/she failed to attempt vs a student getting 0 because he/she hasn't attempted yet. In the first case, we include it while calculating the average while in 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 the all_students_all_reviews page

3. Verify that either 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 toward average

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