Have a a look at branches in the user guide. Hopefully it will fit your need.
Or you can use LyX-notes to hide the text when producing the text for the students. I guess I would have used branches if this should be done in every chapter, especially if the book should be produced several times... Ingar