CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2): Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 74: Line 74:
* We need to write 1 migration to add the field to the table to update the schema file
* We need to write 1 migration to add the field to the table to update the schema file
[[File:Schema E2403.png | 600px]]
[[File:Schema E2403.png | 600px]]
=== Mailer Changes ===
====team.rb====
* The team model must be altered to use delegation for cases where a team would previously be a mentored team.
====add_member====
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper.
====mailer_helper====
* The mailer_helper will be altered such that the send_confimration_to_users will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design.
====mailer.rb====
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.


== UI Changes ==
== UI Changes ==

Revision as of 02:38, 9 April 2024

Expertiza

Expertiza is a Ruby on Rails based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.

Introduction

This project is the continuation of E2304 for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.

Problem Statement

The following tasks are required for the project:

  1. Enhancing Code Clarity: This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code
  2. Reimplement Mentored teams: Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design
  3. Reimplement Sign Up Sheet or Topics: Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic
  4. Writing tests for mentor meetings models: More tests have to be written for Mentor Meeting model
  5. Writing tests for the mentor meetings controller: More tests should be written for Mentor meeting controller
  6. Writing tests for the signup sheet controller: Additional tests should be written for signup sheet controller to test the new functionality

Objectives

We have 3 main objectives for this project.

  • Refactoring of the Mentor-meeting model and controller created for the Project 3
  • Reimplementation of Mentored Teams model and controller for the Project 4
  • Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics

Design Goal

While fulfilling all the objectives, the following design rules have to be ensured:

  • Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.
  • Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.
  • Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.
  • Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.

Class UML Diagram

Classes and Relationships

Existing Structure

  • Every Assignment has a Node
  • Every Assignment has many AssignmentTeam and MentoredTeam
  • AssignmentTeam is inherited from Team
  • MentoredTeam is inherited from AssignmentTeam
  • Every MentoredTeam has many MentorMeeting

Proposed Structure Structure

  • MentoredTeam to be delegated from AssignmentTeam instead of inheriting from it

Implementation Plan

Modify newly created controller, model and view

mentor_meeting_controller.rb

  • Edit function names to make them more descriptive
  • Add more descriptive comments for the functions

mentor_meetings_helper.rb

  • Move the "get_dates_for_team" function to the model
  • Rename the function to make it more descriptive

_entry_assignments.html.erb

  • Add more descriptive comments for the JavaScript functions
  • Move the Ruby code from the template to a helper or the controller

mentored_team.rb

  • This file needs to be modified to implement the functionality of delegation instead of inheritance
  • The "add_member" method must function as previously intended during reimplementation

Modify existing controller model and view

teams/_team.html.erb

  • As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam

teams_controller.rb

  • This file has to be modified to work with the delegated MentoredTeam
  • These lines will not work as MentoredTeam will not be a model

sign_up_sheet_controller.rb

  • This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created
  • This will be followed by a change in schema

_topic.html.erb

  • If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor

schema.rb

  • As we are adding a new field to the table, we need to modify the schema
  • We need to write 1 migration to add the field to the table to update the schema file

Mailer Changes

team.rb

  • The team model must be altered to use delegation for cases where a team would previously be a mentored team.

add_member

  • The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper.

mailer_helper

  • The mailer_helper will be altered such that the send_confimration_to_users will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design.

mailer.rb

  • A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.

UI Changes

UI Changes before Phase 2 code changes

  • The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt
  • But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.

UI Changes after Phase 2 code changes

TODO:: The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt

Implementation

TODO::

Files Modified/Added

TODO::

Test Plan

When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written.

Automated Rspec Testing

Functionalities introduced by our code that needs to be tested:

  1. When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.
  2. When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.
  3. Mentored team should be delegated and so it must be a object of Assignment team

Testing model methods

TODO::

Testing controller methods

TODO::

Manual UI Testing

Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.

TODO:: Link to the video to find help on testing these cases

Scenario 1 - Creating an mentored team

  1. Log into Expertiza using the test credential and navigate to the home page
  2. Go to Manage > Courses
  3. Assuming you have created a course and added participants to it, proceed to create a team
  4. Make sure "Auto assign mentors when team hits > 50% capacity?" option is checked

  • Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically

Scenario 2 - Adding, editing, deleting mentor meeting dates

  1. Log into Expertiza using the test credential and navigate to the home page
  2. Go to Manage > Assigments
  3. Assuming you have created a mentored assignment and added participants to it, proceed to the teams page
  4. Try entering dates into it teams row and the date should persist
  5. You can edit and delete the dates from the rows
  6. Team with less than 50% capacity will have the mentor meeting dates disabled


Scenario 3 - Creating an mentored team with topic

  1. Log into Expertiza using the test credential and navigate to the home page
  2. Go to Manage > Courses
  3. Assuming you have created a course and added participants to it, proceed to create a team
  4. Make sure "Has topics?" option is checked and a topic is created using the Topics tab

  • Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically

TODO::

Test Coverage

TODO:: We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated x% percent of code was covered through the testcases.

Test Login Credentials

  • UserId: instructor6
  • Password: password

Demo Video

TODO:: This is our demo video which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.

Relevant Links

TODO::

Team

Mentor

  • Ed Gehringer (efg)

Team Members

  • Samuel Kwiatkowski-Martin (slkwiatk)
  • Tanmay Pardeshi (tpardes)
  • Bala Logesh Sudalaimuthu Pandian (bsudala)