Populating a hidden radio input

I read through the previous discussions about populating simple hidden input fields (by using the built-in data-rateit-backingfld="#ID" functionality), but I'm struggling to get my Javascript to auto-populate a hidden radio input, which has separate
IDs for each choice. Here's a JSfiddle example, with my custom javascript that's supposed to populate the radios in realtime at the bottom. Any ideas how to make this work, or will I need to switch to single ID input fields (like a hidden number input)?

Answered my own question with the help of a friend. Basically I was trying to append the value to the variable name before the star was clicked, and I was using "selected" instead of "checked." Here's a working version: