Energy Conservation in an expanded 1D box

I am fairly new to QM and am learning many of the basics right now. We were just discussing conservation of operators (energy, momentum, etc) and I recalled a problem proposed in my textbook about a 1D particle in a box of length L. at a time t, the box suddenly expands to t=2L, in which time the wavefunction does not have time respond. it asked if energy (more specifically, <H>) was conserved during the time that the wall moves.

i'm assuming that the laws of conservation aren't broken and that the Hamiltonian does not change. but then does the fact that the box expanded at a specific time, mean that then the potential V(x) is now a function of time? so then is energy is not conserved since I have to consider the potential in the Hamiltonian now?

OK now I'm assuming that since the box changes, the potential does change and thus <H> is not equal to <H'>. Is this correct?

Avodyne