Formation of educational and cognitive motivation