(Aún no he decidido cuáles serán exactamente las preguntas y opciones). Puede ver debajo del objeto de análisis que he intentado crear el cuestionario usando el formulario. Cuando intento ejecutar este código, no aparece nada. ¿Qué estoy haciendo mal? Realmente, realmente aprecio cualquier ayuda.
const json = { quiz: { q1: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } , q2: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } , q3: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } , q4: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } } } var obj = JSON.parse(JSON.stringify(json)); console.log(obj); for (let i = 0; i < obj.quiz.length; i++) { document.body.innerHTML += '<h2>' + obj.quiz[i].question + '</h2>' document.body.innerHTML += '<form>' + '<input type="radio" name="options" value="option">' + '<label for="option">' + obj.quiz[i].options + '</label>' + '<br>' + '</form>' }