wolfe3d / sodata

Science Olympiad Data
GNU General Public License v3.0
3 stars 2 forks source link

Bug in removing students from a team #22

Closed chinmay314 closed 2 years ago

chinmay314 commented 2 years ago

When a student is removed from a team in the "edit team" menu, they aren't actually removed from the teammateplace table. The only way to completely remove them from the teammateplace table is to remove all of their events in the "assign events" menu BEFORE removing them in the "edit team" menu.

Removing them from the team should ideally also remove all of their events - i will look into fixing this behavior.

chinmay314 commented 2 years ago

Okay so I'm not sure how you want this to be handled, but to me it seems that the problem boils down to the fact that when tournamentteamadjust is being called, it only removes the entry from teammate, but not teammate place.

Is there a reason that tournamentteamadjust deletes from a variable $table but tournamenteventteammateadjust deletes from teammateplace explicitly?

wolfe3d commented 2 years ago

I am not sure that removing a student completely before removing their events is an ideal change in behavior. What if you accidently click on a student? I think an ideal behavior would be a warning (on clicking a student) that states that a student cannot be removed until the events are reassigned. Then do not allow the unchecking of the box.

wolfe3d commented 2 years ago

I highlighted where these warnings and checks need to be done in tournamentteammateadjust.php and data.js