Both versions will sort correctly. However the 1st version will always do an extra (unneccessary) pass, since its doing N passes, while if one thinks about it, the maximum times an element may change places, is N-1 (that would be when the smallest/largest number is at the wrong end of the array).
So 2nd version is a little more effective, it reduces complexity from approximately O(N*N) to O(N*(N-1)). Which is largely the same.
So, your teacher should recognize your code is correct. Since teachers are often stuck in their thinking model, be diplomatic about it when you talk to him, and carefully lead him to the conclusion above that N-1 outer passes are enough.