Check box not working in JQuery Mobile

Check box not working in JQuery Mobile

I'm a newbie. I'm making a quiz app where the answers that users select give values that total up to a score and take the user to a certain #page depending on their score. The problem is that even if multiple checkboxes are selected in a question, only one of the values associated with only of of the checked answers is tallied in the score. I have no clue how to correct it so that for the check box questions the values of all checked answers are inculded in the final total. 

here is the html code so far. I am also using a canvas wheel of fortune type plugin on #page3: 

<!DOCTYPE html> 
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Mobile Web App</title>
<link href="jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-1.5.min.js" type="text/javascript"></script>
<script src="jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
    
<script src="js/jquery-2.1.0.min.js" type="text/javascript"></script>
<script src="js/ecopquiz2.js" type="text/javascript"></script>
</head> 
<body> 

<div data-role="page" id="page">
<div data-role="header">
<h1>Page One</h1>
</div>
<div data-role="content">
<ul data-role="listview">
<li><a href="#page2">Page Two</a></li>
            <li><a href="#page3">Page Three</a></li>
<li><a href="#page4">Page Four</a></li>
</ul>
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>

<div data-role="page" id="page2">
<div data-role="header">
<h1>Page Two</h1>
</div>
<div data-role="content">
    <form METHOD=POST>
    
    <legend>How do you most often get to school/work:</legend>
        <input type="checkbox"name="answer1" id="answer1a" value="5" checked="checked">
        <label for="answer1a">Walk</label>
        <input type="checkbox" name="answer1" id="answer1b" value="4">
        <label for="answer1b">Ride bicycle</label>
        <input type="checkbox" name="answer1" id="answer1c" value="3">
        <label for="answer1c">Take the school bus</label>
        <input type="checkbox" name="answer1" id="answer1d" value="3">
        <label for="answer1d">Public Transportation</label>
        <input type="checkbox" name="answer1" id="answer1e" value="2">
        <label for="answer1e">Carpool with friends/co-workers</label>
        <input type="checkbox" name="answer1" id="answer1f" value="1">
        <label for="answer1f">Take a taxi</label>
        <input type="checkbox" name="answer1" id="answer1g" value="0">
        <label for="answer1g">Drive</label>
        <input type="checkbox" name="answer1" id="answer1h" value="5">
        <label for="answer1h">I work/school from home</label>         
                    <br />
                    <legend>What are your eating habits:</legend>
        <input type="radio"name="answer2" id="answer2a" value="3" checked="checked">
        <label for="answer2a">I'm a true vegan, I only eat organic greens</label>
        <input type="radio" name="answer2" id="answer2b" value="2">
        <label for="answer2b">I'm a vegetarian, no meat, but I still like cheese omlettes</label>
        <input type="radio" name="answer2" id="answer2c" value="1">
        <label for="answer2c">I'm an omnivore, I eat everything</label>
        <input type="radio" name="answer2" id="answer2d" value="0">
        <label for="answer2d">I'm a carnivore, I eat steak for breakfast</label>
             <br />
              <legend>How often do you eat fast food:</legend>
        <input type="radio"name="answer3" id="answer3a" value="0" checked="checked">
        <label for="answer3a">Three or more times a week</label>
        <input type="radio" name="answer3" id="answer3b" value="1">
        <label for="answer3b">Twice a week</label>
        <input type="radio" name="answer3" id="answer3c" value="2">
        <label for="answer3c">Once a week</label>
        <input type="radio" name="answer3" id="answer3d" value="3">
        <label for="answer3d">I'm a carnivore, I eat steak for breakfast</label>
        <input type="radio" name="answer3" id="answer3d" value="3">
        <label for="answer3d">I'm a carnivore, I eat steak for breakfast</label>
                   
                    <input type="button" value="Take me away" onclick="computeForm(this.form);" /><br /><br />
                </form>
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>

<div data-role="page" id="page3">
<div data-role="header">
<h1>Page Three</h1>
</div>
<div data-role="content">
<!--[if IE]><script type="text/javascript" src="/sites/default/files/1010/source/excanvas.js"></script><![endif]-->
<button id="spin">Spin the Wheel</button>
<canvas id="wheelcanvas" width="250" height="250"></canvas>
<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
<script type="application/javascript">
$.fn.disableFor = function(mins, secs) {
    var i = [],
    play = [];

    this.click(function() {
        var selector = $(this),
        inDex = $(selector).index(),
        prevText = $(selector).text();
        i[inDex] = 0;
        var inSeconds = mins * 60 + secs;

        $(selector).prop("disabled", "disabled");
        
        play[inDex] = setInterval(function() {
            if(inSeconds > 60){
                inSeconds = inSeconds - 1;
                var minutes = Math.floor(inSeconds / 60);
                var seconds = inSeconds % 60;
                if(minutes >= 1){
                    if(seconds.toString().length > 1){
                        $(selector).text(minutes + ":" + seconds + " minutes left");
                    }else{
                        $(selector).text(minutes + ":" + "0" + seconds + " minutes left");
                    }
                }else{
                    $(selector).text(seconds + " seconds left");
                }
            }else{
                if(inSeconds > 1){
                    inSeconds = inSeconds - 1;
                    if(inSeconds.toString().length > 1){
                        $(selector).text(inSeconds + " seconds left");
                    }else{
                        $(selector).text("0" + inSeconds + " seconds left");
                    }
                }else{
                    $(selector).prop("disabled", "");
                    clearInterval(play[inDex]);
                    $(selector).text(prevText);
                }                              
            }
        }, 1000);
    });
};
$("#spin").click(spin).disableFor(2,0);;
  function spin() {
    spinAngleStart = Math.random() * 6 + 6;
    spinTime = 0;
    spinTimeTotal = Math.random() * 3 + 4 * 1000;
    rotateWheel();
  }

  var colors = ["#B8D430", "#3AB745","#FB9A00", "#FFCC00", "#FEF200", "#FEF204"];
  var prizes = ["0", "15", "25", "0",
                     "5", "Free"];
  var restaraunts = ["Try Again Tomorow", "15 Gift Certificate", "25 Gift Certificate", "Try Again Tomorow","5 Gift Certificate", "Free Item"];
  
  
  var startAngle = 0;
  var arc = Math.PI / 3;
  var spinTimeout = true;
  
  var spinArcStart = 6;
  var spinTime = 0;
  var spinTimeTotal = 0;
  
  var ctx;
  
  function draw() {
    drawRouletteWheel();
  }
  
  function drawRouletteWheel() {
    var canvas = document.getElementById("wheelcanvas");
    if (canvas.getContext) {
      var outsideRadius = 100;
      var textRadius = 80;
      var insideRadius = 64;
      
      ctx = canvas.getContext("2d");
      ctx.clearRect(0,0,250,250);
      
      
      ctx.strokeStyle = "black";
      ctx.lineWidth = 2;
      
      ctx.font = 'bold 12px sans-serif';
      
      for(var i = 0; i < 6; i++) {
        var angle = startAngle + i * arc;
        ctx.fillStyle = colors[i];
        
        ctx.beginPath();
        ctx.arc(125, 125, outsideRadius, angle, angle + arc, false);
        ctx.arc(125, 125, insideRadius, angle + arc, angle, true);
        ctx.stroke();
        ctx.fill();
        
        ctx.save();
        ctx.shadowOffsetX = -1;
        ctx.shadowOffsetY = -1;
        ctx.shadowBlur    = 0;
        ctx.shadowColor   = "rgb(220,220,220)";
        ctx.fillStyle = "black";
        ctx.translate(125 + Math.cos(angle + arc / 2) * textRadius, 125 + Math.sin(angle + arc / 2) * textRadius);
        ctx.rotate(angle + arc / 2 + Math.PI / 2);
        var text = prizes[i];
        ctx.fillText(text, -ctx.measureText(text).width / 2, 0);
        ctx.restore();
      } 
      
      //Arrow
      ctx.fillStyle = "black";
      ctx.beginPath();
      ctx.moveTo(125 - 4, 125 - (outsideRadius + 5));
      ctx.lineTo(125 + 4, 125 - (outsideRadius + 5));
      ctx.lineTo(125 + 4, 125 - (outsideRadius - 5));
      ctx.lineTo(125 + 9, 125 - (outsideRadius - 5));
      ctx.lineTo(125 + 0, 125 - (outsideRadius - 13));
      ctx.lineTo(125 - 9, 125 - (outsideRadius - 5));
      ctx.lineTo(125 - 4, 125 - (outsideRadius - 5));
      ctx.lineTo(125 - 4, 125 - (outsideRadius + 5));
      ctx.fill();
    }
  }
  
  function spin() {
    spinAngleStart = Math.random() * 6 + 6;
    spinTime = 0;
    spinTimeTotal = Math.random() * 3 + 4 * 1000;
    rotateWheel();
  }
  
  function rotateWheel() {
    spinTime += 30;
    if(spinTime >= spinTimeTotal) {
      stopRotateWheel();
      return;
    }
    var spinAngle = spinAngleStart - easeOut(spinTime, 0, spinAngleStart, spinTimeTotal);
    startAngle += (spinAngle * Math.PI / 180);
    drawRouletteWheel();
    spinTimeout = setTimeout('rotateWheel()', 30);
  }
  
  function stopRotateWheel() {
    clearTimeout(spinTimeout);
    var degrees = startAngle * 180 / Math.PI + 90;
    var arcd = arc * 180 / Math.PI;
    var index = Math.floor((360 - degrees % 360) / arcd);
    ctx.save();
    ctx.font = 'bold 14px sans-serif';
    var text = restaraunts[index]
    ctx.fillText(text, 125 - ctx.measureText(text).width / 2, 125 + 6);
    ctx.restore();
  }
  
  function easeOut(t, b, c, d) {
    var ts = (t/=d)*t;
    var tc = ts*t;
    return b+c*(tc + -3*ts + 3*t);
  }
  
  draw();
</script> 
</div>
    <a href="#page4" data-role="button">Next</a>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>

<div data-role="page" id="page4">
<div data-role="header">
<h1>HOORAY</h1>
</div>
<div data-role="content">
   
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>
<div data-role="page" id="page5">
<div data-role="header">
<h1>five</h1>
</div>
<div data-role="content">
   
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>
<div data-role="page" id="page6">
<div data-role="header">
<h1>six</h1>
</div>
<div data-role="content">
   
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>
<div data-role="page" id="page7">
<div data-role="header">
<h1>seven</h1>
</div>
<div data-role="content">
   
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
    <div data-role="page" id="page8">
<div data-role="header">
<h1>eight</h1>
</div>
<div data-role="content">
   
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>
</div>
</body>
</html>



This is the JQuery for the quiz, ecopquiz2.js

function getValue(name){
var s =0;
var o = document.getElementsByName(name);
for (var n = 0; n < o.length; n++){
    if (o.item(n).checked){
        s = parseInt(o.item(n).value);
    }
}

return s;
}


function computeForm(form) {
var total;

var answer1 = parseInt(getValue('answer1'));
var answer2 = parseInt(getValue('answer2'));
var answer3 = parseInt(getValue('answer3'));
var answer4 = parseInt(getValue('answer4'));
var answer5 = parseInt(getValue('answer5'));
var answer6 = parseInt(getValue('answer6'));
var answer7 = parseInt(getValue('answer7'));
var answer8 = parseInt(getValue('answer8'));
var answer9 = parseInt(getValue('answer9'));
var answer10 = parseInt(getValue('answer10'));
var answer11 = parseInt(getValue('answer11'));
var answer12 = parseInt(getValue('answer12'));
var answer13 = parseInt(getValue('answer13'));
var answer14 = parseInt(getValue('answer14'));
var answer15 = parseInt(getValue('answer15'));

total = (answer1 + answer2 + answer3 + answer4 + answer5 + answer6 + answer7 + answer8 + answer9 + answer10 + answer11 + answer12 + answer13 + answer14 + answer15);

console.log(total);   

if (total==0){ window.location.hash=""; }
else if (total >0 && total<=7){ window.location.hash="#page3"; }
else if (total >7 && total<=14){ console.log('hit'); window.location.hash="#page4"; }
else if (total >14 && total<=21){ window.location.hash="#page5"; }
else if (total >21 && total<=35){ window.location.hash="#page6"; }
else if (total >35 && total<=42){ window.location.hash="#page7"; }
else if (total >42 && total<=49){ window.location.hash="#page8"; }
else if (total > 49){ window.location.hash="#page3"; }
}


Any help would be very appreciated thanks