CSC/ECE 517 Fall 2016/oss E1649 KPS

From Expertiza_Wiki
Revision as of 20:19, 28 October 2016 by Ssdeshp5 (talk | contribs) (Edited New Implementation)
Jump to navigation Jump to search

New Implementation

The new implementation allows an instructor to assign a particular topic to a team as well as remove a team from a topic. Some of the scenarios where the instructor might wish to add a team would be if the sign up deadline has passed, or if the instructor has decided to update the maximum number of teams allowed to choose a particular topic.


With the new implementation, Instructors/Teaching Assistants do not need to go through the trouble of impersonating a student in order to add or drop their team from topics.

Changes were made in the following files -

  • controllers/sign_up_sheet_controller.rb
  • views/sign_up_sheet/_all_actions.html.erb
  • views/sign_up_sheet/assign_topic.html.erb
  • views/sign_up_sheet/remove_topic.html.erb

In the sign_up_sheet controller, two major methods were added:

update_team

This method allows an admin user to add a team to a particular topic, based on the username of any member of said team. If the number of teams already assigned to the topic is greater than or equal to the maximum number of teams allowed to pick the topic, the new team is added to the waitlist. If a team was previously assigned a topic, and are then added by an admin to a new topic, their association with the old topic is deleted, and the required changes to the waitlist of topics are made as well. The system will throw an error if the username of an invalid user is used to search for teams associated with the user.

remove_team

This method allows the admin to remove teams from a given topic, based on the username of a team member. First, a check is done to ensure that the team is indeed associated with the given topic. If this is the case, the entry is deleted from the table sign_up_teams, and the corresponding changes are made to the waitlist as well.


Functionality

2 additional icons have been added in the something column. The ‘green plus’ icon allows you to add a team to the current topic. Clicking on the icon redirects you to a form, where the admin is required to enter the username of the person whose team he wishes to add.

Clicking submit then redirects back to the original page, with a flash message containing the status of the operation, as well as the cause in case of a failure. image_form_addteam, image_mainpage_success


The 'red cross' icon is used to remove a team from the given topic. Clicking on it takes the admin to a form, where he is required to enter the username of one of the team members belonging to the team that is to be removed. Submitting the form redirects the user back to the original page, with a flash message indicating the status of the remove operation.

image_form_removeteam, image_mainpage_success