In exams a very curious thing happens. First, we read the question, we understand it, and then we begin to write the answer. But the funny thing is that, in order to be considered valid and correct, in most cases we will have to stick to what it says in the books.
By this we mean the following: if we write something that differs from what we have read, the teacher could subtract points, even if it is correct. Fortunately, it is something that is repeated less and less, but it is a trend that a lot has been accomplished in recent years.
The question we ask is the one that you have already been able to read in the title of the post. When we answer an exam question, do we have to to focus in what we have seen in the textbooks? On the one hand, yes, but on the other, no, since all that depends on the teacher with whom we are examining ourselves.
If you want our opinion, it is recommended that you put what I know specifies in the books but, at the same time, that you give your opinion. In this way, the content will be of much higher quality and, therefore, you will be taken into account more. Of course, you will not get more points for it, but it will be something very interesting.
In short, when you appear for the next exam, remember to put what you already you have studied. However, remember also that giving your opinion will be a very interesting task and that it will also help you as students.