CSC/ECE 517 Spring 2022 - E2237: Grading audit trail
Topic Overview & Prior Work (E2158)
Feature Overview
E2158 contains detailed information on the previous team's work with this feature.
A summary of the desired functionality is presented below:
Any instructor can assign or edit a grade freely.
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:
- id of the instructor
- timestamp
Additionally, any comments written by other instructors should be preserved.
Overview of Major Changes By Previous Team
- A new table was added to the database (grading_history), along with the corresponding model (grading_history.rb) and controller (grading_history_controller.rb).
- Whenever an instructor submits a new grade, or edits an existing grade, the grading_history_controller saves a new history entry to the database.
- Two models for specific types of histories were added: review_grading_history.rb, and submission_grading_history.rb.
- A view for displaying the grading history of a particular assignment or review was added (grading_histories/index.html.erb).
Files Modified By Previous Team
- \app\controllers\grades_controller.rb
- \app\controllers\grading_histories_controller.rb
- \app\controllers\review_mapping_controller.rb
- \app\helpers\grading_histories_helper.rb
- \app\models\grading_history.rb
- \app\models\review_grading_history.rb
- \app\models\submission_grading_history.rb
- \app\views\assignments\list_submissions.html.erb
- \app\views\grading_histories\index.html.erb
- \app\views\reports\_review_report.html.erb
- \config\routes.rb
- \app\views\assignments\list_submissions.html.erb
Testing By Previous Team
Functional tests were added.
functional tests added to these files : spec/controllers/review_mapping_controller_spec.rb : spec/models/grading_history.rb : spec/controllers/grading_history_controller.rb
A feature test ensuring that a submission's grading history is shown completely, and in chronological order, was added.
feature test handled by these two files : spec/features/grade_histories_spec.rb : spec/features/helpers/grade_histories_helper.rb
Issues with Existing Tests
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.
Problem Statement
There are three areas of focus for our team's project (E2237):
System Crashes and Object Creation
- We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.
- We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.
Changes to Grading History View
The grading history table in the view is earmarked for certain changes:
- Student ID is a redundant field--move it to the page header.
- Assignment ID is a redundant field--move it to the page header.
Data Flow and Functionality
Old Data Flow
The existing data flow for the grading history feature for reviews is shown below:
The related table from the database is review_scores.
New Data Flow
The latest flow for the Grading History functionality is shown below:
The primary function of this change is to DRY out the current implementation. The flow shown below tracks the tables where grades and comments(that comprise grading history) are recorded into already existing tables. The newly created table grading_history is linked to the teams table from which comments and grades are drawn. This table then displays these values, thereby completing the functionality when the user clicks on display history. The grading_history table contains the team id and instructor_name
Code and Documentation Goals
We must explain changes made to files with diagrams and justifications.
Explanations will be provided from these perspectives:
- data flow
- functions
- code comments
Planned and Completed Work
General Design Goals
Changes to the Grading History Table
The images below reference grading history view issues mentioned above in the Problem Statement.
To DRY the code, we will remove the redundant table data boxed below...
...and we'll move it to the page header:
Behavior Driven Development
Due to the nature of the functionalities that we will be implementing, we will be following a BDD methodology - Our primary intention with this is to focus our refactoring, development and database design efforts to ensure that end-user functionality is implemented fully.
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. BDD Scenarios
System Stability: Strategies
The source of crashing issues is currently unknown. To debug this, we will pursue the following:
- Refactor the specs and controllers
- Ensure DRY principle is followed
- Improve readability and maintainability
- Add code comments as needed
- Ensure testing objects do not cause crashes
Documentation
- Changes to any files will be documented on this page; the programmatical reasoning behind the changes shall be explained, and will be in accordance with the DRY principle.
- Any changes to the overall program logic and data flow will be illustrated with UML diagrams in this document, along with the reasoning for any such changes.
- A pull request of the fixed code, fully commented, will be provided in this document.
Specific Tasks Completed
will be added for the final submission
Implementation
will be added for the final submission
Testing
Video Demonstration
will be added for the final submission
Testing Goals and Test Objects
Drawing from the project objectives:
- Verify that Student Accounts can be created and are saved to the database.
- Verify that Assignments can be created and are saved to the database.
- Verify that Project Bids can be created and are saved to the database.
- Ensure that Student ID is shown in the header, and verify via manual UI testing
- Ensure that Assignment ID is shown in the header, and verify via manual UI testing
- Finally, verify that tests can be run without crashing the system.
RSpec Unit Tests
Test cases provided here, will add RSpec code blocks for the final submission
- Student Account
Scenario: Account Creation with all fields Given: Logged in as an Instructor/Admin When: Create student account with all the necessary fields Then: Account is saved in the database Scenario: Duplicate Account Creation with all fields Given: Logged in as an Instructor/Admin When: Create student accounts with all the necessary fields Then: Student already exists message is shown Scenario: Account Creation without all fields Given: Logged in as an Instructor/Admin When: Create student accounts without all the necessary fields Then: Message to input fields is shown
- Assignments
Scenario: Assignment Creation with all fields Given: Logged in as an Instructor/Admin When: Create Assignment with all the necessary fields Then: Assignment is saved in the database Scenario: Duplicate Assignment Creation with all fields Given: Logged in as an Instructor/Admin When: Create Assignment with all the necessary fields Then: Assignment already exists message is shown Scenario: Assignment Creation without all fields Given: Logged in as an Instructor/Admin When: Create Assignment without all the necessary fields Then: Message to input fields is shown
- Project Bids
Scenario: Project Bid creation Given: Logged in as a Student When: Complete Project Bid for open Project Then: Project Bid is saved in the database Scenario: Duplicate Project Bid Given: Logged in as a Student When: Click on bid for open Project Then Message stating already selected shown
Manual UI Tests
Note: Discussion with mentor in progress to determine if UI Automation testing is in scope
- Student ID in header
Scenario: Student ID in grading history view Logged in as an Instructor/Admin On Assignment page, click on Grading History Resulting Grading History Table is shown Student ID appears in the header, not in any table columns
- Assignment ID in header
Scenario: Assignment ID in grading history view Logged in as an Instructor/Admin On Assignment page, click on Grading History Resulting Grading History Table is shown Assignment ID appears in the header, not in any table columns
Regression Testing
In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that old test cases still pass.
- Get the specific format requirement for the title, and assert that it's there. Ensure that this doesn't appear anywhere else (possible via ensuring count is 1)
- Procure specific required column width, and assert that this is the value in the file (the constant)
Conclusions and Future Work
Comprehensive Testing and Scope
- Initial Thoughts: Current code coverage cannot be determined due to a combination of missing tests and simulation crashes. This will need to be fixed to enable monitoring of regular metrics, and adding comprehensive tests that target full code coverage.
- will be added for final submission
Conclusion
will be added for final submission
Useful Links
Previous team's Expertiza GitHub pull request
E1934 implementation video walkthrough
Contributors
Students
- Bhuwan Bhatt (brbhatt)
- Soumyadeep Chatterjee (schatte5)
- Kelly Fleming (kflemin3)
- Karthik Gopala Sundaresan (kgopala3)
Mentor
- Kai Xiao (yxiao28)