A theory of dynamic investment in education in response to accountability pressure