CSC/ECE 517 Fall 2019 - E1962. Email notification upon account creation

From Expertiza_Wiki
Jump to navigation Jump to search

E1962 Email notification upon account creation

Brief Introduction

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.

Background and Problem Statement

New users on Expertiza can be created by instructors directly from Users page or new user can also get created when added as an assignment participant but does not already exist in the system.


After creating an assignment, the instructor can add participants to it by two ways

  • Picking participants by their usernames OR By importing a csv file which lists the participants

If a user does not already exist in the system, then a new Expertiza account is created for the user and then added as a participant on the assignment. An email notification of account creation along with the user-ID and password must be sent to the user.


The following issue was identified in the current system

  • When students' accounts are created by importing a CSV file on the Users page, they receive e-mails with their user-ID and password.

However, if an account is created by adding them as participants to an assignment when they don't already have an account, e-mail notification is not being sent.

You can find the issue marked on github here.

Solution and code changes


The code in the below snippet previously had the flow as follows:

If user does not already exist in the system, then create new user account(if there is sufficient information about the user to create a new Expertiza account)

Add this user to the assignment as a participant.

If user already exists in the system, do nothing. If the user is already a participant on the assignment, do nothing.


The issue here was that an already existing user in the system will not get added as a participant on the assignment.


The code has been modified to facilitate the following flow:

If the user does not exist in the system, create new user account (if there is sufficient information about the user to create a new Expertiza account)

If the user already exists as a participant on the assignment, do nothing Add the user to the assignment as a participant; otherwise.


This way, the user(whether newly created or already an Expertiza user) gets added on the assignment as a participant.

Testing

How to test the changes

Follow these steps:-


1. First, make a CSV file on your local system using the following format. You may skip the header.


2. Follow this link to the deployed application


3. Login with username 'instructor6' and password 'password'


4. Navigate to Manage -> Assignments


Click on 'Assignments'


For an assignment, select the action 'Add participants'


Click on import assignment participants


Upload the csv file created above


Confirm the participant list


TIP: To test fully, ensure that you have access to at least one of the email-ids mentioned in users listed in the csv. This way you can affirm the changes work when you receive an email notification as shown below.

Additional changes

In course of working on the issues listed in the scope of this project, we identified another bug in the system.

Issue: If a user already exists in the system and appears in the csv file while importing participants, then the code only checks that the user exists and moves ahead. However, the user is not added as a participant on that assignment.

Participants are being added to the assignment only when user does not exist in the system already and user is newly getting created.

Our Team

  1. Vishva Shah
  2. Urvish Vasani
  3. Hitarth Shah
  4. Sharique Khan(mentor)

Quick Links

To view the issue on github, click here

To visit our forked repo, click here

To test the implementation, click here

To view our pull request, click here