A spokeswoman for the Scottish government said: "Religious and moral education enables children and young people to explore, debate and more importantly understand the world's major religions - as well as approaches to living independent of belief.
"Religious observance is a whole school activity which should be sensitive to traditions and origins, and should seek to reflect these but it must equally be sensitive to individual beliefs, whether these come from a faith or non-faith perspective.
"We encourage schools to discuss options with both parents and their children, particularly in the senior years.