Answer
$$q=-2\quad \mathrm{or}\quad \:q=12$$
Work Step by Step
Since the value inside the absolute value can be positive or negative and get the same number, we must consider both options. Doing this, we find:
$$\left|5-q\right|=7 \\ 5-q=-7\quad \mathrm{or}\quad \:5-q=7 \\ q=-2\quad \mathrm{or}\quad \:q=12$$