Four students Alice, Bob, Charlie, and Diana want to arrange themselves in a line such that Alice is at either end of the line, i.e., she is not in between two students. In how many ways can the students do this?

[i]Proposed by Nathan Xiong[/i]
1. **Determine the possible positions for Alice:**
   - Alice can either be at the first position or the last position in the line. Therefore, there are 2 choices for Alice's position.

2. **Arrange the remaining students:**
   - Once Alice's position is fixed, we need to arrange the remaining three students (Bob, Charlie, and Diana) in the remaining three positions.
   - The number of ways to arrange 3 students is given by the factorial of 3, which is \(3!\).

3. **Calculate the total number of arrangements:**
   - Since there are 2 choices for Alice's position and \(3!\) ways to arrange the remaining students, the total number of arrangements is:
   \[
   2 \times 3! = 2 \times 6 = 12
   \]

Conclusion:
\[
\boxed{12}
\]