
// JSON example
var candidates = [ {
  "name": "Ellie Phanta",
  "party": "Republican",
  "stance1" : -2
  },
  {
  "name": "Jack Bass",
  "party": "Democrat",
  "stance1" : -2
  },
  {
  "name": "Paul Stanton",
  "party": "Libertarian",
  "stance1" : 2
  }
 ];

Questions = [ 
  {
  "Question" : "Should goods and services be provided by force?",
  "Responses" : [
    ["Absolutely",-2],
    ["Yes", -1],
    ["Maybe", 0],
    ["No", 1],
    ["Never", 2]]
},
   {
  "Question" : "Without government, Who will build the roads?",
  "Responses" : [
    ["No one at all",-2],
    ["Shady people you can't trust", -1],
    ["Someone might maybe possibly", 0],
    ["Construction companies", 1],
    ["Where we're going, we won't need roads.", 2]]
},            
];

responses = [];
for (i = 0; i < Questions.length; i++) {
 responses.push(0);
}

function loadQuestions() {
  var chunk = '';
  for (i = 0; i < Questions.length; i++) {
    chunk += '<div id="q' + i + '>'; 
    chunk += '<p class="question">' + Questions[i].Question + '</p>';
    chunk += '<p class="answers">';
    for (j = 0; j < Questions[i].Responses.length; j++) {
     var qr = Questions[i].Responses[j];
     chunk += '<button onclick="tally(' + i + ',' + qr[1] + ')">' + qr[0] + '</button>';
    }
    chunk += '</p></div>';
  }
  document.getElementById("questionArea").innerHTML = chunk;
};

function tally(questionNumber,response) {
  //qId = 'q' + questionNumber;
  responses[questionNumber] = response;
  document.getElementById("test").innerHTML = responses;
  //document.getElementById(qId).innerHTML = 'Response Recorded';
}

loadQuestions();

@@ -756,25 +756,146 @@
    %0A%5D;%0A%0A
-responses
+Imports = %5B%5B%22Could not care less%22,-2%5D,%5B%22Don't care%22,-1%5D,%5B%22Might care%22,0%5D,%5B%22Care%22,1%5D,%5B%22Care a lot%22,2%5D%5D;%0A%0Aresponses = %5B%5D;%0Aimportance
  = %5B%5D;%0Af
@@ -954,16 +954,37 @@
 ush(0);%0A
+ importance.push(0);%0A
 %7D%0A%0Afunct
@@ -1418,16 +1418,239 @@
 unk += '
+%3C/p%3E';%0A    chunk += '%3Cp class=%22importance%22%3E';%0A    for (k = 0; k %3C Imports.length; k++) %7B%0A     chunk += '%3Cbutton onclick=%22tallyImport(' + i + ',' + Imports%5Bk%5D%5B1%5D + ')%22%3E' + Imports%5Bk%5D%5B0%5D + '%3C/button%3E';%0A    %7D    %0A    chunk += 
 %3C/p%3E%3C/di
@@ -1963,16 +1963,266 @@
 ed';%0A%7D%0A%0A
+function tallyImports(questionNumber,response) %7B%0A  //qId = 'q' + questionNumber;%0A  importance%5BquestionNumber%5D = response;%0A  document.getElementById(%22test2%22).innerHTML = importance;%0A  //document.getElementById(qId).innerHTML = 'Response Recorded';%0A%7D%0A%0A
 loadQues

Update wme.js