At school there are sometimes books (novels) studied which contain content which is immoral (bad language, alcohol consumption by characters etc.) and/or contains words of shirk. Is it sinful to answer questions in tests based on such texts if we avoid mentioning the content or if the question is broadly referring to the novel and not specifically to the parts of immorality and/or shirk? JazakAllahu khairan.
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
There is no harm in what you have mentioned in the question even if this included relating words of Shirk (associating partners with Allah) and immorality and so forth.
One of the well-known rules with the scholars is that the mere relating of Kufr is not Kufr and this does not necessitate that one confesses to it.
For more benefit, please refer to Fatwa 372514.
Allah knows best.
You can search for fatwa through many choices