CSC/ECE 517 Fall 2020 - E2077. Mentor management for assignments without topics E2024

From Expertiza_Wiki
Jump to navigation Jump to search

Project Overview

Background

Currently, Expertiza has no way to associate mentors with teams. 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. Keeping this in mind our code is set to work under the following conditions:

  • Assignment teams created for an assignment without topics
  • Mentors (Instructors and TAs) are only assigned to assignment teams if they have been added to an assignment as participants

We've created the following video to demonstrate the added functionality. As well as the following video which demonstrates what happens when teams are created when no mentors have been added as participants to an assignment.

Objectives

1. Assign a TA or instructor as a mentor for a team created for an assignment without topics

Previous Work

We learned from previous implementations and looked to avoid the following pitfalls when implementing our solution:

  • Code was merged from the previous team, but not refactored, so a lot of unused code remained.
  • Should have followed a better naming convention for methods
  • Some redundant codes in the views could be DRYed out.
  • Commented code should be removed.
  • Some complex logic is added but not explained in the comments.
  • Code should be placed in most relevant classes. (E.g. Do not put email code in the Team class).
  • Documentation doesn't accurately represent implementation.
  • Lacked sufficient detail for Test section.

Previous Implementation's Wiki

Program Design

Our implementation begins when an assignment team is created. If the assignment is associated with a topic, the created team will not be assigned a mentor. If the assignment does not have a topic, a hash of potential mentors is retrieved. This hash is created from the TAs and instructors added to the assignment as participants. The keys of the hash correspond to the mentor's participant id while their values are the number of times the mentor has been assigned to mentor teams. The mentor with the lowest number of assigned teams will be the next mentor assigned to a newly created team. Once the team is assigned a mentor, an email is sent out to the mentor and students in the team to notify them of their mentor assignment.
First Design:


Ultimately we were able to implement the following design:
Final Design:

We created the following assignment_teams_mentors table with the following connections to existing tables. The new table created is responsible for storing all the mentors assigned to the various teams created. In order to do so, the assignment_team_mentors table will reference the participants and teams tables.

We will also modify the participants table to add an additional Boolean column, can_mentor. This column will help determine what TAs and instructors can mentor for a specified assignment.


Currently instructors see the corresponding view when looking at teams associated with an assignment:

Our team proposed adding an additional "Mentors" column in the instructor view:

Currently students see the corresponding view when looking at their team for an assignment:


Our team originally proposed to add an additional "Mentors" section in the student view:

Files Modified/Created

These are the files we have modified/created throughout our project and a brief excerpt about what was done:

Database

  • Schema.rb
    • Created assignment_team_mentors table which references the participants table and teams tables thru foreign keys created with the assignment_team_mentors_id column and assignment_team_id column. The assignment_team_mentors table is responsible for storing all the mentors assigned to the various assignment teams created.
    • Created a can_mentor column for the participants table in order to be able to know who was a mentor and who was a student.

Models

  • assignment_team_mentor.rb
    • Responsible for ensuring mentor with the least number of teams mentored, gets assigned to the next team created.
    • Started to add mailer functionality for notifying the mentor assigned.

  • assignment_team.rb
    • Established a has_one: active record relation with AssignmentTeamMentor model. This ensures a team only has one team mentor.

  • participant.rb
    • Established a has_many: active record relation with AssignmentTeamMentor model. This provides the flexibility of a potential mentor added as a participant to an assignment, to mentor multiple teams created for an assignment.

    • Added a function to set the new can_mentor column for a participant.
    • Added a function to get a list of all participants who can be mentors for a specified assignment based on the can_mentor column.

Controllers

  • teams_controller.rb
    • The following code was added within the create method.
    • Calls on AssignmentTeamMentor to assign mentor for instructor created teams. Will generate notice if unable to assign mentor to recently created team.

    • The following code was added within the list method.
    • A hash is generated with the assigned mentor of each team.

  • student_teams_controllers.rb
    • The following code was added within the create method.
    • Calls on AssignmentTeamMentor to assign mentor for student created teams. Will generate notice if unable to assign mentor to recently created team.

    • The following code was added within the view method.

  • teams_user_controller.rb
    • added code to send the email when a user is added to a team to the mentor.
  • participants_controller.rb
    • updates the can_mentor column of a participant when they are added to an assignment

Views

  • views/tree_display/_page_footer.html.erb
    • displays mentor column header.

  • views/tree_display/_row_header.html.erb
    • displays either mentor assigned or "No mentor assigned" for team level. For team participant level, blank cell is displayed.

  • views/student_teams/view.html.erb
    • responsible for displaying to a student the mentor assigned to their team for an assignment.

  • views/mailer/notify_member.html.erb
    • responsible for managing the template of the mail sent to the mentor

Mailers

  • app/mailers/mailer.rb
    • responsible for managing the mailer functionally for notifying the member


Rspec

  • assignment_team_mentor_spec.rb

  • participant_spec.rb
    • The following tests were added to validate our changes made to the Participant model.

Testing Plan

Edge Cases

The following are scenarios our team has thought about:

Edge Case 1: How will we handle the "Has topic?" check box being changed when editing the assignment in the instructor view. This button is how we decide if we need to assign mentors to a team.

  Option A: Always run our algorithm for each assignment made and only show which mentors are assigned if the "Has topic?" is not checked
  Option B: Add the functionality to add and remove mentors for all assignments, not just assignments without topics then add and remove mentors when an assignment is edited.



Edge Case 2: No mentors exist

  Option A: Don't assign mentors
  Option B: Prevent creation of teams

RSpec Test

RSpec test to check:

  • Validation of the model created (AssignmentTeamMentor) and the model modified (Participant).

UI Test

As an instructor we were able to confirm the following UI changes after mentors were assigned to teams:

As a student we were able to confirm the following UI changes when a mentor has been assigned to their team:

The following video further expands on this UI testing.

As an instructor we were able to confirm the following UI changes after teams were created when no mentors had been added participants:

As a student we were able to confirm the following UI changes when a team was created without mentor participants for the assignment:

The following video further expands on this UI testing.

Possible Future Enhancements

  • Providing ability to manually select the mentor for a team created. Such as providing a drop down list of available mentors to choose from in the following view.

  • Refactor email functionality code and continue to develop to allow for the assignment team members to be notified of new assigned mentor or any other added members.

References

Github Repository
Pull Request
assigning of team mentor to newly created team video
team creation without mentor participants video
Previous Implementation's Wiki

Team

Santiago Sepulveda
Skieler Capezza
Liam Donovan
Javier Sanchez
Mentor: Yulin Zhang