CSC/ECE 517 Spring 2024 - E2414 Grading Audit Trail

From Expertiza_Wiki
Revision as of 01:44, 25 March 2024 by Jebadill (talk | contribs)
Jump to navigation Jump to search

Problem Statement

NC State faculty members and students use Expertiza Open-Source Website to submit assignments, grade them, form teams, and among other features. The main problem statement for project E2414 is that there is no traceability on who was the instructor that assigned or edited a grade of a submission.

Program Objectives

Grading Audit Trail must be implemented with the following information to be stored:

1. When an instructor assigns a grade, there needs to be an indication of who did it and when it was done.

2. Comments previously provided by other instructors must also be preserved.

This information needs to be stored every time an instructor edits a grade / comments and clicks the save button. The grading audit trail can probably pattern off the submission records history on Expertiza. The submission record page can be reached by logging in as instructor -> Manage -> Assignments -> View Submissions -> History. At the minimum, a grading log entry must include the instructor id, assignment id, student id, grade comment and timestamp.

Implementation

Creating GradingHistoriesController

The grading_histories_controller.rb functionality created on Ruby on Rails application serves as a critical component for managing and displaying the grading history of reviews in an educational setting. Rails ensures the integration with the model and view layers, facilitating a robust and intuitive interface for users to interact with grading data. Through the implementation of callbacks for pre-action configurations and the inclusion of authorization logic via concerns, the application effectively enforces security and role-based access control. This ensures that only authorized users such as administrators, instructors, and teaching assistants can access sensitive grading information based on their association with specific courses or assignments. The controller is adept at handling various user permissions, distinguishing between submission and review grading histories, and organizing all related entries in a user friendly manner by displaying them in reverse chronological order. This organization enhances the application's usability by allowing users to easily navigate through the grading history.

Creating Model GradingHistory

The grading_history.rb model,has been created and enhanced with a refactoring that introduces a class method assignment_for_history. This method significantly extends the model's functionality by determining the context of grading—whether it pertains to a submission or a review based on the type of grading activity. For submissions, it identifies the associated AssignmentTeam using the graded_member_id to retrieve the corresponding assignment. In the case of reviews, it uses the participant_id to find the specific AssignmentParticipant, facilitating a direct link to the reviewed assignment or activity through the ReviewGrade model. This addition underscores the model's pivotal role in not only linking grading records to instructors and assignments via belongs_to associations but also in dynamically determining the relevant assignment context based on grading type. This enhancement bolsters the model's capacity to provide a comprehensive and nuanced tracking mechanism, offering deeper insights into the historical analysis of grading actions across the platform.

Creating Model ReviewGradingHistory

The review_grading_history.rb model, inheriting from the controller, is tailored for peer review grading events, featuring protection against mass-assignment vulnerabilities and establishing a relationship with the Participant class to track review grades within the system.

Creating Model SubmissionGradingHistory

The submission_grading_history.rb model extends the controller to focus on submission-related grading records, leveraging attr_protected to enhance security and associating with the Team class to directly relate grades to submitting teams within the platform.

Creating View grading_histories

In the view for grading_histories, the _form.html employs a form builder to neatly handle both the creation and updating of grading history entries. The form is designed to alert users to any validation errors by enumerating them clearly at the top of the form, and it also provides immediate feedback. Once all validation requirements are satisfied, the form offers a straightforward 'Save' submission button, making the process of recording grading actions intuitive and efficient.

The index.html view for grading_histories has been created to enhance performance and readability. It presents a grade history in a striped table format, centered around a dynamic header that adapts to display grading information pertinent to submissions or reviews. The created and refactored code uses conditional logic to efficiently handle potential nil records, ensuring that the display adapts gracefully in the absence of grading data. When available, the table populates with comprehensive details such as the instructor's full name, grade, comments, and the precise timestamp of grading—presented in an orderly fashion.

Updating Grades Controller

We introduced important functionalities to improve grading transparency and history tracking on the grades_controller.rb. An addition to the save_grade_and_comment_for_submission method is the creation of a GradingHistory record each time a submission is graded. This record stores vital information, including the instructor's ID, assignment ID, the type of graded item ('Submission'), the graded team's ID, along with the given grade and accompanying comment. This development is a significant stride in grading auditability, as it ensures every grading action is logged and traceable within the system. The method also encapsulates error handling to alert users in the event of a failure in saving the grade and comment, thereby maintaining a user-friendly interface.

Updating Review Mapping Controller

We integrated a robust suite of methods to facilitate peer review assignments and management within our educational platform on the review_mapping_controller.rb. The introduction of dynamic reviewer assignments allows for flexible peer evaluation processes, aligning with the evolving needs of academic settings. The calibration feature provides a mechanism for instructors to gauge the quality of reviews, ensuring that the assessment process is both fair and consistent. One the most important improvements is the inclusion of grading history records for reviews. With this feature, the grading process for reviewers is not just a transitory evaluation but a documented history, contributing to transparent and traceable assessment practices. This aspect of the enhancement not only adds depth to the instructor's oversight capabilities but also enriches the feedback loop for students. The controller now supports more organized review policies, checking for outstanding reviews and allowing assignments to adhere strictly to the configured review limits. These checks prevent over-assignment of reviews, thereby maintaining a balanced workload among participants and ensuring the quality of peer assessments. The enhanced error handling and user feedback mechanisms contribute to a smoother user experience by providing clearer guidance and actionable insights during exception scenarios, such as attempting to delete a review mapping in progress or assigning a self-review.

Updating Review Grade Model

The review_grade.rb model was updated with the find_graded_member method contribute to deepening the contextual understanding of review grades within the system. This method introduces the ability to directly associate a graded review with its corresponding assignment through the participant's parent relationship. By encapsulating this logic within the model, the system design adheres more closely to the principles of object-oriented programming, promoting encapsulation and cohesion. This change has a more intuitive and maintainable approach to accessing assignment details from a review grade instance. The find_graded_member method abstracts the complexity of traversing associated records, thereby simplifying external calls and enhancing code readability.

Updating Views Assignment List Submissions

The added code for the assignments/list_submissions.html.erb file introduces functionality to access submission and grading histories directly from the submissions table. This upgrade instructors and TAs, with straightforward links to view the progression and evaluation of team submissions over the duration of an assignment. By adding "Submission History" and "Grading History" links, the update improves the usability and information accessibility, allowing for a more detailed tracking of a team's submissions and the grading process. This feature separates the concerns of submission tracking and grading, catering to the needs of users who may require insights into either aspect independently, thereby streamlining the user experience in monitoring and evaluating student progress.

Update Views Reports ReviewReport HTML

The new code added for the views/reports/_review_report.html.erb introduces a "Grading History" link within the grading and comments section of the review report, aimed at enhancing the evaluation process by providing direct access to a comprehensive history of grades assigned to specific reviews. This functionality enriches the platform's transparency and accountability by allowing instructors or TAs to effortlessly track and assess the consistency and progression of grades over time. By situating the link within the context of grading, it streamlines the workflow for users engaged in the review process, offering a seamless transition to review historical grading data. The dynamic generation of this link, based on the reviewer's user_id, ensures that the historical data presented is directly relevant to the evaluator, bolstering the tool's effectiveness in maintaining academic integrity and ensuring fairness in assessment practices.

Update Spec Factories rb file

The code we added in the spec/factories/factories.rb file introduces a new factory for GradingHistory, which is designed to create test data for grading history records within the application. This factory sets up a mock GradingHistory object with predefined attributes such as instructor_id, assignment_id, graded_item_type, graded_member_id, grade, and comment. This addition allows for the testing of features related to the tracking and displaying of grading histories in the application, facilitating the assessment of functionalities that involve historical grading data for assignments, submissions, or participants. The inclusion of this factory enhances the test suite by providing a means to easily generate and manipulate grading history data for various testing scenarios.

Testing Grading Audit Trail

We implemented the test skeletons provided by our TA to enhance our testing framework. By integrating these pre-constructed scenarios into our test suite, we have strengthened the reliability of our application. These skeletons served as a starting point, which we tailored to align with the unique requirements and functionalities of our system. Through a process of refactoring, we eliminated redundant tests, introduced additional scenarios to cover new functionalities, and modified existing tests to better reflect the behaviors and permissions associated with the GradingHistoriesController. This approach has not only expedited our testing phase but has also granted us deeper insights into the intricate permissions and workflows within our application. By verifying each role's access and the corresponding outcomes, we ensured that our application upheld its stringent security and functionality standards.

Test code for Grading History Controller

The grading_histories_controller_spec.rb spec tests various scenarios to ensure proper access control and functionality of the grading history feature within an educational app. It uses fabricated data for users and assignments to check permissions, verifying that only administrators, instructors, and TAs associated with an assignment can view its grading history. The tests confirm that unauthorized roles like students are denied access. Additionally, it tests that the controller sets up necessary variables correctly, depending on whether the context is a submission or review. These tests safeguard against unauthorized access and ensure the reliability of the grading history tracking system.

Test Code for Spec Helper GradeHistories

The grade_histories_helper_spec.rb module is designed to provide a scaffold for feature tests related to grade histories. It consists of setup procedures that lay the groundwork for a consistent and controlled testing environment. The assignment_setup method within the module encapsulates the creation of an assignment with predefined characteristics, a list of participants, various deadline types, and corresponding deadline rights. This method simulates the environment needed for an assignment's lifecycle, including submission and review processes. Moreover, the helper includes a make_submission method, automating the steps a student would take to submit a link to their work. This encompasses navigating to the assignment page, entering the submission details, and executing the submission action. The combination of these methods in the spec helper allows for a seamless transition into actual test scenarios, ensuring that each feature test for grading histories can run in an environment that closely mimics the real application state. This leads to more reliable test outcomes and a robust verification process for the grading audit trail functionality within the application.