So a quadratic with roots at $1$ and $\mbox{-}7$ will be $c(x+7)(x-1)$, where $c$ is a real number. We just have to figure out what $c$ should be. We need $c$ to be negative if you want the function to be positive on only $(\mbox{-}7,1)$. Also, here the vertex is the point $\left(\mbox{-}\dfrac{b}{2a},f\left(\mbox{-}\dfrac{b}{2a}\right)\right)$. Let's write $\mbox{-}t$ for our number $c$ (so t will be positive), so our polynomial will be:
$$f(x)=c(x^2+6x-7)=cx^2+6cx-7c$$
To find what c is, we assume that the distance between the vertex and the origin is $5$ as desired. Compute the vertex of $f(x)$:
$$-\frac{b}{2a} = -\frac{6c}{2c} = -3$$
$$f(-\frac{b}{2a}) = f(-3) = c((-3)^2 + 6(-3) - 7) = c(9 -18-7) = -16c$$
which is what it means for the vertex to be:
$$v = \bigg(-\frac{b}{2a},f(-\frac{b}{2a})\bigg) = (-3,-16c)$$
The distance between the vertex and the origin being 5 means that:
$$5 = \sqrt{(-3-0)^2+(-16c-0)^2} =\sqrt{9 + 256c^2}$$
solving for c gives $c=\dfrac{\mbox{-}1}{4}$ (there are two solutions but we need the negative one like I stated).