Concept:The phrase "no choice but" is a fixed idiom that means "having no other option except to do something."
It is used when someone is forced to act in a certain way.
Explanation:The sentence says the students had no choice and therefore had to obey the command.
The word that best connects "no choice" with the action is "but".
We use "no choice but to..." to express an unavoidable action.
For example: "They had no choice but to agree."
Option A, "even", does not make sense here.
Option C, "rather", is not used after "no choice".
Option D, "only", is incorrect because the correct fixed expression is "but", not "only".
Thus, the completed sentence is: "The students had no choice but to do as they had been commanded."
Answer:The correct option is B. "but".