Answer:
spring constant
Step-by-step explanation:
The elastic potential energy is given by:

where
k is the spring constant
x is the compression/stretching of the spring
Therefore, from the formula we see that the elastic potential energy is affected only by k (the spring constant) and x (the distance from the equilibrium position of the spring).
On the contrary, gravitational potential energy is given by:

where
m is the mass of the object
g is the gravitational acceleration
h is the height of the object relative to a certain position
So, we see that gravitational potential energy depends on:
- acceleration due to gravity (g)
- distance from a given position (h)
- amount of matter in the object (the mass, m)
Therefore, the only factor that affects only elastic potential energy but not gravitational potential energy is the spring constant.