function getPoll(poll, done) {
    $.ajax({
        url: '/' + poll,
        type: "GET",
        cache: false,
        success: function(data) {
            done(null, data);
        },
        error: function(xhr, status, err) {
            done(new Error(err));
        }
    });
}

function getAnswers(poll, done) {
    $.ajax({
        url: '/' + poll + '/resultados',
        type: "GET",
        cache: false,
        success: function(data) {
            done(null, data);
        },
        error: function(xhr, status, err) {
            done(new Error(err));
        }
    });
}

function postAnswers(poll, answers, done) {
    $.ajax({
        url: '/' + poll,
        type: "POST",
        data: answers,
        dataType: 'json',
        cache: false,
        success: function(data) {
            done(null, data);
        },
        error: function(xhr, status, err) {
            done(new Error(err));
        }
    });
}

$(function() {
    var name = $(".poll").attr('data-poll-name');
    console.log(name);

    getPoll(name, function(err, res) {
        if (err) {
            console.log(err);
        } else {
            $.each(res, function(id_p, val_p) {
                console.log(val_p);
                $(".poll").append("<p>" + val_p.question + "</p>");
                var def = false;

                $.each(val_p.options, function(id_r, val_r) {
                    if (!def) {
                        $(".poll").append("<input type='radio' name='" + id_p + "' value='" + id_r + "' checked='checked'>" + val_r + "<br>");
                        def = true;
                    } else {
                        $(".poll").append("<input type='radio' name='" + id_p + "' value='" + id_r + "'>" + val_r + "<br>");
                    }
                });
            });

            //$(".poll").text(JSON.stringify(res));
        }
    });

    $("#enviar").click(function() {
        var answers = new Array();

        $.each($('input[type=radio]'), function() {
            if ($(this).is(":checked")) {
                console.log("Question: " + $(this).attr("name") + " - Answer: " + $(this).val());
                answers.push($(this).val());
            }
        });
    });

});

@@ -1167,16 +1167,20 @@
 (id_
-p
+que
 , val_
-p
+que
 ) %7B%0A
@@ -1211,17 +1211,19 @@
 log(val_
-p
+que
 );%0A     
@@ -1263,17 +1263,19 @@
 %22 + val_
-p
+que
 .questio
@@ -1348,17 +1348,19 @@
 ach(val_
-p
+que
 .options
@@ -1377,16 +1377,20 @@
 (id_
-r
+ans
 , val_
-r
+ans
 ) %7B%0A
@@ -1486,36 +1486,42 @@
 adio' name='%22 + 
+val_que.
 id
-_p
  + %22' value='%22 +
@@ -1520,25 +1520,27 @@
 lue='%22 + id_
-r
+ans
  + %22' checke
@@ -1551,33 +1551,35 @@
 hecked'%3E%22 + val_
-r
+ans
  + %22%3Cbr%3E%22);%0A    
@@ -1716,12 +1716,18 @@
 %22 + 
+val_que.
 id
-_p
  + %22
@@ -1742,17 +1742,19 @@
 '%22 + id_
-r
+ans
  + %22'%3E%22 
@@ -1759,17 +1759,19 @@
 %22 + val_
-r
+ans
  + %22%3Cbr%3E
@@ -1952,18 +1952,210 @@
     
-var answer
+function Answer(id, answer) %7B%0A            this.id = id;%0A            this.answer = answer;%0A        %7D%0A%0A        function Answers(answers) %7B%0A            this.answers = answers;%0A        %7D%0A%0A        var result
 s = 
@@ -2270,32 +2270,34 @@
                 
+//
 console.log(%22Que
@@ -2382,60 +2382,223 @@
     
+var 
 answer
-s.push($(this).val());%0A            %7D%0A        %7D
+ = new Answer($(this).attr(%22name%22), $(this).val());%0A                results.push(answer);%0A            %7D%0A        %7D);%0A%0A        var answers = new Answers(results);%0A%0A        console.log(JSON.stringify(answers)
 );%0A 

Corrige formato de respuestas. Ref #14