Write submission to a directory whose name is the same as the submitted project.  This way, not all submissions go into the same directory.  So if the same student submits project 2 and 3, one submission won't overwite the other.