When handling the encoder, never let go of the string allowing it to retract under its own tension, damage may occur. Carefully pull the string out and let it retract slowly.
Make sure the string  can move freely in and out of the encoder housing. Make sure the encoder string is not pinched or touching the way cover at anytime during its travel. The B-Axis position on the screen should change as you pull on the encoder string. If there is no change in the position display check the encoder connection in the cable trey behind the Z-Axis.
Inspect the encoder string for contamination or damage (cuts or fraying).
Inspect the encoder housing for signs of damage or contamination.