Yes, the sentence is correct, although a little difficult to understand in that word sequence. Yes, “the” was needed as the article for “students”. Your inclination to write it in the second sequence was correct.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.