E1831 OSS Project Teal Email Notifications Enhancements: Difference between revisions

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


== Files modified under in this project ==
== Files modified under in this project ==
==== Controllers ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-f186adbcad8c7d0322f09c6448128d3d profile_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-f186adbcad8c7d0322f09c6448128d3d profile_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4e05ad0d64e6100656b63ad1e78f32c5 users_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4e05ad0d64e6100656b63ad1e78f32c5 users_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-3f9708b6695fc195f497d7279229ce58 suggestions_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-3f9708b6695fc195f497d7279229ce58 suggestions_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4d4587f69e7597b0876f8bd8620e4b3a invitations_controller.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4d4587f69e7597b0876f8bd8620e4b3a invitations_controller.rb]
==== Views ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-618b778ac502cdb33996e09307ea10f5 _invitation_accepted_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-618b778ac502cdb33996e09307ea10f5 _invitation_accepted_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4cf05cb698ae8bf7d018d98d32ac91ef _invitation_declined_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4cf05cb698ae8bf7d018d98d32ac91ef _invitation_declined_html.html.erb]
*
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-b469a046eb2ce24c8bcebe67e6213ce9 _invitation_pending_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-95a9a005ee228f1bdfa926dd7d2e6ed6 new_suggested_topic.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-a847769ab4f73b3b644c52acd4aa6430 notify_grade_conflict_message.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-589c871157f8b5486be75d6846db3861 _new_submission_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-806051e10c2e890dccd7687300dfddf9 _submission_deadline_test_html.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-7ce11a3f8a2df2ad7295382fdd8f7909 _additional_links.html.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-7725211746ade7c4353148f9f91c9170 add.js.erb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-799a00b67bb0213bee389b71adaf4c7c _prefs.html.erb]
==== Mailers ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-6338cac8af5d0dac3dd6cf3183d97ce1 mailer_helper.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-9d59b3dd49f673876917117e94433d4e delayed_mailer.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-5354a099931d64748967998ea42d1fc1 mailer.rb]
==== Models ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-f2caf2e29f94ec94cb27bdb86ec85d40 response.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4676c008b11a5480d73d4a6de01e45b9 user.rb]
==== Database Migrations ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-9c48d33153eb16cc236ebf7318e77121 _add_copy_of_all_emails_flag_to_user.rb]
==== Specs ====
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-3a17ddf9d828caa60f11423f20fb88a9 factories.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-da946a02c81d553b070e087bcfb8051b login_helper.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-4d891af414d69728e3576d12df5cfe45 due_date_spec.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-0681f27c5662f797060be86cd862dd1f participant_spec.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-12b107c16792b9ecba685e51b51826f1 user_spec.rb]
* [https://github.com/expertiza/expertiza/pull/1237/files#diff-ac62140c4e9c597ea8ac6d51d7f486c0 suggestion_controller_spec.rb]
* [https://github.com/kmprashanthi/expertiza/commit/9e9e4952260331dd5c9a07d1d44ed7418c91738d#diff-fe09a6e6ff9dad4c003f22ff6a48a739 invitations_controller_spec.rb]
 
== Test Plan ==
 
==== Sending mail to Instructor on creation of a new suggestion ====
 
On creation of a new suggestion, a mail should be sent to the instructor. To establish this, we test whether the create suggestion method calls a mail_instructor method. Once the mail_instructor method is called, we test the mail_instructor method to have called the mailer with the correct parameters.
<br>
[[File:Suggestion_controller_spec.jpg]]<br/>
 
==== Option for instructor to receive copy of all emails ====
1. Create a new account as an instructor on the deployment.<br/>
2. Log in as instructor.<br/>
3. Got to profile page.<br/>
4. Check the box that says 'Send me copies of all the emails'.<br/>
5. Log in as 'student2064' with password 'password'.<br/>
6. Trigger any action that may result in mail being sent to the student.<br/>
7. Log in to instructor's email to check if copy of the same email has been received.<br/>
 
==== Sending  email to student upon an invitation to a team and his response back ====
 
Send an email invite to the invitee when a student sends him/her a request. When the invitee accpets/declines the request of the student, the inviter should get a response email based on the invitee's decision.
<br>
[[File:invitations_controller_spec1.png]]
<br/>
<br/>
<br/>
[[File:invitations_controller_spec2.png]]
<br/>
 
==== Peer review steps for reviewing steps for team invitation ====
1. Login as a student and send an invitation to an invitee.<br/>
2. The invitee should get an mail on your invitation.<br/>
3. Login as the invitee and accept/decline the invitation.<br/>
4. The inviter should get a mail on the response.<br/>
 
== Solutions Implemented ==
 
==== Sending mail to Instructor on creation of a new suggestion ====
 
As part of the email that is to be sent to the instructor, an important piece of information is the proposer. When a suggestion is made by a student, they can choose to make the suggestion in anonymous mode. The function set_proposer within suggestions controller determines whether the user has checked anonymous suggestion and then assigns the user_id to the proposer. In case, the student has chosen to make an anonymous suggestion, the proposer variable is set as the string “Anonymous”.
[[File:Mail_instructor_on_new_suggestion_2.jpg]] <br/><br/>
 
To send the email, a mail_instructor function was created. This function requires the suggestion title, proposer, and the email of the receiver.
# The proposer is set using the set_proposer function.
# The suggestion title is passed through @suggestion.
# The assignment to which this suggestion is being made references to the instructor who created the assignment through instructor_id.
This function then calls new_suggested_topic function in the mailer.rb file to send the mail with the information.
[[File:Mail_instructor_on_new_suggestion_3.jpg]] <br/><br/>
 
The mailer.rb file also gets a new function new_suggested_topic referenced above.
[[File:Mail_instructor_on_new_suggestion_4.jpg]] <br/><br/>
 
The last change made to suggestions controller is calling the mail_instructor method in the create suggestion method. If the assignment references an instructor, the mail method is called on any suggestion being saved. The ‘if’ condition here is put in for a test condition where an assignment is created through the factories and this assignment does not reference an instructor.
[[File:Mail_instructor_on_new_suggestion_5.jpg]] <br/><br/>
 
The final change is the addition of a new file which contains the content and formatting of the mail being sent to the instructor.
[[File:Mail_instructor_on_new_suggestion_6.jpg]] <br/><br/>
 
==== Option for instructor to create a participant which does not exist ====
 
The precondition here is that there is no participant and the instructor can add a non-existent participant. Further, a flash message is added when instructor adds a new participant. Instructor is forwarded to the user creation page by the corresponding link.
[[File:Karan_1.jpg]] <br/><br/>
 
User should have the provision to review projects. For that, the user needs to access the review page. A link has been added just for this purpose. The link would take the user to the respective review page.
[[File:Karan_2.jpg]] <br/><br/>
 
Link for submission deadline reminder
User should get a deadline reminder in e-mail once a deadline to review is nearing. Once a user gets a deadline reminder e-mail, the user could review a team then. Email should have the link to review a team.
[[File:Karan_3.jpg]] <br/><br/>
 
==== Modifications made to the email that the instructor receives for contradicting reviews ====
 
 
More functionalities added to the e-mail that the instructor receives for contradicting reviews. The average scores of the total reviews done previously and the score of the new review are included in this. It looks so much better with the bullet points included, thus increasing the readability.
[[File:Karan_4.jpg]]
 
 
 
 
 
[[File:Karan_5.jpg]]<br/>
response.rb
 
 
 
 
[[File:Karan_6.jpg]] <br/>
notify_grade_conflict_message.html.erb
 
 
 
 
==== E-mail to the invitee to join a team ====
 
Participants would require other participants to team up for a project. In such a case, a participant would invite another participant to join a team. Subsequently, an e-mail should be received to join the team. The e-mail should have the join request with it to join the group. It is important that the e-mail is received by the receiver when a participant student invites him.
 
[[File:Karan_7.png]]<br/>
invitations_controller.rb
 
 
 
 
 
[[File:Karan_8.png]] <br/>
mailer_helper.rb
 
==== Ad responses and invitations reported by e-mail ====
 
When a student responds to a teammate advertisement, the person who created the advertisement must be notified by email. Three new files have been created to send e-mails to both the inviter and the invitee, the three files being accept, decline and pending. These three would be the responses of the invitations to join the team.
 
[[File:Karan_9.jpg]] <br/>
_invitation_accepted_html.html.erb <br/>
_invitation_declined_html.html.erb <br/>
_invitation_pending_html.html.erb <br/>
 
 
==== Option for the instructor to get a copy of emails being sent to the student ====
Any activity done on the assignment by a student can be viewed by the instructor. The instructor can make suggestions to the students. An e-mail could be sent by the instructor to the students regarding the activities done on the assignment. Now, the instructor has the option to choose to get all the e-mails that have been sent to the participants (students).
 
[[File:Karan_10.jpg]] <br/>
profile_controller.rb
 
 
 
 
 
[[File:Karan_11.jpg]] <br/>
users_controller.rb
 
 
 
 
 
[[File:Karan_12.jpg]] <br/>
delayed_mailer.rb
 
 
 
 
 
[[File:Karan_13.jpg]] <br/>
mailer.rb
 
 
 
 
 
[[File:Karan_14.jpg]] <br/>
user.rb
 
 
 
 
 
[[File:Karan_15.jpg]] <br/>
_prefs.html.erb.rb

Latest revision as of 20:06, 9 November 2018

This wiki page is for the description of changes made under E1831 OSS assignment for Fall 2018, CSC 517.

About Expertiza

Expertiza is an open source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.

What has been done previously

Students and instructors are notified of various events by e-mail, e.g., creation of a new account, submission of a review on their work, or updating of work that they have reviewed. This project is focused on adding new email functionalities.

Problem Statement

  • Issue #296: Send out an email to the invitee when a participant sends out an invitation to another participant to join a team. The student who issued the invitation should also be e-mailed when the invitee joins the team. And also, when a student responds to a teammate advertisement, the person who created the advertisement must be notified by email. In general, all activity on ad responses and invitations should be reported to the other party by email (unless these emails are turned off in a (new) profile field).
  • Notify an instructor by e-mail when a student suggests a topic.
  • Issue #87: Create an option (in the instructor’s profile) to get a copy of emails being sent to students.

Files modified under in this project

Controllers

Views

Mailers

Models

Database Migrations

Specs

Test Plan

Sending mail to Instructor on creation of a new suggestion

On creation of a new suggestion, a mail should be sent to the instructor. To establish this, we test whether the create suggestion method calls a mail_instructor method. Once the mail_instructor method is called, we test the mail_instructor method to have called the mailer with the correct parameters.

Option for instructor to receive copy of all emails

1. Create a new account as an instructor on the deployment.
2. Log in as instructor.
3. Got to profile page.
4. Check the box that says 'Send me copies of all the emails'.
5. Log in as 'student2064' with password 'password'.
6. Trigger any action that may result in mail being sent to the student.
7. Log in to instructor's email to check if copy of the same email has been received.

Sending email to student upon an invitation to a team and his response back

Send an email invite to the invitee when a student sends him/her a request. When the invitee accpets/declines the request of the student, the inviter should get a response email based on the invitee's decision.




Peer review steps for reviewing steps for team invitation

1. Login as a student and send an invitation to an invitee.
2. The invitee should get an mail on your invitation.
3. Login as the invitee and accept/decline the invitation.
4. The inviter should get a mail on the response.

Solutions Implemented

Sending mail to Instructor on creation of a new suggestion

As part of the email that is to be sent to the instructor, an important piece of information is the proposer. When a suggestion is made by a student, they can choose to make the suggestion in anonymous mode. The function set_proposer within suggestions controller determines whether the user has checked anonymous suggestion and then assigns the user_id to the proposer. In case, the student has chosen to make an anonymous suggestion, the proposer variable is set as the string “Anonymous”.

To send the email, a mail_instructor function was created. This function requires the suggestion title, proposer, and the email of the receiver.

  1. The proposer is set using the set_proposer function.
  2. The suggestion title is passed through @suggestion.
  3. The assignment to which this suggestion is being made references to the instructor who created the assignment through instructor_id.

This function then calls new_suggested_topic function in the mailer.rb file to send the mail with the information.

The mailer.rb file also gets a new function new_suggested_topic referenced above.

The last change made to suggestions controller is calling the mail_instructor method in the create suggestion method. If the assignment references an instructor, the mail method is called on any suggestion being saved. The ‘if’ condition here is put in for a test condition where an assignment is created through the factories and this assignment does not reference an instructor.

The final change is the addition of a new file which contains the content and formatting of the mail being sent to the instructor.

Option for instructor to create a participant which does not exist

The precondition here is that there is no participant and the instructor can add a non-existent participant. Further, a flash message is added when instructor adds a new participant. Instructor is forwarded to the user creation page by the corresponding link.

User should have the provision to review projects. For that, the user needs to access the review page. A link has been added just for this purpose. The link would take the user to the respective review page.

Link for submission deadline reminder User should get a deadline reminder in e-mail once a deadline to review is nearing. Once a user gets a deadline reminder e-mail, the user could review a team then. Email should have the link to review a team.

Modifications made to the email that the instructor receives for contradicting reviews

More functionalities added to the e-mail that the instructor receives for contradicting reviews. The average scores of the total reviews done previously and the score of the new review are included in this. It looks so much better with the bullet points included, thus increasing the readability.




response.rb




notify_grade_conflict_message.html.erb



E-mail to the invitee to join a team

Participants would require other participants to team up for a project. In such a case, a participant would invite another participant to join a team. Subsequently, an e-mail should be received to join the team. The e-mail should have the join request with it to join the group. It is important that the e-mail is received by the receiver when a participant student invites him.


invitations_controller.rb




mailer_helper.rb

Ad responses and invitations reported by e-mail

When a student responds to a teammate advertisement, the person who created the advertisement must be notified by email. Three new files have been created to send e-mails to both the inviter and the invitee, the three files being accept, decline and pending. These three would be the responses of the invitations to join the team.


_invitation_accepted_html.html.erb
_invitation_declined_html.html.erb
_invitation_pending_html.html.erb


Option for the instructor to get a copy of emails being sent to the student

Any activity done on the assignment by a student can be viewed by the instructor. The instructor can make suggestions to the students. An e-mail could be sent by the instructor to the students regarding the activities done on the assignment. Now, the instructor has the option to choose to get all the e-mails that have been sent to the participants (students).


profile_controller.rb




users_controller.rb




delayed_mailer.rb




mailer.rb




user.rb




_prefs.html.erb.rb