CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics

From Expertiza_Wiki
Jump to navigation Jump to search

Problem Statement

For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects. The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.

Links to the project

Github Pull Request: https://github.com/expertiza/expertiza/pull/1651
Video Presentations: https://youtu.be/fyAiyzUsHH4 https://youtu.be/KBdiqPe-wLE https://youtu.be/avjdLbw28K8
Deployment: http://152.46.18.18:8080

The goal behind this project:

Develop a trigger that:
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity

  • ex) max members = 4, trigger activated when the team size reaches 3

2) Assign a mentor to the team

  • Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.

3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)

Design Pattern

Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.

Implementation for our project

Project Description

Old version:

For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system.
In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually

New version:

Assignments with or without a topic could be assigned with mentors automatically

Also, mentor and team members will be notified by Emails (Results showing in UI Test).

Design Diagrams

Workflow Diagram

General workflow and specific add member workflow

Proposed Solution

The solution we proposed generally follow the chain of responsibility and the work flow
The solution will follow steps list here:

  • Allow instructor to assign mentors for assignments without a topic
  • Check the topic of assignment and number of team members whether reach the requirement or not
  • Assign mentor for the team automatically
  • Notificate both mentor and student
  • Team member added after the mentor assignment will also get a email notification about mentor


Code Implementation & Explanation

Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:
Models:

  • app/models/assignment_team.rb
  • app/models/assignment_participants.rb
  • app/models/team.rb
  • app/models/team_users.rb
  • ...


Views:

  • app/views/student_task/view
  • app/views/student_teams/view
  • app/views/shared_scripts/_add_individual
  • app/views/participants/_participant
  • ...

Here we present some essential codes with explanation

First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.


Add a mentor role for instructor/admin when add participant for assignment



To assign a mentor, there are several requirements:

  • There should be at least one mentor in this assignment
  • The current team size is greater than half of max size
  • The team do not have a mentor yet



Always assign mentor with lowest number of mentoring teams, in order to do so:

  • First, get all mentors for this assignment
  • Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number
  • Return mentor with lowest number of team she/he mentored



Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).

Test Plan

To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.

  • Run and pass existing RSpec Tests after Modification
  • Develop New RSpec Tests for the new features
  • UI testing on the deployed project

RSpec Test

1. Add new participant type mentor in factories.rb


2.Test new added method in team_respec, like half, add_member, size...


UI Test

1. Instructor/Admin add mentor for specific assignment

2. Student create team and invite others
3. When team size greater than half of max size, assign mentor and send emails

4. When student accept from a team which has already been assigned with mentor, he/she would receive a email

5. Also we extend our work to make all teams visible to mentors


Future Work

1. Mentor could not see teams' submissions since authorization control is working on the view assignment page and mentor does not have rights to submit
2. Rspec Test for email functions

Team Member

Our team members: (Sorted in Alphabetical order)

  • Hongli Wang, hwang85@ncsu.edu
  • Minghao Liu, mliu25@ncsu.edu
  • Ruiwen Wu, rwu5@ncsu.edu
  • Siwei Wen, swen4@ncsu.edu

Mentor: Mrs. Carmen Aiken Bentley