ProvaObjetiva / index.html
healthtechbrasil's picture
unicamp fix com json
ffa0c53
raw
history blame
1.05 kB
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Simulado USP</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
h1 { color: #2c3e50; }
button { padding: 10px 20px; background: #3498db; color: white; border: none; cursor: pointer; }
button:hover { background: #2980b9; }
#questions { margin-top: 20px; }
ul { list-style-type: upper-alpha; padding-left: 20px; }
li { margin-bottom: 5px; }
.question { border-bottom: 1px solid #ecf0f1; padding-bottom: 10px; margin-bottom: 10px; }
</style>
</head>
<body>
<h1>Simulado</h1>
<button onclick="loadSimulado()">Carregar</button>
<div id="questions"></div>
<script>
async function loadSimulado() {
const response = await fetch('/simulado?num_questions=5');
const data = await response.json();
const questionsDiv = document.getElementById('questions');
questionsDiv.innerHTML = data.simulado.map(q => `<div class="question">${q.question.replace(/\n/g, '<br>')}</div>`).join('');
}
</script>
</body>
</html>