CSC/ECE 517 Fall 2016/oss E1649 KPS

From Expertiza_Wiki
Revision as of 20:41, 28 October 2016 by Ssdeshp5 (talk | contribs) (Added information about 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.This functionality has been added in views/sign_up_sheet/_all_actions.html.erb which now has a '+' sign to assign a topic to a particular user. If the instructor clicks on this, then a view will appear which takes in the username of a student to be added. When the box is filled out and the “search” button clicked, then the indicated user’s team is signed up for the topic. If there are no slots available for that topic then the team will be put on the waiting list. There is also a 'X' sign that will help the instructor to 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. The instructor might want to drop a team from the topic if the team doesn't want to proceed with the same topic for the assignment. 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

Functions added to implement functionality :-

  • update_team
  • assign_topic
  • remove_team
  • remove_topic

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


Two 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