1º caso: Escrevendo um Número em Notação Científica
Pontos: 0
Quiz Finalizado!
const quizData = [
{
question: "Qual é a forma correta de escrever o número 0,005 em notação científica?",
options: ["5 x 10³", "5 x 10⁻²", "5 x 10⁻³", "0.5 x 10⁻²"],
answer: "5 x 10⁻³"
},
{
question: "Como o número 0,00078 é representado em notação científica?",
options: ["7.8 x 10⁻⁴", "7.8 x 10⁴", "78 x 10⁻⁵", "0.78 x 10⁻³"],
answer: "7.8 x 10⁻⁴"
},
{
question: "A notação científica 3.4 x 10⁻³ corresponde a qual número decimal?",
options: ["3400", "0.034", "0.00034", "0.0034"],
answer: "0.0034"
},
{
question: "Qual das seguintes opções representa o número 0,00001?",
options: ["1 x 10⁵", "1 x 10⁻⁴", "1 x 10⁻⁵", "10 x 10⁻⁶"],
answer: "1 x 10⁻⁵"
},
{
question: "Escreva 0,00901 em notação científica.",
options: ["9.01 x 10²", "9.01 x 10⁻³", "90.1 x 10⁻⁴", "901 x 10⁻⁵"],
answer: "9.01 x 10⁻³"
},
{
question: "O número 0,00000825 em notação científica é:",
options: ["8.25 x 10⁶", "8.25 x 10⁻⁷", "82.5 x 10⁻⁷", "8.25 x 10⁻⁶"],
answer: "8.25 x 10⁻⁶"
},
{
question: "Qual número decimal é representado por 6.0 x 10⁻⁷?",
options: ["0.0000006", "0.00006", "6000000", "0.000006"],
answer: "0.0000006"
},
{
question: "A espessura de uma folha de papel é de aproximadamente 0,0001 metros. Como isso é escrito em notação científica?",
options: ["1 x 10⁻⁴ m", "1 x 10⁴ m", "0.1 x 10⁻³ m", "10 x 10⁻⁵ m"],
answer: "1 x 10⁻⁴ m"
},
{
question: "Qual opção está INCORRETA?",
options: ["0.45 = 4.5 x 10⁻¹", "0.002 = 2 x 10⁻²", "0.00099 = 9.9 x 10⁻⁴", "0.1 = 1 x 10⁻¹"],
answer: "0.002 = 2 x 10⁻²"
},
{
question: "Converta 4.56 x 10⁻⁵ para a forma decimal.",
options: ["0.000456", "456000", "0.0000456", "0.00000456"],
answer: "0.0000456"
}
];
// Elementos do DOM
const questionArea = document.getElementById('question-area');
const questionCounterEl = document.getElementById('question-counter');
const scoreDisplayEl = document.getElementById('score-display');
const questionTextEl = document.getElementById('question-text');
const optionsContainerEl = document.getElementById('options-container');
const feedbackTextEl = document.getElementById('feedback-text');
const tryAgainBtn = document.getElementById('try-again-btn');
const resultsContainer = document.getElementById('results-container');
const performanceTextEl = document.getElementById('performance-text');
const restartBtn = document.getElementById('restart-btn');
const lessonBtn = document.getElementById('lesson-btn');
// Variáveis do quiz
let currentQuestionIndex = 0;
let score = 0;
function startQuiz() {
currentQuestionIndex = 0;
score = 0;
questionArea.classList.remove('hide');
resultsContainer.classList.add('hide');
updateScoreDisplay();
showQuestion();
}
function showQuestion() {
resetState();
const currentQuestion = quizData[currentQuestionIndex];
questionCounterEl.innerText = `Questão ${currentQuestionIndex + 1} de ${quizData.length}`;
// Para exibir a notação científica corretamente no HTML
const formattedQuestion = currentQuestion.question.replace(/(\d+(\.\d+)?\s?x\s?10⁻?\d+)/g, '
$1');
questionTextEl.innerHTML = formattedQuestion;
currentQuestion.options.forEach(option => {
const button = document.createElement('button');
button.innerText = option;
button.classList.add('option-btn');
button.addEventListener('click', () => selectAnswer(button, option));
optionsContainerEl.appendChild(button);
});
}
function resetState() {
feedbackTextEl.innerText = '';
tryAgainBtn.classList.add('hide');
while (optionsContainerEl.firstChild) {
optionsContainerEl.removeChild(optionsContainerEl.firstChild);
}
}
function selectAnswer(button, selectedOption) {
const correct = selectedOption === quizData[currentQuestionIndex].answer;
// Desabilitar todos os botões após a escolha
Array.from(optionsContainerEl.children).forEach(btn => {
btn.disabled = true;
});
if (correct) {
button.classList.add('correct');
feedbackTextEl.innerText = 'RESPOSTA CORRETA';
feedbackTextEl.style.color = '#155724';
score++;
updateScoreDisplay();
setTimeout(nextQuestion, 1500); // Avança para a próxima pergunta após 1.5s
} else {
button.classList.add('incorrect');
feedbackTextEl.innerText = 'RESPOSTA INCORRETA';
feedbackTextEl.style.color = '#721c24';
tryAgainBtn.classList.remove('hide'); // Mostra o botão de tentar novamente
}
}
function nextQuestion() {
currentQuestionIndex++;
if (currentQuestionIndex < quizData.length) {
showQuestion();
} else {
showResults();
}
}
function tryAgain() {
// Habilitar os botões novamente
Array.from(optionsContainerEl.children).forEach(btn => {
btn.disabled = false;
btn.classList.remove('incorrect');
});
feedbackTextEl.innerText = '';
tryAgainBtn.classList.add('hide');
}
function updateScoreDisplay() {
scoreDisplayEl.innerText = `Pontos: ${score}`;
}
function showResults() {
questionArea.classList.add('hide');
resultsContainer.classList.remove('hide');
performanceTextEl.innerText = `Você acertou ${score} de ${quizData.length} questões!`;
}
// Event Listeners
tryAgainBtn.addEventListener('click', tryAgain);
restartBtn.addEventListener('click', startQuiz);
lessonBtn.addEventListener('click', () => {
// Você pode substituir este link por qualquer vídeo ou artigo que preferir
window.open('https://www.youtube.com/watch?v=s5ZAP4pX2xA', '_blank');
});
// Iniciar o quiz quando a página carregar
startQuiz();