// function newquestion(q) { // $('#title').html(q["title"]); // $('#text').html(q["text"]); // switch (q["type"]) { // case "information": // case "warning": // case "alert": // $('#answer').html(""); // break; // case "text": // case "text_regex": // $('#answer').html(` //
// //
// `); // // // break; // case "radio": // case "checkbox": // // $('#answer').html(nunjucks.renderString('

{{title}}

{{type}}', data)); // FIXME should not be public // // $('#answer').html(render('question-radio.html', data)); // $('#answer').html(nunjucks.renderString(` //
//
// {% for opt in options %} // // // {{ opt }} // // {% else %} // No options????? FIXME // {% endfor %} //
//
// // `, q)); // $("submit").click(function (e) { // e.preventDefault(); // }); // break; // default: // $('#answer').html("Tipo de pergunta desconhecido: " + data["type"]); // } // $("#actions").html(` // `); // } // function get_question() { // } // $(document).ready(function() { // // nunjucks.configure("/static/tmpl", {"autoescape": false}); // FIXME // // get question // $.ajax({ // url: "/question", // context: document.body; // // dataType: "json", // success: function(response){ // $("#question").html(response); // }, // error: function() {alert("Servidor não responde.");} // }); // });