title: Store quiz answers in AngularJS
body: <p>I am trying to build a quiz with AngularJS. I get the questions to show up as     I like, but wonder how I could possibly store the answer of each question to the object that it is connected to? I want each object to get a value of <code>yes</code> or <code>no</code>.</p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div class="container answerquestions" ng-controller="MainController"&gt;
      &lt;div class="card text-center"&gt;
          &lt;div ng-repeat="question in questions"&gt;
              &lt;div class="card-body" id="{{question.id}}"&gt;
                  &lt;h4 class="card-title"&gt;{{settitle}}&lt;/h4&gt;
                  &lt;p class="card-text container"&gt;&lt;/p&gt;
                  &lt;p class="card-text container"&gt;{{question.questiontext}}&lt;/p&gt;
                  &lt;div class="form-check form-check-inline"&gt;
                      &lt;label class="form-check-label"&gt;&lt;input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"&gt; Yes &lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="form-check form-check-inline"&gt;
                      &lt;label class="form-check-label"&gt;&lt;input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"&gt; No &lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="card-footer"&gt;
              &lt;nav aria-label="Page navigation example" class="pageshower"&gt;
                  &lt;ul class="pagination justify-content-center"&gt;
                      &lt;li class="page-item disabled"&gt;
                          &lt;a class="page-link" href="#" tabindex="-1"&gt;Previous&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li ng-repeat="question in questions" class="page-item"&gt;
                          &lt;a class="page-link" href="#{{question.id}}"&gt;{{question.number}}&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="page-item disabled"&gt;
                          &lt;a class="page-link" href="#"&gt;Next&lt;/a&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/nav&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My AngularJS:</p>
  
  <pre><code>app.controller('MainController', ['$scope', function($scope) { 
      $scope.settitle = 'Konflikter';
      $scope.questions = [
          { 
              number: 1,
              id: 'a',
              questiontext: 'Question 1?'
          },
          { 
              number: 2,
              id: 'b',
              questiontext: 'Question 2?'
          },
          { 
              number: 3,
              id: 'c',
              questiontext: 'Question 3?'
          }
      ];
  }]);
  </code></pre>