<?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=Ldu2</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=Ldu2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ldu2"/>
	<updated>2026-06-30T16:17:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail&amp;diff=142695</id>
		<title>CSC/ECE 517 Fall 2021 - E2158. Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail&amp;diff=142695"/>
		<updated>2021-12-02T21:59:11Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: /* Important Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
After an instructor gave a grade to an assignment, there is no way to track who gave the grade. Any instructor can assign/edit a grade freely. There is no way of tracking who did it.&lt;br /&gt;
&lt;br /&gt;
A grading audit trail must be created and the following information needs to be stored: &lt;br /&gt;
:1. When a grade is assigned by an instructor, there needs to be an indication of who did it and when it was done. &lt;br /&gt;
:2. Comments previously provided by other instructors must also be preserved.&lt;br /&gt;
&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;
Currently, there are two places need to add grading audit trail: &lt;br /&gt;
:1. '''Review grade''': Log in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View Review Report&lt;br /&gt;
:2. '''Submission grade''': Log in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View submissions&lt;br /&gt;
&lt;br /&gt;
The grading audit trail can probably be implemented as the submission records history on Expertiza.&lt;br /&gt;
The required page can be reached by logging in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View Submissions -&amp;gt; History&lt;br /&gt;
&lt;br /&gt;
At the minimum, a grading log entry must include the '''instructor id''', '''assignment id''', '''student id''', '''grade''', '''comment''' and '''timestamp'''.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/E1934_-_Grading_Audit_Trail Previous Wiki Page]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/yyxX_kRYxLc Screencast]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Review ===&lt;br /&gt;
&lt;br /&gt;
:1. '''Review grade''' part in the previous implementation served well, we only need to fix some UI issues in the current implementation; &lt;br /&gt;
:2. But for '''Submission grade''' part, we need to add a table in order to save submission history including the instructor id, assignment id, student id, grade, comment, and timestamp.&lt;br /&gt;
&lt;br /&gt;
=== Issues with Previous Work ===&lt;br /&gt;
:1. For review grades, the “Grading History” link must not be in a separate column. It should be in smaller text below in the “Save” button.&lt;br /&gt;
&lt;br /&gt;
:2. In the view grading record page, remove the receiver column and add it to the title.&lt;br /&gt;
&lt;br /&gt;
:3. Restrict the column width on the grading record page.&lt;br /&gt;
&lt;br /&gt;
:4. Add comments on list_submissions.html.erb to indicate that the alignment was changed to fix code climate issues.&lt;br /&gt;
&lt;br /&gt;
:5. Revert changes made to list_review_mapping.html.erb.&lt;br /&gt;
 &lt;br /&gt;
:6. Remove the review_report-html.erb file.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
=== Expected View ===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_Proposed_Solution_1.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_Proposed_Solution_2.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_Proposed_Solution_3.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== History of Comment and Grade for Reviews ===&lt;br /&gt;
&lt;br /&gt;
In this part, we will modify the current view of review page, to add the link &amp;quot;history&amp;quot; to a proper place as the expected design picture shows.&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;
==== Review History Flow====&lt;br /&gt;
[[File:reviewhistory.png]]&lt;br /&gt;
&lt;br /&gt;
=== History of Comment and Grade for Submissions===&lt;br /&gt;
&lt;br /&gt;
In Expertiza, we find the fields related to grade and comment are located in the model '''team''', which is only able to be overwritten. Since there is no table to store the history of the comment and score given by instructors and TAs, we need to do:&lt;br /&gt;
&lt;br /&gt;
:1. Review the related implementation of previous work in order to evaluate and understand the process of adding new models.&lt;br /&gt;
&lt;br /&gt;
:2. Implement the related Model, View and Controller:&lt;br /&gt;
&lt;br /&gt;
:* Model: grading_history.rb &lt;br /&gt;
&lt;br /&gt;
:* Controller:  grading_history_controller.rb&lt;br /&gt;
&lt;br /&gt;
:* View: related pages.&lt;br /&gt;
&lt;br /&gt;
Because in Expertiza the team ID will be generated for each given assignment, so the original design of grade / comment of team's submission are the field belongs to '''team'''. So our model uses the foreign key to only the team but not the related assignments or submissions.&lt;br /&gt;
&lt;br /&gt;
The expected class of grading history could be shown as:&lt;br /&gt;
&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&lt;br /&gt;
==== Team History Flow====&lt;br /&gt;
[[File:teamhistory.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Rspec Unit Tests ===&lt;br /&gt;
==== For History of the Grade of Reviews ====&lt;br /&gt;
The history of the grade and comments are related to this controller app/controllers/review_mapping_controller.rb and this view app/views/reports/_review_report.html.erb. &lt;br /&gt;
&lt;br /&gt;
So the related RSpec tests are planned to be executed:&lt;br /&gt;
&lt;br /&gt;
    spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==== For History of the Grade of Team Submissions ====&lt;br /&gt;
The history of the grade and comments are related to the new model grading_history.rb and the new controller grading_history_controller.rb.&lt;br /&gt;
&lt;br /&gt;
So the related RSpec tests are planned to be executed:&lt;br /&gt;
&lt;br /&gt;
    spec/models/grading_history.rb&lt;br /&gt;
    spec/controllers/grading_history_controller.rb&lt;br /&gt;
&lt;br /&gt;
For the feature part, test if the grading history and instructor can be shown in chronological order:&lt;br /&gt;
&lt;br /&gt;
    spec/features/grade_histories_spec.rb&lt;br /&gt;
    spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To start the test, we need to log in as instructor or TA first. These accounts should have access to the assignment. For example: we can use '''intructor6/password''' or '''teaching_assistant8631/password''';&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Grading histories of submissions ====&lt;br /&gt;
Step 1. Log in as instructor/TA -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View submissions&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_view_submisson.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Step 2. The instructor/TA can assign grades to a team by clicking 'Assign Grade' in the 'Team name' column:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_grading_history_submisson1.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Step 3. The instructor/TA can view the grading audit trail by clicking 'Grading History' in the 'History' column, here is the record page:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_grading_history_submisson2.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Scenario 2: Grading histories of reviews ====&lt;br /&gt;
Step 1. Log in as instructor/TA -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View Reports&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_view_report.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Step 2. Select 'Review Report' then click 'View', here is the Review Report page. The instructor/TA can assign grades to a review by inputing 'Grade' and 'Comment' then clicking 'Save' button:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_grading_history_report1.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Step 3. The instructor/TA can view the grading audit trail by clicking 'Grading History' as Step 2 figure shows, here is the record page:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2158_grading_history_report2.png|1100px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
#[https://github.com/duliwencynthia/expertiza/tree/beta Git Repo]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2164 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=ad4wF6--5dQ Test1]&lt;br /&gt;
#[https://youtu.be/8PWD5gNQFog Test2]&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' Xiao, Kai (yxiao28)&lt;br /&gt;
&lt;br /&gt;
Yao, Kaiyong (kyao)&lt;br /&gt;
&lt;br /&gt;
Hou, Guanyu (ghou3)&lt;br /&gt;
&lt;br /&gt;
Du, Haoze (hdu5)&lt;br /&gt;
&lt;br /&gt;
Du, Liwen (ldu2)&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail&amp;diff=141551</id>
		<title>CSC/ECE 517 Fall 2021 - E2158. Grading audit trail</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail&amp;diff=141551"/>
		<updated>2021-11-09T08:34:34Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: /* Rspec Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
After an instructor gave a grade to an assignment, there is no way to track who gave the grade. Any instructor can assign/edit a grade freely. There is no way of tracking who did it.&lt;br /&gt;
&lt;br /&gt;
A grading audit trail must be created and the following information needs to be stored: &lt;br /&gt;
:1. When a grade is assigned by an instructor, there needs to be an indication of who did it and when it was done. &lt;br /&gt;
:2. Comments previously provided by other instructors must also be preserved.&lt;br /&gt;
&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;
Currently, there are two places need to add grading audit trail: &lt;br /&gt;
:1. '''Review grade''': Log in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View Review Report&lt;br /&gt;
:2. '''Submission grade''': Log in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View submissions&lt;br /&gt;
&lt;br /&gt;
The grading audit trail can probably be implemented as the submission records history on Expertiza.&lt;br /&gt;
The required page can be reached by logging in as instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View Submissions -&amp;gt; History&lt;br /&gt;
&lt;br /&gt;
At the minimum, a grading log entry must include the '''instructor id''', '''assignment id''', '''student id''', '''grade''', '''comment''' and '''timestamp'''.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/E1934_-_Grading_Audit_Trail Previous Wiki Page]&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/yyxX_kRYxLc Screencast]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Review ===&lt;br /&gt;
&lt;br /&gt;
:1. '''Review grade''' part in the previous implementation served well, we only need to fix some UI issues in the current implementation; &lt;br /&gt;
:2. But for '''Submission grade''' part, we need to add a table in order to save submission history including the instructor id, assignment id, student id, grade, comment, and timestamp.&lt;br /&gt;
&lt;br /&gt;
=== Issues with Previous Work ===&lt;br /&gt;
:1. For review grades, the “Grading History” link must not be in a separate column. It should be in smaller text below in the “Save” button.&lt;br /&gt;
&lt;br /&gt;
:2. In the view grading record page, remove the receiver column and add it to the title.&lt;br /&gt;
&lt;br /&gt;
:3. Restrict the column width on the grading record page.&lt;br /&gt;
&lt;br /&gt;
:4. Add comments on list_submissions.html.erb to indicate that the alignment was changed to fix code climate issues.&lt;br /&gt;
&lt;br /&gt;
:5. Revert changes made to list_review_mapping.html.erb.&lt;br /&gt;
 &lt;br /&gt;
:6. Remove the review_report-html.erb file.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
=== Expected View ===&lt;br /&gt;
&lt;br /&gt;
[[File:E2158_Proposed_Solution_1.png|1100px|center]]&lt;br /&gt;
[[File:E2158_Proposed_Solution_2.png|1100px|center]]&lt;br /&gt;
[[File:E2158_Proposed_Solution_3.png|1100px|center]]&lt;br /&gt;
&lt;br /&gt;
=== History of Comment and Grade for Reviews ===&lt;br /&gt;
&lt;br /&gt;
In this part, we will modify the current view of review page, to add the link &amp;quot;history&amp;quot; to a proper place as the expected design picture shows.&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;
==== Review History Flow====&lt;br /&gt;
[[File:reviewhistory.png]]&lt;br /&gt;
&lt;br /&gt;
=== History of Comment and Grade for Submissions===&lt;br /&gt;
&lt;br /&gt;
In Expertiza, we find the fields related to grade and comment are located in the model '''team''', which is only able to be overwritten. Since there is no table to store the history of the comment and score given by instructors and TAs, we need to do:&lt;br /&gt;
&lt;br /&gt;
:1. Review the related implementation of previous work in order to evaluate and understand the process of adding new models.&lt;br /&gt;
&lt;br /&gt;
:2. Implement the related Model, View and Controller:&lt;br /&gt;
&lt;br /&gt;
:* Model: grading_history.rb &lt;br /&gt;
&lt;br /&gt;
:* Controller:  grading_history_controller.rb&lt;br /&gt;
&lt;br /&gt;
:* View: related pages.&lt;br /&gt;
&lt;br /&gt;
Because in Expertiza the team ID will be generated for each given assignment, so the original design of grade / comment of team's submission are the field belongs to '''team'''. So our model uses the foreign key to only the team but not the related assignments or submissions.&lt;br /&gt;
&lt;br /&gt;
The expected class of grading history could be shown as:&lt;br /&gt;
&lt;br /&gt;
[[File:GradingHistory.png]]&lt;br /&gt;
&lt;br /&gt;
==== Team History Flow====&lt;br /&gt;
[[File:teamhistory.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Rspec Unit Tests ===&lt;br /&gt;
==== For History of the Grade of Reviews ====&lt;br /&gt;
The history of the grade and comments are related to this controller app/controllers/review_mapping_controller.rb and this view app/views/reports/_review_report.html.erb. &lt;br /&gt;
&lt;br /&gt;
So the related RSpec tests are planned to be executed:&lt;br /&gt;
&lt;br /&gt;
    spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==== For History of the Grade of Team Submissions ====&lt;br /&gt;
The history of the grade and comments are related to the new model grading_history.rb and the new controller grading_history_controller.rb.&lt;br /&gt;
&lt;br /&gt;
So the related RSpec tests are planned to be executed:&lt;br /&gt;
&lt;br /&gt;
    spec/models/grading_history.rb&lt;br /&gt;
    spec/controllers/grading_history_controller.rb&lt;br /&gt;
&lt;br /&gt;
For the feature part, test if the grading history and instructor can be shown in chronological order:&lt;br /&gt;
&lt;br /&gt;
    spec/features/grade_histories_spec.rb&lt;br /&gt;
    spec/features/helpers/grade_histories_helper.rb&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
The new features of recording and showing the history of grades and comments of reviews and submissions will be manually tested after we finished the implementation of those functions.&lt;br /&gt;
&lt;br /&gt;
:1. An assignment and a team will be generated, and at most 3 instructors / TAs will give grades for these situations:&lt;br /&gt;
    1. 1 submission, 1 review, 1 grade and comment for submission, 1 grade and comment for review.&lt;br /&gt;
    2. 1 submission, 2 review, 2 grade and comment for submission from different graders, 2 grade and comment for review from different graders.&lt;br /&gt;
:2. An assignment and 3 teams will be generated, and at most 3 instructors / TAs will give grades for these situations:&lt;br /&gt;
    1. For each team: 1 submission, 1 review, 1 grade and comment for submission, 1 grade and comment for review.&lt;br /&gt;
    2. For each team: 1 submission, 2 review, 2 grade and comment for submission from different graders, 2 grade and comment for review from different graders.&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
We will generate some edge cases to test the robustness of our work.&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
#[https://github.com/duliwencynthia/expertiza/tree/beta Git path]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2130 Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' Xiao, Kai (yxiao28)&lt;br /&gt;
&lt;br /&gt;
Yao, Kaiyong (kyao)&lt;br /&gt;
&lt;br /&gt;
Hou, Guanyu (ghou3)&lt;br /&gt;
&lt;br /&gt;
Du, Haoze (hdu5)&lt;br /&gt;
&lt;br /&gt;
Du, Liwen (ldu2)&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139983</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139983"/>
		<updated>2021-10-25T02:17:47Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  ####&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
  ####&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
&lt;br /&gt;
  [[File:manage_page.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
&lt;br /&gt;
  [[File:edit_assignment.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
&lt;br /&gt;
  [[File:create_assignment.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
&lt;br /&gt;
  [[File:new_date.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
&lt;br /&gt;
  [[File:add_participate.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139982</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139982"/>
		<updated>2021-10-25T02:15:18Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
&lt;br /&gt;
  [[File:manage_page.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
&lt;br /&gt;
  [[File:edit_assignment.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
&lt;br /&gt;
  [[File:create_assignment.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
&lt;br /&gt;
  [[File:new_date.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
&lt;br /&gt;
  [[File:add_participate.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139981</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139981"/>
		<updated>2021-10-25T02:13:56Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
&lt;br /&gt;
  [[File:manage_page.png|hight=250px]]&lt;br /&gt;
&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
&lt;br /&gt;
  [[File:edit_assignment.png|hight=250px]]&lt;br /&gt;
&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
&lt;br /&gt;
  [[File:create_assignment.png|hight=250px]]&lt;br /&gt;
&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
&lt;br /&gt;
  [[File:new_date.png|hight=250px]]&lt;br /&gt;
&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
&lt;br /&gt;
  [[File:add_participate.png|hight=250px]]&lt;br /&gt;
&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139980</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139980"/>
		<updated>2021-10-25T02:12:01Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
&lt;br /&gt;
  [[File:manage_page.png|high=50px]]&lt;br /&gt;
&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
&lt;br /&gt;
  [[File:edit_assignment.png|high=50px]]&lt;br /&gt;
&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
&lt;br /&gt;
  [[File:create_assignment.png|high=50px]]&lt;br /&gt;
&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
&lt;br /&gt;
  [[File:new_date.png|high=50px]]&lt;br /&gt;
&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
&lt;br /&gt;
  [[File:add_participate.png|high=50px]]&lt;br /&gt;
&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139979</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139979"/>
		<updated>2021-10-25T02:11:18Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
&lt;br /&gt;
  [[File:manage_page.png|high=100px]]&lt;br /&gt;
&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
&lt;br /&gt;
  [[File:edit_assignment.png|high=100px]]&lt;br /&gt;
&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
&lt;br /&gt;
  [[File:create_assignment.png|high=100px]]&lt;br /&gt;
&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
&lt;br /&gt;
  [[File:new_date.png|high=100px]]&lt;br /&gt;
&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
&lt;br /&gt;
  [[File:add_participate.png|high=100px]]&lt;br /&gt;
&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_participate.png&amp;diff=139978</id>
		<title>File:Add participate.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_participate.png&amp;diff=139978"/>
		<updated>2021-10-25T02:11:00Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_date.png&amp;diff=139977</id>
		<title>File:New date.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_date.png&amp;diff=139977"/>
		<updated>2021-10-25T02:10:00Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_assignment.png&amp;diff=139976</id>
		<title>File:Create assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_assignment.png&amp;diff=139976"/>
		<updated>2021-10-25T02:09:02Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: Ldu2 uploaded a new version of File:Create assignment.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139975</id>
		<title>File:Edit assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139975"/>
		<updated>2021-10-25T02:06:21Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: Ldu2 uploaded a new version of File:Edit assignment.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139974</id>
		<title>File:Edit assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139974"/>
		<updated>2021-10-25T02:06:18Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: Ldu2 uploaded a new version of File:Edit assignment.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139973</id>
		<title>File:Edit assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_assignment.png&amp;diff=139973"/>
		<updated>2021-10-25T02:06:14Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: Ldu2 uploaded a new version of File:Edit assignment.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139972</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139972"/>
		<updated>2021-10-25T02:03:38Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: /* Steps to verify Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
 Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
 Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
 name/login: Email_Test_ID1&lt;br /&gt;
 password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
[[File:manage_page.png]]&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
[[File:2.png]]&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
[[File:3.png]]&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
[[File:4.png]]&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
[[File:5.png]]&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_page.png&amp;diff=139971</id>
		<title>File:Manage page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_page.png&amp;diff=139971"/>
		<updated>2021-10-25T02:02:47Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139970</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139970"/>
		<updated>2021-10-25T01:59:45Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Pre-config==&lt;br /&gt;
&lt;br /&gt;
We use delayed jobs library to deal with the delayed email. &lt;br /&gt;
We need run following command in order to install delayed_job binary executable.&lt;br /&gt;
&lt;br /&gt;
    rails generate delayed_job&lt;br /&gt;
&lt;br /&gt;
Then we need to run&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job start&lt;br /&gt;
&lt;br /&gt;
This will start a backend server to deal with the delayed jobs.&lt;br /&gt;
If we want to stop, just run following.&lt;br /&gt;
&lt;br /&gt;
    RAILS_ENV=development bin/delayed_job stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review). &lt;br /&gt;
&lt;br /&gt;
'''2) Implement code:''' &lt;br /&gt;
&lt;br /&gt;
    # TODO E2135. Email notification to reviewers and instructors&lt;br /&gt;
  def create_mailer_object&lt;br /&gt;
    Mailer.new&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create_mailworker_object&lt;br /&gt;
    MailWorker.new(self.parent_id, self.deadline_type, self.due_at)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # main function to start email reminder&lt;br /&gt;
  def start_reminder&lt;br /&gt;
    puts when_to_run_reminder&lt;br /&gt;
    if self.changed?&lt;br /&gt;
      @extra_param = self.parent_id.to_s + &amp;quot;,&amp;quot; + self.deadline_type_id.to_s&lt;br /&gt;
      # first deleted existed delayed jobs with same parent_id(which is assignment id actually)&lt;br /&gt;
      Delayed::Job.where(extra_param: @extra_param).each do |job|&lt;br /&gt;
        job.delete&lt;br /&gt;
      end&lt;br /&gt;
      # add a delayed job to the delayed job queue, the job will run at what when_to_run_reminder return&lt;br /&gt;
      run_at_time = when_to_run_reminder&lt;br /&gt;
      if run_at_time &amp;gt;= 0.seconds.from_now&lt;br /&gt;
        self.delay(run_at: run_at_time, :extra_param =&amp;gt; @extra_param).reminder&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reminder&lt;br /&gt;
    deadline_text = self.deadline_type if %w[submission review].include? self.deadline_type&lt;br /&gt;
    deadline_text = &amp;quot;Team Review&amp;quot; if self.deadline_type == 'metareview'&lt;br /&gt;
    mail_worker = create_mailworker_object&lt;br /&gt;
    email_reminder(mail_worker.find_participant_emails, deadline_text) unless mail_worker.find_participant_emails.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def email_reminder(emails, deadline_type)&lt;br /&gt;
    assignment = Assignment.find(self.parent_id)&lt;br /&gt;
    subject = &amp;quot;Message regarding #{deadline_type} for assignment #{assignment.name}&amp;quot;&lt;br /&gt;
    body = &amp;quot;This is a reminder to complete #{deadline_type} for assignment #{assignment.name}. \&lt;br /&gt;
    Deadline is #{self.due_at}.If you have already done the  #{deadline_type}, Please ignore this mail.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    emails.each do |mail|&lt;br /&gt;
      Rails.logger.info mail&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    Mailer.delayed_message(bcc: emails, subject: subject, body: body).deliver_now&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # after duedate - threshold hours, then we can send the reminder email&lt;br /&gt;
  def when_to_run_reminder&lt;br /&gt;
    hours_before_deadline = self.threshold.hours&lt;br /&gt;
    result = (self.due_at.in_time_zone - hours_before_deadline).to_dateti&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated Testing using RSPEC==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Steps to verify Functionality==&lt;br /&gt;
&lt;br /&gt;
*Test Email&lt;br /&gt;
Email: [expertiza_test123@outlook.com](mailto:expertiza_test123@outlook.com)&lt;br /&gt;
Password: password98@&lt;br /&gt;
&lt;br /&gt;
*Test Expertiza account&lt;br /&gt;
name/login: Email_Test_ID1&lt;br /&gt;
password: password98@&lt;br /&gt;
&lt;br /&gt;
1. Change the existing assignment's due date&lt;br /&gt;
First login in as instructor6, and go to Manage → Assignments&lt;br /&gt;
[[File:1.png]]&lt;br /&gt;
Then click change edit in the right side menu under **Actions**.&lt;br /&gt;
Go to Due dates and change the **reminder** and **Due &amp;amp; Time**, and click save.&lt;br /&gt;
[[File:2.png]]&lt;br /&gt;
Then you should receive email at expertiza_test123@outlook.com in the appropriate time. For this example,16 hours before 2021/10/25 04:08 (US Eastern time zone), the system shall send a reminder email to expertiza_test123@outlook.com.&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment with valid due date&lt;br /&gt;
Create a new Assignment&lt;br /&gt;
[[File:3.png]]&lt;br /&gt;
Assign a valid due date and reminder hours&lt;br /&gt;
[[File:4.png]]&lt;br /&gt;
Then add the previous user login to it as a participant&lt;br /&gt;
[[File:5.png]]&lt;br /&gt;
Because the participants was added later, so we need to change the due date once more in order to trigger the email notification jobs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139561</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139561"/>
		<updated>2021-10-20T22:34:55Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: https://github.com/CuiJinku/expertiza/tree/beta&lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139560</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139560"/>
		<updated>2021-10-20T22:28:23Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139556</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139556"/>
		<updated>2021-10-20T22:23:53Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the    approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment: http://152.7.98.122:8080/  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[ Expertiza on GitHub]&lt;br /&gt;
#[ GitHub Project Repository Fork]&lt;br /&gt;
#[ The live Expertiza website]&lt;br /&gt;
#[ Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment:  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139479</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139479"/>
		<updated>2021-10-20T19:35:42Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the    approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment:  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[ Expertiza on GitHub]&lt;br /&gt;
#[ GitHub Project Repository Fork]&lt;br /&gt;
#[ The live Expertiza website]&lt;br /&gt;
#[ Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment:  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/CuiJinku/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139476</id>
		<title>CSC/ECE 517 Fall 2021 - E2135 Email notification to reviewers and instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2135_Email_notification_to_reviewers_and_instructors&amp;diff=139476"/>
		<updated>2021-10-20T19:29:26Z</updated>

		<summary type="html">&lt;p&gt;Ldu2: Created page with &amp;quot;This page provides a description of the Expertiza based OSS project. __TOC__  ==About Expertiza==  [http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed u...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the    approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment:  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[ Expertiza on GitHub]&lt;br /&gt;
#[ GitHub Project Repository Fork]&lt;br /&gt;
#[ The live Expertiza website]&lt;br /&gt;
#[ Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project developed using the Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)[1]. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When an assignment or review approaches its deadline on Expertiza, students initially should receive deadline reminder emails at a specific time before the deadline that the instructor has preconfigured. Lack of this functionality sometimes results in students missing their assignment submission deadlines and thus losing marks. Students should receive this type of deadline reminder email. So this amendment to the project involves adding an asynchronous deadline reminder mailer to the application. &lt;br /&gt;
&lt;br /&gt;
==Modified Files==&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* test/models/due_date.rb&lt;br /&gt;
* db/migrate/20210319212323_create_delayed_jobs.rb&lt;br /&gt;
&lt;br /&gt;
==Implementation approach==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1) Reminder email sent when assignment or review is approaching deadline:'''&lt;br /&gt;
In the due_date.rb file, whenever a new due date is created or an existing due date is updated, the 'start_reminder' method will be fired which will eventually be added to the delayed_job queue. This job will be executed at a preconfigured time before deadline, where it will fire the method 'reminder' which will be added to the delayed job queue by the handle_asynchronously method of gem 'delayed_job_active_record'. Inside the reminder method, we will fetch three attributes - assignment_id, deadline_type, due_at. These three attributes will be used to decide the deadline type ( submission or review or teammate review ), fetch the participant email for that assignment, fetch the deadline threshold and at the end send the email reminder at a specified threshold time before the deadline which will contain all the details such as assignment names link to assignment and assignment type ( submission or review or teammate review).   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the mail is enqueued upon the firing of the reminder method.&lt;br /&gt;
&lt;br /&gt;
We have used Rspec for testing the delayed_job functionalities. Using the test-driven development (TDD) approach, we have added a Rspec test which checks whether the call for reminder method is enqueued upon the firing of the start_reminder method, with the proper scheduled execution time.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
NOTE: All the reminder mails except the ones for the reviewer are sent to expertiza.development@gmail.com ,as this is already set in the development environment.&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
&lt;br /&gt;
*Git pull link: &lt;br /&gt;
*VCL deployment:  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harshkachhadia/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
[mailto:dli35@ncsu.edu Dong Li]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:ldu2@ncsu.edu Liwen Du]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:jcui23@ncsu.edu Jinku Cui]&lt;/div&gt;</summary>
		<author><name>Ldu2</name></author>
	</entry>
</feed>