Possible Duplicate:
Excel to various JSON objects
I’ve started to use SlickQuiz which is a jQuery plugin. In there, the questions are added to the quiz using a JSON object. See an example here. Rather than modify this by hand each time I generate I new quiz, is there a way to generate this from say an Excel table or similar?
If so, then firstly, I can’t understand what the structure of the (Excel) table would need to be like to get the nested structure in JSON. Can you help? And, is there a good existing serialiser (right term?) out there?
Open to suggestions…
If your structure is not too deeply nested, you could write the structure out, and reserve a limited number of columns for answers (for example 4). You Excel file would have two sheets: one with the contents of info in a simple two column list, and one with the questions, having the following column names:
If you keep the column names corresponding with the path of the fields as they will appear in the JSON structure, it will be quite easy to parse the table structure into JSON and back.
However, it will be a cumbersome solution anyway. Can’t you edit your JSON structure using a JSON editor like http://jsoneditoronline.org? Or implement a simple admin page on your website where you can edit the quiz? that will be quite easy to make using the library from jsoneditoronline: https://github.com/josdejong/jsoneditoronline/wiki