It looks like you're already capturing event40 on click of any star, I would just use js to determine which n-th chld (star) was clicked, or add .star-1, .star-2, .star-3... as classes on each star for exact determination
Then once you know which star, pipe that into an eVar or prop on the event40 rule.
specifically for DTM, you need to determine business case. Are you collecting on click (event40), or on submit of the form.
then you would create a data element to reference in the event rules.
The data element should return which star, and which form option was selected.