Instructions: Given a scientific passage and an answer, generate a question for the given answer.
Input: Passage: Contact metamorphism occurs when a rock is altered by heat from a nearby magma. Answer: contact metamorphism
Output:
When a rock is altered by heat from a nearby magma, what occurs?