CSC/ECE 517 Spring 2022 - E2246: Email your authors/reviewers, with complete tests

From Expertiza_Wiki
Revision as of 20:46, 1 May 2022 by Sdamulu (talk | contribs)
Jump to navigation Jump to search

Introduction

Problem Statement

This project adds a new feature which will enable a reviewer to send an Email to authors from inside Expertiza or for the author to email all those reviewing them. Often when reviewing another team’s submissions, a reviewer might notice that their deployment link is broken or there is some other issue. Currently, there is no way to email the authors. This features is proposed to solve this issue.

Scope of the Feature

- The feature allows authors to send a common Email to all the reviewers to report any issues or updates to their project to be reviewed.
- It can allow a reviewer to send an email to a particular author if the reviewer wants to convey any issues found with that particular project.
- Reviewers will be anonymous to authors.

Flowchart

Author's View : The flow for authors to email reviewers regarding the work they have been reviewed for:


Reviewer's View : The flow for reviewers to email authors whose work they have reviewed:


UML Diagrams

Reviewers use case


Author's use case



Proposed Changes

Code Implementation

Expertiza code base already contains a module 'MailerHelper' which makes use of ActionMailer and contains methods to send emails to different users. email_author_reviewers(subject, body, email) will be added which can be used in both the workflows to send an Email.
From the Reviewer's perspective, the following files will be updated and a new view will be created.

1. app/views/response/view.html.erb : link to the new view will be added to this file.
2. app/controllers/response_controller.rb : implementation of the action method for the send button will be added here. Methods from MailerHelper will be used here.
3. app/views/response/author.html.erb : This is the new UI page. A mock up for the view is presented in the UI section.

From Author's perspective, the following files will be updated and a new partial will be created to render the new view.

1. app/views/student_task/view.html.erb : link to the new view will be added to this file.
2. app/controllers/student_task controller.rb : implementation of the action method for the send button will be added here. Methods from MailerHelper will be used here.
3. app/views/student_task/email_reviewers.html.erb : This is the new UI page. A mockup for the view is presented in the UI section.

UI

As depicted below, Authors will be given a link on their main Assignment page “Send Email to Reviewers” which will take them to a new page where they are given a text box for typing and sending an email to all their reviewers.





Reviewers will be given a similar text box link on their “Other’s Work” page next to each review that they are doing.




Implememtation

The following are the screenshots of the changes that we made in the codebase.

Send Email Method in MailerHelper

We created a new method called send_mail_to_author_reviewers(subject, body, email), which accepts 3 parameters; subject, body and email. We used the same method for both sending emails to authors and reviewers.


Email from Reviewer to Author

View

To create the author view, we created a new view called author.html.erb and created a form in that file, which asks the user to enter the subject and body.

Controller

We created a method called send_email in the response_controller which handles the functionality for sending an email. The method also contains validations that throw an error if the user is trying to submit the form without filling out the subject or body. If there are no validation errors, we pass the subject, body, and email from the view to the controller and send them to a method called send_mail_to_author_reviewers which is a part of MailerHelper. This method is responsible for sending emails to the author.


Email from Author to Reviewers

View

To create the reviewer view, we created a new view called email_reviewers.html.erb where we created a form that asks the user to enter the subject and body of the email.


Controller

To send an email to all the reviewers, we created a method called send_email in the student_task_controller. The method also contains validations that throw an error if the user is trying to submit the form without filling out the subject or body. If there are no validation errors, we go ahead and pass the parameters; subject, body, and reviewer.email to the send_mail_to_author_reviewers method from MailerHelper.


Testing

RSPEC Testing

Since this is a new Feature, Rspec test cases will be added for all the new methods introduced in the response_controller.rb and student_task controller.rb.

Manual Testing

For testing purposes, we are using the 'expertiza.debugging@gmail.com' as both author and reviewer. There are two views that need to be tested manually.

1. Author View:

The author must follow the following steps:

1. Go to the Assignments page.
2. Click on the link which is placed on the right corner of the page called "send email to reviewers".
3. On clicking the above link, the author must be redirected to a page with an email text box. 
4. Type the email message and click on send.
5. Log in to the email to check if the message is received. 

2. Reviewer View:

The reviewer must follow the following steps:

1. Go to the other's work page.
2. Click on the link which is placed on the right corner of the page called "send email to author".
3. On clicking the above link, the reviewer must be redirected to a page with an email text box. 
4. Type the email message and click on send. 
5. Log in to the email to check if the message is received.

We are planning to cover the following test cases:

1. Author View:

1. Upon Clicking on the link which is placed on the right corner of the page called "send email to reviewers",
   the author must be redirected to email_reviewers_view. 
2. Check if the recipients of the email are indeed the reviewers of the authors' work.

2. Reviewer View:

1. Upon Clicking on the link which is placed on the right corner of the page called "send email to author",
   the reviewer must be redirected to email_authors_view. 
2. Check if the recipients of the email are indeed the authors of the reviewed work.

We will also be checking the below two edge cases:

1. Author View:

1. Once the email is sent, the author should be redirected to the assignment page with the corresponding success
   or failure message

2. Reviewer View:

2. Once the email is sent, the author should be redirected to the "others work" page with the corresponding success
   or failure message

Future Scope

Currently, only a subject and a text message are provided to send an Email, in future the above functionality can be extended to include attachments in the Email. For example, Reviewer can send an image/screenshot for a failure they have come across to the Author.

Team Members

Ashritha Bommagani (abommag@ncsu.edu)

Abhishek Arvindkumar Upadhyay (aaupadhy@ncsu.edu)

Harini Bharata (hbharat@ncsu.edu)

Sri Pallavi Damuluri (sdamulu@ncsu.edu)