Step-by-step explanation:
The energy stored in an elastic objects as a result of deformation is called elastic potential energy. The energy stored in a spring is given by :

Where
k = spring constant
x = compression or stretching in an spring
While gravitational potential energy is given by :
PE = mgh
where
m = mass
g = acceleration due to gravity
h = height from ground
So, the factor affecting elastic potential energy but not gravitational potential energy is " spring constant ".