<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Schatte5</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Schatte5"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Schatte5"/>
	<updated>2026-05-14T22:07:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145571</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145571"/>
		<updated>2022-05-01T02:42:53Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Useful Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment Name in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Name in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment Name appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Color change after Grade is assigned to a submission&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Team_ID Color changes from blue to brown when grade is assigned  &lt;br /&gt;
Logged in as an Instructor of Course/Admin or TA assigned to Course&lt;br /&gt;
  On Assignment page, click on Etc-&amp;gt;View Submissions&lt;br /&gt;
   All submissions for assignment are shown&lt;br /&gt;
    Team name is blue, and grade is not assigned&lt;br /&gt;
     Click on &amp;quot;Assign Grade&amp;quot; under team name&lt;br /&gt;
      Instructor/TA assigns grade, save successfully&lt;br /&gt;
       Back to submissions list, team name is now brown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with so many, more time &amp;amp; work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=YmXsANRlB5Q Updated RSpec Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2407 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145570</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145570"/>
		<updated>2022-05-01T02:42:08Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Useful Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment Name in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Name in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment Name appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Color change after Grade is assigned to a submission&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Team_ID Color changes from blue to brown when grade is assigned  &lt;br /&gt;
Logged in as an Instructor of Course/Admin or TA assigned to Course&lt;br /&gt;
  On Assignment page, click on Etc-&amp;gt;View Submissions&lt;br /&gt;
   All submissions for assignment are shown&lt;br /&gt;
    Team name is blue, and grade is not assigned&lt;br /&gt;
     Click on &amp;quot;Assign Grade&amp;quot; under team name&lt;br /&gt;
      Instructor/TA assigns grade, save successfully&lt;br /&gt;
       Back to submissions list, team name is now brown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with so many, more time &amp;amp; work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2407 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145538</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145538"/>
		<updated>2022-04-28T20:09:20Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment Name in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Name in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment Name appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Color change after Grade is assigned to a submission&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Team_ID Color changes from blue to brown when grade is assigned  &lt;br /&gt;
Logged in as an Instructor of Course/Admin or TA assigned to Course&lt;br /&gt;
  On Assignment page, click on Etc-&amp;gt;View Submissions&lt;br /&gt;
   All submissions for assignment are shown&lt;br /&gt;
    Team name is blue, and grade is not assigned&lt;br /&gt;
     Click on &amp;quot;Assign Grade&amp;quot; under team name&lt;br /&gt;
      Instructor/TA assigns grade, save successfully&lt;br /&gt;
       Back to submissions list, team name is now brown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with so many, more time &amp;amp; work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145537</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145537"/>
		<updated>2022-04-28T19:57:40Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment Name in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Name in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment Name appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Color change after Grade is assigned to a submission&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Team_ID Color changes from blue to brown when grade is assigned  &lt;br /&gt;
Logged in as an Instructor of Course/Admin or TA assigned to Course&lt;br /&gt;
  On Assignment page, click on Etc-&amp;gt;View Submissions&lt;br /&gt;
   All submissions for assignment are shown&lt;br /&gt;
    Team name is blue, and grade is not assigned&lt;br /&gt;
     Click on &amp;quot;Assign Grade&amp;quot; under team name&lt;br /&gt;
      Instructor/TA assigns grade, save successfully&lt;br /&gt;
       Back to submissions list, team name is now brown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145536</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145536"/>
		<updated>2022-04-28T19:53:24Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment Name in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Name in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment Name appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145535</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145535"/>
		<updated>2022-04-28T19:52:58Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Receiver ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145534</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145534"/>
		<updated>2022-04-28T19:52:28Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145533</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145533"/>
		<updated>2022-04-28T19:51:47Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID/Team ID (Receiver_ID) in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145532</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145532"/>
		<updated>2022-04-28T19:43:11Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Planned and Completed Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145531</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145531"/>
		<updated>2022-04-28T19:42:56Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145435</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145435"/>
		<updated>2022-04-26T03:59:50Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality:''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing:''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work:''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145434</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145434"/>
		<updated>2022-04-26T03:59:35Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Comprehensive Testing and Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
The student ID and the Assignment ID have been moved to the header in accordance with the DRY principle. The redundant fields present in the table have also been removed.&lt;br /&gt;
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems:''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145432</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145432"/>
		<updated>2022-04-26T03:58:49Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following is a code snippet of the new view only, the grading history view. Other changes can be seen from the Pull Request linked at the end.&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team. &lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145431</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145431"/>
		<updated>2022-04-26T03:57:09Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Conclusions and Future Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
*/app/views/grading_histories/index.html.erb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% record = @grading_histories[0]&lt;br /&gt;
  if record == nil&lt;br /&gt;
    receiver = &amp;quot;&amp;quot;&lt;br /&gt;
    assignment = &amp;quot;&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    if record.grading_type == &amp;quot;Submission&amp;quot;&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + Team.where(id: record.grade_receiver_id).pluck(:name).first&lt;br /&gt;
      assignment = &amp;quot;for the submission &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    else&lt;br /&gt;
      receiver = &amp;quot;of &amp;quot; + User.where(id: record.grade_receiver_id).pluck(:fullname).first&lt;br /&gt;
      assignment = &amp;quot;for review in &amp;quot; + Assignment.where(id: record.assignment_id).pluck(:name).first&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;center&amp;quot;&amp;gt;Grade History &amp;lt;%= receiver %&amp;gt; &amp;lt;%= assignment %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;border-collapse:collapse; table-layout:fixed; width:1500px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;thead&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Instructor&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Grade&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;Graded At&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. --&amp;gt;&lt;br /&gt;
  &amp;lt;tbody&amp;gt;&lt;br /&gt;
  &amp;lt;% @grading_histories.each do |record| %&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= User.where(id: record.instructor_id).pluck(:fullname).first %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.grade %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.comment %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td style=&amp;quot;padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;&amp;quot;&amp;gt;&amp;lt;%= record.created_at %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screenshot of the Grading History Table&lt;br /&gt;
&lt;br /&gt;
[[File:Submission_Grading_History_Table.jpeg|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''TA Grade Editing Problems''' The current version of beta branch has an issue wherein grades that have already been assigned cannot be changed by any TAs. This issue has been brought to the attention of the Expertiza team. &lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
* '''Functionality''' The functionality regarding grading changes/trails has been demonstrably completed; Instructors can change grades for their assignment submissions, and the changes are reflected in the enw created Grading History Table.&lt;br /&gt;
* '''Appearance''' The requested layout of the Grading History table, with the student/teamID &amp;amp; the assignmentID at the header, along with the instructorID in it's own column on the left, is done, and is shown in the screenshots in this document.&lt;br /&gt;
* '''Testing''' Tests have been added into Expertiza that ensure that the positive flows work as intended. More tests need to be added for completeness, as stated below.&lt;br /&gt;
* '''Future Work''' More testing is required - with over 650 changes, more work is needed to add tests that ensure comprehensive coverage.&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145407</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145407"/>
		<updated>2022-04-26T03:43:50Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Issues with Existing Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145403</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145403"/>
		<updated>2022-04-26T03:42:54Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145401</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145401"/>
		<updated>2022-04-26T03:42:35Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Data Flow and Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145399</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145399"/>
		<updated>2022-04-26T03:42:15Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Planned and Completed Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145397</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145397"/>
		<updated>2022-04-26T03:40:18Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Video Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145396</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145396"/>
		<updated>2022-04-26T03:40:05Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Video Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145395</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145395"/>
		<updated>2022-04-26T03:39:34Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Video Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
&lt;br /&gt;
*Factory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Used for Grading Histories Controller Spec&lt;br /&gt;
factory :grading_history, class: GradingHistory do&lt;br /&gt;
    id 1&lt;br /&gt;
    instructor_id 6&lt;br /&gt;
    assignment_id 1&lt;br /&gt;
    grading_type 'Submission'&lt;br /&gt;
    grade_receiver_id 1&lt;br /&gt;
    grade 100&lt;br /&gt;
    comment 'Good work!'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grading Histories&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Grading History creation&lt;br /&gt;
Given: A team exists for a particular assignment and has a submission&lt;br /&gt;
When: An instructor assigns a grade for that submission&lt;br /&gt;
Then: The grading history entry is created&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Review Mapping&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Reviewer Grade and Comment&lt;br /&gt;
Given: A student has given a review for a submission&lt;br /&gt;
When: An instructor assigns a grade for the review&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Grade&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Save Grade and Comment for Submission&lt;br /&gt;
Given: A team has made a submission for an assignment&lt;br /&gt;
When: An instructor assigns a grade for the submission&lt;br /&gt;
Then: The assigned grade and the accompanying comment are saved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2399 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145373</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145373"/>
		<updated>2022-04-26T02:46:55Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Useful Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145372</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=145372"/>
		<updated>2022-04-26T02:39:14Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Useful Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Schatte5&amp;diff=145116</id>
		<title>User:Schatte5</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Schatte5&amp;diff=145116"/>
		<updated>2022-04-25T06:54:52Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: Created page with &amp;quot;Spring 2022 ECE517 Student. Email expertiza support in case of any questions that aren't answered in the wiki.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spring 2022 ECE517 Student.&lt;br /&gt;
Email expertiza support in case of any questions that aren't answered in the wiki.&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144824</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144824"/>
		<updated>2022-04-12T01:22:58Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* New Data Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|345px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144822</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144822"/>
		<updated>2022-04-12T01:22:48Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* New Data Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg|3450px]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Behavior Driven Development'''&amp;lt;br&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts. [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144773</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144773"/>
		<updated>2022-04-12T00:35:37Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Old Data Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144772</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144772"/>
		<updated>2022-04-12T00:35:25Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Old Data Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144771</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144771"/>
		<updated>2022-04-12T00:35:12Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Data Flow and Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work (E2158) ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information on the previous team's work with this feature. &lt;br /&gt;
&lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
Any instructor can assign or edit a grade freely. &lt;br /&gt;
&lt;br /&gt;
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.&lt;br /&gt;
&lt;br /&gt;
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:&lt;br /&gt;
* id of the instructor&lt;br /&gt;
* timestamp&lt;br /&gt;
Additionally, any comments written by other instructors should be preserved.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
**Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Modified By Previous Team ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing By Previous Team ===&lt;br /&gt;
&lt;br /&gt;
''Functional tests'' were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/models/grading_history.rb&lt;br /&gt;
: spec/controllers/grading_history_controller.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for our team's project (E2237):''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.&lt;br /&gt;
# We must ensure that the creation of testing objects, namely Student Accounts, Assignments, and Project Bids, does not cause crashing.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History View ===&lt;br /&gt;
&lt;br /&gt;
The grading history table in the view is earmarked for certain changes:&lt;br /&gt;
# '''Student ID''' is a redundant field--move it to the page header.&lt;br /&gt;
# '''Assignment ID''' is a redundant field--move it to the page header.&lt;br /&gt;
&lt;br /&gt;
==Data Flow and Functionality==&lt;br /&gt;
===Old Data Flow===&lt;br /&gt;
The existing ''data flow'' for the grading history feature for reviews is shown below:&lt;br /&gt;
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:0px;top:0px&amp;quot;&amp;gt;[[File:Reviewhistory.jpg|270px]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;position:relative;left:125px;top:0px&amp;quot;&amp;gt;[[File:Review scores imported.png|560px]] &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Data Flow===&lt;br /&gt;
&lt;br /&gt;
The latest ''flow'' for the Grading History functionality is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Kai_new_flow 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:kai_diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
We must explain changes made to files with diagrams and justifications.&lt;br /&gt;
&lt;br /&gt;
Explanations will be provided from these perspectives:&lt;br /&gt;
* data flow&lt;br /&gt;
* functions&lt;br /&gt;
* code comments&lt;br /&gt;
&lt;br /&gt;
== Planned and Completed Work ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The images below reference grading history view issues mentioned above in the ''Problem Statement''.&lt;br /&gt;
&lt;br /&gt;
To DRY the code, we will remove the redundant table data boxed below...&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; ...and we'll move it to the page header:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:&lt;br /&gt;
* Refactor the specs and controllers&lt;br /&gt;
** Ensure DRY principle is followed&lt;br /&gt;
** Improve readability and maintainability&lt;br /&gt;
** Add code comments as needed &lt;br /&gt;
* Ensure testing objects do not cause crashes&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow_3.jpg&amp;diff=144768</id>
		<title>File:Kai new flow 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow_3.jpg&amp;diff=144768"/>
		<updated>2022-04-12T00:32:32Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow_2.jpg&amp;diff=144765</id>
		<title>File:Kai new flow 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow_2.jpg&amp;diff=144765"/>
		<updated>2022-04-12T00:30:13Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow.jpg&amp;diff=144763</id>
		<title>File:Kai new flow.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_new_flow.jpg&amp;diff=144763"/>
		<updated>2022-04-12T00:29:19Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_diagram1.jpg&amp;diff=144761</id>
		<title>File:Kai diagram1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_diagram1.jpg&amp;diff=144761"/>
		<updated>2022-04-12T00:26:59Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_diagram.jpg&amp;diff=144756</id>
		<title>File:Kai diagram.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Kai_diagram.jpg&amp;diff=144756"/>
		<updated>2022-04-12T00:24:06Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: phd level diagram, exclusive access&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;phd level diagram, exclusive access&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144605</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144605"/>
		<updated>2022-04-07T21:24:40Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
The data flow for this feature is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&lt;br /&gt;
The related table from databases is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores]. The ER table of review_scores is shown as below.&lt;br /&gt;
&lt;br /&gt;
[[File:Review scores imported.png]]&lt;br /&gt;
&lt;br /&gt;
The latest flow for the Grading History functionality is shown below:&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144604</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144604"/>
		<updated>2022-04-07T21:21:35Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
The data flow for this feature is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&lt;br /&gt;
The latest flow for the Grading History functionality is shown below:&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144603</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144603"/>
		<updated>2022-04-07T21:21:17Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144602</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144602"/>
		<updated>2022-04-07T21:19:32Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The data flow for this feature is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&lt;br /&gt;
The latest flow for the Grading History functionality is shown below:&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144601</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144601"/>
		<updated>2022-04-07T21:19:22Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The data flow for this feature is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
The latest flow for the Grading History functionality is shown below:&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144600</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144600"/>
		<updated>2022-04-07T21:17:44Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The data flow for this feature is shown below:&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144599</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144599"/>
		<updated>2022-04-07T21:16:57Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* System Stability: Strategies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144598</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144598"/>
		<updated>2022-04-07T21:15:01Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* System Stability: Strategies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The data flow that we will be working on is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144597</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144597"/>
		<updated>2022-04-07T21:14:48Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* System Stability: Strategies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The data flow that we will be working on is shown below:&lt;br /&gt;
[[File:Reviewhistory.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewhistory.jpg&amp;diff=144596</id>
		<title>File:Reviewhistory.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewhistory.jpg&amp;diff=144596"/>
		<updated>2022-04-07T21:13:28Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144595</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144595"/>
		<updated>2022-04-07T20:47:39Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*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.&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Reasoning and data flow structures/UML diagrams should be added that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The outlined code here is to be removed as these fields are redundant.&lt;br /&gt;
We will perform the following to DRY the implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144263</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144263"/>
		<updated>2022-04-06T04:38:17Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Changes to the Grading History Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Add reasonings and data flow structures/UML diagrams that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The outlined code here is to be removed in order to remove redundant data from the table&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144261</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144261"/>
		<updated>2022-04-06T04:36:27Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Manual UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Add reasonings and data flow structures/UML diagrams that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The highlighted code here is to be removed in order to remove redundant data from the table&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Note: Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144260</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144260"/>
		<updated>2022-04-06T04:36:12Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Comprehensive Testing and Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Add reasonings and data flow structures/UML diagrams that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The highlighted code here is to be removed in order to remove redundant data from the table&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144258</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144258"/>
		<updated>2022-04-06T04:35:52Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Thoughts on Comprehensive Testing and Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Add reasonings and data flow structures/UML diagrams that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The highlighted code here is to be removed in order to remove redundant data from the table&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144257</id>
		<title>CSC/ECE 517 Spring 2022 - E2237: Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2237:_Grading_audit_trail&amp;diff=144257"/>
		<updated>2022-04-06T04:35:18Z</updated>

		<summary type="html">&lt;p&gt;Schatte5: /* Thoughts on Comprehensive Testing and Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Topic Overview &amp;amp; Prior Work ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail E2158] contains detailed information regarding this feature. &lt;br /&gt;
'''A summary of the desired functionality is presented below:'''&lt;br /&gt;
&lt;br /&gt;
After an instructor assigns a grade to an assignment, there should be a way to track who gave the grade. Any instructor can assign/edit a grade freely; a grading audit trail must be created and the following information needs to be stored:&lt;br /&gt;
* When a grade is assigned by an instructor, there must be an indication of the InstructorID and a timestamp of the change.&lt;br /&gt;
* Comments previously provided by other instructors must be preserved.&lt;br /&gt;
*This information needs to be stored every time an instructor edits a grade/comment and clicks the save button.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
*A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').&lt;br /&gt;
&lt;br /&gt;
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.&lt;br /&gt;
&lt;br /&gt;
*A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
* \app\controllers\grades_controller.rb&lt;br /&gt;
* \app\controllers\grading_histories_controller.rb&lt;br /&gt;
* \app\controllers\review_mapping_controller.rb&lt;br /&gt;
* \app\helpers\grading_histories_helper.rb&lt;br /&gt;
* \app\models\grading_history.rb&lt;br /&gt;
* \app\models\review_grading_history.rb&lt;br /&gt;
* \app\models\submission_grading_history.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
* \app\views\grading_histories\index.html.erb&lt;br /&gt;
* \app\views\reports\_review_report.html.erb&lt;br /&gt;
* \config\routes.rb&lt;br /&gt;
* \app\views\assignments\list_submissions.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
As per E2158, - ''Functional tests'' ensuring specific method calls are made were added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
functional tests added to these files&lt;br /&gt;
: spec/controllers/grades_controller_spec.rb&lt;br /&gt;
: spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
: spec/controllers/grading_histories_controller_test.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, a ''feature test'' ensuring that correct grading history is shown in chronological order was added.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feature test handled by these two files&lt;br /&gt;
: spec/features/grade_histories_spec.rb&lt;br /&gt;
: spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever an instructor submits a new grade, or edits an existing grade, the '''grading_history_controller''' saves a new history entry to the database.&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
# Running these tests causes failures - in fact, only the Spec files for review_mapping_controller runs.&lt;br /&gt;
# As per E2158, running all tests leads to the simulation crashing&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
''There are '''three areas of focus''' for this project:''&lt;br /&gt;
=== System Crashes and Object Creation ===&lt;br /&gt;
&lt;br /&gt;
#The work done by the previous team results in the system crashing when the tests are being executed; as a result, automated unit testing does not succeed. Our goal in this regard is to ensure that the tests are successfully executed for all test cases, with the appropriate outcome and coverage reports visible to the user.&lt;br /&gt;
#Testing efforts to this point have used static, pre-created objects; this is due to issues with object creation. Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful.&lt;br /&gt;
&lt;br /&gt;
=== Changes to Grading History Table ===&lt;br /&gt;
&lt;br /&gt;
The grading history table is earmarked for certain changes:&lt;br /&gt;
# Extract Student ID from the table, and ensure that it is shown in the header.&lt;br /&gt;
# Extract Assignment ID from the table, and ensure that it is shown in the header&lt;br /&gt;
&lt;br /&gt;
=== Code and Documentation Goals ===&lt;br /&gt;
&lt;br /&gt;
Add reasonings and data flow structures/UML diagrams that detail the changes that have been made, as well as any comments on why certain files needed to be modified.&lt;br /&gt;
These will be completed from these perspectives:&lt;br /&gt;
# From a data flow point of view&lt;br /&gt;
# From a function point of view&lt;br /&gt;
# With comment in code&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the Grading History Table====&lt;br /&gt;
The highlighted code here is to be removed in order to remove redundant data from the table&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_1.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The data is to be moved to the header, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:E2237_Proj4_2.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====System Stability: Strategies====&lt;br /&gt;
''The source of this issue is currently unknown.'' Therefore, we will pursue the following to debug this:&lt;br /&gt;
# Refactoring: We will explore refactoring both the test cases and the controllers (mentioned in section 2.2) to enforce the DRY principle where needed, and comment the code to enhance readability &amp;amp; maintainability&lt;br /&gt;
# Test data: Currently, there is an existing issue with the test methodology - testing is all being done using pre-existing, static data. This will be fixed as a result of our work on Object Creation.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# A pull request of the fixed code, fully commented, will be provided in this document.&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
# Verify that Student Accounts can be created and are saved to the database.&lt;br /&gt;
# Verify that Assignments can be created and are saved to the database.&lt;br /&gt;
# Verify that Project Bids can be created and are saved to the database.&lt;br /&gt;
# Ensure that Student ID is shown in the header, and verify via manual UI testing &lt;br /&gt;
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing&lt;br /&gt;
# Finally, verify that tests can be run without crashing the system.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Account&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student account with all the necessary fields&lt;br /&gt;
   Then: Account is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Account Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts with all the necessary fields&lt;br /&gt;
   Then: Student already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Account Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create student accounts without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignments&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Assignment Creation with all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment with all the necessary fields&lt;br /&gt;
   Then: Assignment already exists message is shown&lt;br /&gt;
&lt;br /&gt;
Scenario: Assignment Creation without all fields &lt;br /&gt;
 Given: Logged in as an Instructor/Admin&lt;br /&gt;
  When: Create Assignment without all the necessary fields&lt;br /&gt;
   Then: Message to input fields is shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Project Bids&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Project Bid creation&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Complete Project Bid for open Project&lt;br /&gt;
   Then: Project Bid is saved in the database&lt;br /&gt;
&lt;br /&gt;
Scenario: Duplicate Project Bid  &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Click on bid for open Project&lt;br /&gt;
   Then Message stating already selected shown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
''Discussion with mentor in progress to determine if UI Automation testing is in scope ''&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Assignment ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Assignment ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Assignment ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''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 ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# 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)&lt;br /&gt;
# Procure specific required column width, and assert that this is the value in the file (the constant)&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Thoughts on Comprehensive Testing and Scope ===&lt;br /&gt;
* '''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. The extent of this project's responsibilities in either situation must be established for the final submission.&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]&lt;br /&gt;
&lt;br /&gt;
[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Bhuwan Bhatt (''brbhatt'')&lt;br /&gt;
*Soumyadeep Chatterjee (''schatte5'')&lt;br /&gt;
*Kelly Fleming (''kflemin3'')&lt;br /&gt;
*Karthik Gopala Sundaresan (''kgopala3'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Kai Xiao (''yxiao28'')&lt;/div&gt;</summary>
		<author><name>Schatte5</name></author>
	</entry>
</feed>