save and update values using record type in a local variable/local variable

I have a problem to run quiz using 10 questions answers in in foreach loop. I want to save values in a local or rule variable. (question id with selected answer value) 

If user modify his answer, then selected Ans value changed with new selected option.

I want to do with record type.

  Discussion posts and replies are publicly visible