Step-by-step explanation:
When the wire is connected to a battery, the compass needle moves and changes its position. This happens because the needle magnetizes the copper wire, thus, creating a force.
While the current in the wire produces a magnetic field and exerts a force on the needle. The insulation on the wire becomes energized and exerts a force on the needle. Hence, the compass needle moves and changes its position.