File size: 1,048 Bytes
0614e7d
 
ffa0c53
 
 
 
 
 
 
 
 
 
 
 
 
0614e7d
 
 
 
 
 
 
 
ffa0c53
 
0614e7d
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!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>