E1829 OSS project Duke Blue Fix import glitches

From Expertiza_Wiki
Jump to navigation Jump to search

This wiki page is for the description of changes made to Fix import glitches.

Background

The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.


Issues Resolved

  • Issue #329: When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.

  • Issue #328: When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.

Implementation

Issue #328

  1. We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.
  2. We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’.
  3. Then the import_team_members function is called
  4. We get the user through his/her name
  5. If a user isn’t registered, we get a nil object and raise an ImportError
  6. Else we add the user to the team if he/she isn’t already in the team
  7. The add_member function only works till the team isn’t filled to its maximum capacity