CSC/ECE 517 Spring 2022 - E2237: Grading audit trail: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
(173 intermediate revisions by 3 users not shown)
Line 1: Line 1:


== Team ==
== Topic Overview & Prior Work (E2158) ==
=== Students ===
=== Feature Overview ===
*Bhuwan Bhatt (''brbhatt'')
 
*Soumyadeep Chatterjee (''schatte5'')
[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.
*Kelly Fleming (''kflemin3'')
 
*Karthik Gopala Sundaresan (''kgopala3'')
'''A summary of the desired functionality is presented below:'''
 
Any instructor can assign or edit a grade freely.


=== Mentor ===
There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.
*Kai Xiao (''yxiao28'')


== Topic Overview ==
These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:
* id of the instructor
* timestamp
Additionally, any comments written by other instructors should be preserved.


=== Prior Work ===
=== Overview of Major Changes By Previous Team ===


You can read the entirety of the [[E1934 - Grading Audit Trail|previous team's wiki write-up]] if desired.
*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.


==== Overview of Major Changes ====
*Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.


A new table was added to the database ('''grading_history'''), along with the corresponding model ('''grading_history.rb''') and controller ('''grading_history_controller.rb''').
*A view for displaying the grading history of a particular assignment or review was added ('''grading_histories/index.html.erb''').


Two models for specific types of histories were added: '''review_grading_history.rb''', and '''submission_grading_history.rb'''.
=== Files Modified By Previous Team ===
* \app\controllers\grades_controller.rb
* \app\controllers\grading_histories_controller.rb
* \app\controllers\review_mapping_controller.rb
* \app\helpers\grading_histories_helper.rb
* \app\models\grading_history.rb
* \app\models\review_grading_history.rb
* \app\models\submission_grading_history.rb
* \app\views\assignments\list_submissions.html.erb
* \app\views\grading_histories\index.html.erb
* \app\views\reports\_review_report.html.erb
* \config\routes.rb
* \app\views\assignments\list_submissions.html.erb


A view for displaying the grading history of a particular assignment or review was added ('''index_html.erb''').
=== Testing By Previous Team ===


==== Modifications to Existing Files ====
''Functional tests'' were added.
<pre>
functional tests added to these files
: spec/controllers/review_mapping_controller_spec.rb
: spec/models/grading_history.rb
: spec/controllers/grading_history_controller.rb
</pre>
A ''feature test'' ensuring that a submission's grading history is shown completely, and in chronological order, was added.
<pre>
feature test handled by these two files
: spec/features/grade_histories_spec.rb
: spec/features/helpers/grade_histories_helper.rb
</pre>
==== Issues with Existing Tests ====
Only review_mapping_controller_spec.rb runs successfully--'''every other spec file mentioned above crashes'''.


;app/controllers/grades_controller.rb
== Problem Statement ==
: A grading history record is created for every edit to a submission's grade.
;app/controllers/review_mapping_controller.rb
: A grading history record is created for every edit to a review's grade.
;app/views/assignments/list_submissions.html.erb
: A link to access a submission's grade history is shown in the submissions table.
;app/views/reports/_review_report.html.erb
: A link to access a review's grade history is shown in the review report table.


==== Testing (NOTE: should probably remove this from here) ====
''There are '''three areas of focus''' for our team's project (E2237):''
=== System Crashes and Object Creation ===


''Functional tests'' ensuring specific method calls are made were added.
# We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.
# We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.


;functional tests added to these files
=== Changes to Grading History View ===
: spec/controllers/grades_controller_spec.rb
: spec/controllers/review_mapping_controller_spec.rb
: spec/controllers/grading_histories_controller_test.rb


A ''feature test'' ensuring that correct grading history is shown in chronological order was added.
The grading history table in the view is earmarked for certain changes:
# '''Student ID''' is a redundant field--move it to the page header.
# '''Assignment ID''' is a redundant field--move it to the page header.


;feature test handled by these two files
=== Code and Documentation Goals ===
: spec/features/grade_histories_spec.rb
: spec/features/helpers/grade_histories_helper.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.
We must explain changes made to files with diagrams and justifications.


== Statement of Problem ==
Explanations will be provided from these perspectives:
* data flow
* functions
* code comments


''There are three areas of focus for this project:''
==Data Flow and Functionality==
===Old Data Flow===
The existing ''data flow'' for the grading history feature for reviews is shown below:


=== System Crashes and Object Creation ===
<span style="position:relative;left:0px;top:0px">[[File:Reviewhistory.jpg|270px]]</span>
<span style="position:relative;left:125px;top:0px">[[File:Review scores imported.png|560px]] </span>


First, 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.
The related ''table'' from the database is [https://expertiza.csc.ncsu.edu/index.php/Review_scores review_scores].
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.


Second, testing efforts to this point have used static, pre-created objects; this is due to issues with object creation.
===New Data Flow===
Our goal in this aspect is to ensure that the creation of new test objects, namely Student Accounts, Assignments, and Project Bids is successful. 


=== Changes to Grading History Table ===
The latest ''flow'' for the Grading History functionality is shown below:


The grading history table is earmarked for certain changes:
[[File:kai_diagram1.jpg|345px]]
<br>a. Extract Student ID from the table, and ensure that it is shown in the header
<br>b. Extract Assignment ID from the table, and ensure that it is shown in the header


=== Code and Documentation Goals ===
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


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.
[[File:Kai_new_flow 3.jpg|650px]]
These will be completed from these perspectives:
<br>a. From a data flow point of view
<br>b. From a function point of view
<br>c. With comment in code


== Plan and List of Work Done ==
== Planned and Completed Work ==


=== General Design Goals ===
=== General Design Goals ===
=== Specific Tasks Completed ===
====Changes to the Grading History Table====
 
The images below reference grading history view issues mentioned above in the ''Problem Statement''.
 
To DRY the code, we will remove the redundant table data boxed below...
 
[[File:E2237_Proj4_1.png]]
 
<br> ...and we'll move it to the page header:
 
[[File:E2237_Proj4_2.png]]
 
<br>
 
'''Behavior Driven Development'''<br>
[[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail#RSpec Unit Tests|BDD Scenarios]]<br>
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.<br>
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.
 
====System Stability: Strategies====
''The source of crashing issues is currently unknown.'' To debug this, we will pursue the following:
* Refactor the specs and controllers
** Ensure DRY principle is followed
** Improve readability and maintainability
** Add code comments as needed
* Ensure testing objects do not cause crashes
 
====Documentation====
# Changes to any files will be documented on this page; the programmatical reasoning behind the changes shall be explained, and will be in accordance with the DRY principle.
# Any changes to the overall program logic and data flow will be illustrated with UML diagrams in this document, along with the reasoning for any such changes.
# A pull request of the fixed code, fully commented, will be provided in this document.
 
== Implementation ==
 
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.
 
*/app/views/grading_histories/index.html.erb
<pre>
<% record = @grading_histories[0]
  if record == nil
    receiver = ""
    assignment = ""
  else
    if record.grading_type == "Submission"
      receiver = "of " + Team.where(id: record.grade_receiver_id).pluck(:name).first
      assignment = "for the submission " + Assignment.where(id: record.assignment_id).pluck(:name).first
    else
      receiver = "of " + User.where(id: record.grade_receiver_id).pluck(:fullname).first
      assignment = "for review in " + Assignment.where(id: record.assignment_id).pluck(:name).first
    end
 
  end
%>
<h1 class="center">Grade History <%= receiver %> <%= assignment %></h1>
 
<table style="border-collapse:collapse; table-layout:fixed; width:1500px;">
  <thead>
  <tr>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Instructor</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Grade</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Comment</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Graded At</th>
  </tr>
 
  <!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. -->
  <tbody>
  <% @grading_histories.each do |record| %>
    <tr>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= User.where(id: record.instructor_id).pluck(:fullname).first %></td>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= record.grade %></td>
      <td style="padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;"><%= record.comment %></td>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= record.created_at %></td>
    </tr>
  <% end %>
  </tbody>
</table>
</pre>


== Initial Implementation ==
*Screenshot of the Grading History Table


== Final Implementation ==
[[File:Submission_Grading_History_Table.jpeg|1000px]]


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.
We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.


== Testing ==
== Testing ==
=== Video Demonstration ===
=== Video Demonstration ===
''will be added for the final submission''
 
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]<br>
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]
 
=== Testing Goals and Test Objects ===
=== Testing Goals and Test Objects ===


''Drawing from the project objectives:''
''Drawing from the project objectives:''
1. Verify that Student Accounts can be created and are saved to the database.
# Verify that Assignments can be created and are saved to the database.
2. Verify that Assignments can be created and are saved to the database.
# Ensure that Student ID is shown in the header, and verify via manual UI testing  
3. Verify that Project Bids can be created and are saved to the database.
# Ensure that Assignment ID is shown in the header, and verify via manual UI testing
4. Ensure that Student ID is shown in the header via RSpec, and verify via manual UI testing  
# Finally, verify that tests can be run without crashing the system.
5. Ensure that Assignment ID is shown in the header via RSpec, and verify via manual UI testing  


=== General Testing Plan ===
=== RSpec Unit Tests ===
=== RSpec Unit Tests ===
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''
*Factory
<pre>
#Used for Grading Histories Controller Spec
factory :grading_history, class: GradingHistory do
    id 1
    instructor_id 6
    assignment_id 1
    grading_type 'Submission'
    grade_receiver_id 1
    grade 100
    comment 'Good work!'
end
</pre>
*Assignments
<pre>
Scenario: Assignment Creation with all fields
Given: Logged in as an Instructor/Admin
  When: Create Assignment with all the necessary fields
  Then: Assignment is saved in the database
Scenario: Duplicate Assignment Creation with all fields
Given: Logged in as an Instructor/Admin
  When: Create Assignment with all the necessary fields
  Then: Assignment already exists message is shown
Scenario: Assignment Creation without all fields
Given: Logged in as an Instructor/Admin
  When: Create Assignment without all the necessary fields
  Then: Message to input fields is shown
</pre>
*Grading Histories
<pre>
Scenario: Grading History creation
Given: A team exists for a particular assignment and has a submission
When: An instructor assigns a grade for that submission
Then: The grading history entry is created
</pre>
*Review Mapping
<pre>
Scenario: Save Reviewer Grade and Comment
Given: A student has given a review for a submission
When: An instructor assigns a grade for the review
Then: The assigned grade and the accompanying comment are saved
</pre>
*Grade
<pre>
Scenario: Save Grade and Comment for Submission
Given: A team has made a submission for an assignment
When: An instructor assigns a grade for the submission
Then: The assigned grade and the accompanying comment are saved
</pre>
=== Manual UI Tests ===
=== Manual UI Tests ===
''Discussion with mentor in progress to determine if UI Automation testing is in scope ''
*Student ID in header
<pre>
Scenario: Student ID/Team ID (Receiver_ID) in grading history view
Logged in as an Instructor/Admin
  On Assignment page, click on Grading History
  Resulting Grading History Table is shown
    Receiver ID appears in the header, not in any table columns
</pre>
 
*Assignment Name in header
<pre>
Scenario: Assignment Name in grading history view
Logged in as an Instructor/Admin
  On Assignment page, click on Grading History
  Resulting Grading History Table is shown
    Assignment Name appears in the header, not in any table columns
</pre>
 
*Color change after Grade is assigned to a submission
<pre>
Scenario: Team_ID Color changes from blue to brown when grade is assigned 
Logged in as an Instructor of Course/Admin or TA assigned to Course
  On Assignment page, click on Etc->View Submissions
  All submissions for assignment are shown
    Team name is blue, and grade is not assigned
    Click on "Assign Grade" under team name
      Instructor/TA assigns grade, save successfully
      Back to submissions list, team name is now brown
</pre>
 
=== Regression Testing ===
=== Regression Testing ===
'''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project was done.'''
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''
''old test cases still pass.''


''Note to team: need to edit this after investigation''
# Get the specific format requirement for the title, and assert that it's there. Ensure that this doesn't appear anywhere else (possible via ensuring count is 1)
# Procure specific required column width, and assert that this is the value in the file (the constant)


<br>1. Investigate if this is testable using Capybara
== Conclusions and Future Work ==
<br>2. 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)
=== Comprehensive Testing and Scope ===
<br>3. Procure specific required column width, and assert that this is the value in the file (the constant)
* '''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.
<br>4. Inquire with mentor about comment requirement and conflicts
* '''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.
<br>5. Inquire with mentor regarding white space constraints
<br>6. Inquire why the revert is needed, what is breaking and why
<br>7. Ask mentor where this file is being called, and if functionality needs to be moved elsewhere.
<br>8. Complete Design Document to reflect these changes.


== Conclusions and Future Work ==
=== Thoughts on Comprehensive Testing and Scope ===
=== Test Plan Document (SoP) ===
=== Conclusion ===
=== Conclusion ===
* '''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.
* '''Appearance:''' The requested layout of the Grading History table, with the student/teamID & 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.
* '''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.
* '''Future Work:''' More testing is required - with so many, more time & work is needed to add tests that ensure comprehensive coverage.


== Useful Links ==
== Useful Links ==
[https://github.com/expertiza/expertiza/pull/1441 Previous team's Expertiza GitHub pull request]
[https://github.com/expertiza/expertiza/pull/2164 Previous team's Expertiza GitHub pull request]


[[E1934 - Grading Audit Trail|Previous team's wiki write-up]]
[[CSC/ECE 517 Fall 2021 - E2158. Grading audit trail|Previous team's wiki write-up]]


[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]
[https://www.youtube.com/watch?v=yyxX_kRYxLc E1934 implementation video walkthrough]
[https://youtu.be/ItrCCEY1jR8 Live Demo: Functionality]
[https://youtu.be/9x59twFwwC0 RSpec Test Demo]
[https://www.youtube.com/watch?v=YmXsANRlB5Q Updated RSpec Demo]
[https://github.com/expertiza/expertiza/pull/2407 Pull Request]
== Contributors ==
=== Students ===
*Bhuwan Bhatt (''brbhatt'')
*Soumyadeep Chatterjee (''schatte5'')
*Kelly Fleming (''kflemin3'')
*Karthik Gopala Sundaresan (''kgopala3'')
=== Mentor ===
*Kai Xiao (''yxiao28'')

Latest revision as of 02:42, 1 May 2022

Topic Overview & Prior Work (E2158)

Feature Overview

E2158 contains detailed information on the previous team's work with this feature.

A summary of the desired functionality is presented below:

Any instructor can assign or edit a grade freely.

There should be a way to track which instructor assigned or edited a grade, along with any comments they wrote justifying that grade.

These things must be recorded in the grading audit trail any time an instructor assigns or edits a grade and its comments:

  • id of the instructor
  • timestamp

Additionally, any comments written by other instructors should be preserved.

Overview of Major Changes By Previous Team

  • A new table was added to the database (grading_history), along with the corresponding model (grading_history.rb) and controller (grading_history_controller.rb).
    • Whenever an instructor submits a new grade, or edits an existing grade, the grading_history_controller saves a new history entry to the database.
  • Two models for specific types of histories were added: review_grading_history.rb, and submission_grading_history.rb.
  • A view for displaying the grading history of a particular assignment or review was added (grading_histories/index.html.erb).

Files Modified By Previous Team

  • \app\controllers\grades_controller.rb
  • \app\controllers\grading_histories_controller.rb
  • \app\controllers\review_mapping_controller.rb
  • \app\helpers\grading_histories_helper.rb
  • \app\models\grading_history.rb
  • \app\models\review_grading_history.rb
  • \app\models\submission_grading_history.rb
  • \app\views\assignments\list_submissions.html.erb
  • \app\views\grading_histories\index.html.erb
  • \app\views\reports\_review_report.html.erb
  • \config\routes.rb
  • \app\views\assignments\list_submissions.html.erb

Testing By Previous Team

Functional tests were added.

functional tests added to these files
: spec/controllers/review_mapping_controller_spec.rb
: spec/models/grading_history.rb
: spec/controllers/grading_history_controller.rb

A feature test ensuring that a submission's grading history is shown completely, and in chronological order, was added.

feature test handled by these two files
: spec/features/grade_histories_spec.rb
: spec/features/helpers/grade_histories_helper.rb

Issues with Existing Tests

Only review_mapping_controller_spec.rb runs successfully--every other spec file mentioned above crashes.

Problem Statement

There are three areas of focus for our team's project (E2237):

System Crashes and Object Creation

  1. We must ensure that the unit tests no longer crash, and that they pass with appropriate coverage.
  2. We must ensure that the creation of testing objects, namely, Assignments, and Project Bids, does not cause crashing.

Changes to Grading History View

The grading history table in the view is earmarked for certain changes:

  1. Student ID is a redundant field--move it to the page header.
  2. Assignment ID is a redundant field--move it to the page header.

Code and Documentation Goals

We must explain changes made to files with diagrams and justifications.

Explanations will be provided from these perspectives:

  • data flow
  • functions
  • code comments

Data Flow and Functionality

Old Data Flow

The existing data flow for the grading history feature for reviews is shown below:

The related table from the database is review_scores.

New Data Flow

The latest flow for the Grading History functionality is shown below:

The primary function of this change is to DRY out the current implementation. The flow shown below tracks the tables where grades and comments(that comprise grading history) are recorded into already existing tables. The newly created table grading_history is linked to the teams table from which comments and grades are drawn. This table then displays these values, thereby completing the functionality when the user clicks on display history. The grading_history table contains the team id and instructor_name

Planned and Completed Work

General Design Goals

Changes to the Grading History Table

The images below reference grading history view issues mentioned above in the Problem Statement.

To DRY the code, we will remove the redundant table data boxed below...


...and we'll move it to the page header:


Behavior Driven Development
BDD Scenarios
Due to the nature of the functionalities that we will be implementing, we will be following a BDD methodology - Our primary intention with this is to focus our refactoring, development and database design efforts to ensure that end-user functionality is implemented fully.
In order to demonstrate this, we have provided our tests ahead of time and will be using them to guide our development efforts.

System Stability: Strategies

The source of crashing issues is currently unknown. To debug this, we will pursue the following:

  • Refactor the specs and controllers
    • Ensure DRY principle is followed
    • Improve readability and maintainability
    • Add code comments as needed
  • Ensure testing objects do not cause crashes

Documentation

  1. 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.
  2. 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.
  3. A pull request of the fixed code, fully commented, will be provided in this document.

Implementation

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.

  • /app/views/grading_histories/index.html.erb
<% record = @grading_histories[0]
  if record == nil
    receiver = ""
    assignment = ""
  else
    if record.grading_type == "Submission"
      receiver = "of " + Team.where(id: record.grade_receiver_id).pluck(:name).first
      assignment = "for the submission " + Assignment.where(id: record.assignment_id).pluck(:name).first
    else
      receiver = "of " + User.where(id: record.grade_receiver_id).pluck(:fullname).first
      assignment = "for review in " + Assignment.where(id: record.assignment_id).pluck(:name).first
    end

  end
%>
<h1 class="center">Grade History <%= receiver %> <%= assignment %></h1>

<table style="border-collapse:collapse; table-layout:fixed; width:1500px;">
  <thead>
  <tr>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Instructor</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Grade</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Comment</th>
    <th style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;">Graded At</th>
  </tr>

  <!--This is the main view of the table. This will add table with either hyperlink or the content nased on the operation. -->
  <tbody>
  <% @grading_histories.each do |record| %>
    <tr>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= User.where(id: record.instructor_id).pluck(:fullname).first %></td>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= record.grade %></td>
      <td style="padding:10px; border:solid 1.5px black; width:60px; word-wrap:break-word;"><%= record.comment %></td>
      <td style="padding:10px; border:solid 1.5px black; width:50px; word-wrap:break-word;"><%= record.created_at %></td>
    </tr>
  <% end %>
  </tbody>
</table>
  • Screenshot of the Grading History Table

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. We have created a factory for testing grading histories controller and included tests for grading_histories_controller, grades_controller and review_mapping_controller.

Testing

Video Demonstration

Live Demo: Functionality
RSpec Test Demo

Testing Goals and Test Objects

Drawing from the project objectives:

  1. Verify that Assignments can be created and are saved to the database.
  2. Ensure that Student ID is shown in the header, and verify via manual UI testing
  3. Ensure that Assignment ID is shown in the header, and verify via manual UI testing
  4. Finally, verify that tests can be run without crashing the system.

RSpec Unit Tests

Test cases provided here, will add RSpec code blocks for the final submission

  • Factory
#Used for Grading Histories Controller Spec
factory :grading_history, class: GradingHistory do
    id 1
    instructor_id 6
    assignment_id 1
    grading_type 'Submission'
    grade_receiver_id 1
    grade 100
    comment 'Good work!'
end
  • Assignments
Scenario: Assignment Creation with all fields 
 Given: Logged in as an Instructor/Admin
  When: Create Assignment with all the necessary fields
   Then: Assignment is saved in the database

Scenario: Duplicate Assignment Creation with all fields 
 Given: Logged in as an Instructor/Admin
  When: Create Assignment with all the necessary fields
   Then: Assignment already exists message is shown

Scenario: Assignment Creation without all fields 
 Given: Logged in as an Instructor/Admin
  When: Create Assignment without all the necessary fields
   Then: Message to input fields is shown
  • Grading Histories
Scenario: Grading History creation
Given: A team exists for a particular assignment and has a submission
When: An instructor assigns a grade for that submission
Then: The grading history entry is created
  • Review Mapping
Scenario: Save Reviewer Grade and Comment
Given: A student has given a review for a submission
When: An instructor assigns a grade for the review
Then: The assigned grade and the accompanying comment are saved
  • Grade
Scenario: Save Grade and Comment for Submission
Given: A team has made a submission for an assignment
When: An instructor assigns a grade for the submission
Then: The assigned grade and the accompanying comment are saved

Manual UI Tests

  • Student ID in header
Scenario: Student ID/Team ID (Receiver_ID) in grading history view 
Logged in as an Instructor/Admin
  On Assignment page, click on Grading History
   Resulting Grading History Table is shown
    Receiver ID appears in the header, not in any table columns
  • Assignment Name in header
Scenario: Assignment Name in grading history view 
Logged in as an Instructor/Admin
  On Assignment page, click on Grading History
   Resulting Grading History Table is shown
    Assignment Name appears in the header, not in any table columns
  • Color change after Grade is assigned to a submission
Scenario: Team_ID Color changes from blue to brown when grade is assigned  
Logged in as an Instructor of Course/Admin or TA assigned to Course
  On Assignment page, click on Etc->View Submissions
   All submissions for assignment are shown
    Team name is blue, and grade is not assigned
     Click on "Assign Grade" under team name
      Instructor/TA assigns grade, save successfully
       Back to submissions list, team name is now brown

Regression Testing

In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that old test cases still pass.

  1. 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)
  2. Procure specific required column width, and assert that this is the value in the file (the constant)

Conclusions and Future Work

Comprehensive Testing and Scope

  • Initial Thoughts: Current code coverage cannot be determined due to a combination of missing tests and simulation crashes. This will need to be fixed to enable monitoring of regular metrics, and adding comprehensive tests that target full code coverage.
  • 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.

Conclusion

  • 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.
  • Appearance: The requested layout of the Grading History table, with the student/teamID & 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.
  • 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.
  • Future Work: More testing is required - with so many, more time & work is needed to add tests that ensure comprehensive coverage.

Useful Links

Previous team's Expertiza GitHub pull request

Previous team's wiki write-up

E1934 implementation video walkthrough

Live Demo: Functionality

RSpec Test Demo

Updated RSpec Demo

Pull Request

Contributors

Students

  • Bhuwan Bhatt (brbhatt)
  • Soumyadeep Chatterjee (schatte5)
  • Kelly Fleming (kflemin3)
  • Karthik Gopala Sundaresan (kgopala3)

Mentor

  • Kai Xiao (yxiao28)