数据库遍历生成了一个问卷表单,每个题目包含着choose和tips,我要怎么样才能正常提交这一份问卷数据呢?
目前我提交表单数据为
{
"choose_001":1, "tips_001":"abc",
"choose_002":1, "tips_002":"ab12c",
}
关键的数据能否生成为下面这种数组格式呢?
[
{"questionId":"001", "choose":1, "tips":"abc"},
{"questionId":"002", "choose":2, "tips":"ab12c"}
]