Question 350659
HI, 
*Note: The 8 Students themselves can be arranged in 8! ways
.
If I am understanding the question, teacher may be on the right "or" left of the line.

teacher on the right end: that would result in 8! ways
teacher on the left end: that would result in 8! ways
.
8! + 8! or 2*8! would be the total ways