I h've an array of object of Questions @questions
---
- !ruby/object:Question
attributes:
id: "1"
answer: "2"
- !ruby/object:Question
attributes:
id: "7"
answer: "1"
- !ruby/object:Question
attributes:
id: "6"
answer: "4"
- !ruby/object:Question
attributes:
id: "4"
answer: "1"
And an Array of Answers @answers
--- !map:ActiveSupport::HashWithIndifferentAccess
"1": "2"
"7": "3"
"6": "4"
"4": "0"
How can i validate Answers against Questions with any loop mechanism?
In the above example only the answer for the first question is correct, i need to get out put as an array like one below
--- !map:ActiveSupport::HashWithIndifferentAccess
"1": true
"7": false
"6": false
"4": false