Data/Hora | Alternativa Escolhida | Resultado |
---|
Nenhuma resposta registrada ainda
' ); } // Gráfico de acertos individuais if (data.estatisticas_gerais) { const acertosCtx = document.getElementById(`acertosChart_${questaoId}`).getContext('2d'); new Chart(acertosCtx, { type: 'pie', data: { labels: ['Acertos', 'Erros'], datasets: [{ data: [ parseInt(data.estatisticas_gerais.total_acertos) || 0, parseInt(data.estatisticas_gerais.total_erros) || 0 ], backgroundColor: [ 'rgba(75, 192, 192, 0.5)', 'rgba(255, 99, 132, 0.5)' ], borderColor: [ 'rgba(75, 192, 192, 1)', 'rgba(255, 99, 132, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { position: 'bottom' }, tooltip: { callbacks: { label: function(context) { const value = context.raw; return `${context.label}: ${value} resposta${value !== 1 ? 's' : ''}`; } } } } } }); } else { $(`#acertosChart_${questaoId}`).parent().html( 'Nenhuma resposta registrada ainda
' ); } // Gráfico de acertos gerais if (data.estatisticas_gerais) { const acertosGeraisCtx = document.getElementById(`acertosGeraisChart_${questaoId}`).getContext('2d'); new Chart(acertosGeraisCtx, { type: 'pie', data: { labels: ['Acertos Gerais', 'Erros Gerais'], datasets: [{ data: [ parseFloat(data.estatisticas_gerais.percentual_acertos) || 0, parseFloat(data.estatisticas_gerais.percentual_erros) || 0 ], backgroundColor: [ 'rgba(75, 192, 192, 0.5)', 'rgba(255, 99, 132, 0.5)' ], borderColor: [ 'rgba(75, 192, 192, 1)', 'rgba(255, 99, 132, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { position: 'bottom' }, tooltip: { callbacks: { label: function(context) { const value = context.raw; const total = data.estatisticas_gerais.total_respostas; const count = context.dataIndex === 0 ? data.estatisticas_gerais.total_acertos : data.estatisticas_gerais.total_erros; return `${value.toFixed(1)}% (${count} respostas)`; }, afterLabel: function(context) { const total = data.estatisticas_gerais.total_respostas; const alunos = data.estatisticas_gerais.total_alunos; if (context.dataIndex === 0) { return `Total de alunos: ${alunos}`; } return ''; } } }, title: { display: true, text: `Total de ${data.estatisticas_gerais.total_respostas} respostas`, position: 'bottom', padding: { top: 10, bottom: 0 }, font: { size: 12 } } } } }); } else { $(`#acertosGeraisChart_${questaoId}`).parent().html( 'Nenhuma resposta registrada ainda
' ); } // Preencher histórico const $historico = $(`#historicoRespostas_${questaoId}`); $historico.empty(); if (data.historico && data.historico.length > 0) { data.historico.forEach(h => { const letraAtual = mapeamentoRespostas[h.resposta_usuario] || '?'; $historico.append(`Detalhes: ${e.message}
${response}
Status: ${status}
Erro: ${error}
${xhr.responseText}
${anotacao.enunciado}