Hi there,
In a Word doc (or similar) the text is static and does not need to be run or compiled. However, if multiple people edit a code file at the same time this would cause a lot of issues when someone tries to run a piece of code while others are making changes etc. This would very quickly break the environment.
A better solution is to let your students learn how to work with Git. Here, each can work on their own part of the code, they can push and merge when changes are made, and you have a perfect track record of who did which part.
Of course this is a learning curve as you'd have to spend time teaching them how to use Git / GitHub, but this is a skill well worth the effort I personally feel...
Good luck with the TA-ing
PJ