wet,
{
"testName": "Тест",
"questionsList": {
"0": {
"question": "вопрос",
"answerList": {
"0": "ответ 1",
"1": "ответ 2"
}
},
"1": {
"question": "вопрос 2",
"answerList": {
"0": "ответ 3",
"1": "ответ 4"
}
}
}
}
var testList = {
testName: "Тест",
questionsList: {}
};
$(".question").each(function(b, c) {
var a = {},
d = $(this).data("question");
a.question = d;
a.answerList = {};
$(".answer", c).each(function(b, c) {
a.answerList[b] = $(c).data("answer")
});
testList.questionsList[b] = a
});