Let $mathfrak{r}$ be a finite dimensional complex Lie superalgebra with a non-degenerate super-symmetric invariant bilinear form, let $mathfrak{p}$ be a finite dimensional complex super vector space with a non-degenerate super-symmetric bilinear form, and let $ u: mathfrak{r}rightarrowmathfrak{osp}(mathfrak{p})$ be a Lie superalgebra homomorphism. In this paper, we give a necessary and sufficient condition for $mathfrak{r}oplusmathfrak{p}$ to be a quadratic Lie superalgebra. The criterion obtained is an analogue of a constancy condition given by Kostant in the Lie algebra setting. As an application, we prove an analogue of the Parthasarathys formula for the square of the Dirac operator attached to a pair of quadratic Lie superalgebras.