Loading index.html +3 −0 Original line number Original line Diff line number Diff line Loading @@ -14,6 +14,9 @@ </head> </head> <body> <body> <div class="start-screen"> <div class="start-screen"> <h4> Tela inicial - blá blá blá inicial </h4> <button id="start-button">Iniciar</button> <button id="start-button">Iniciar</button> </div> </div> <div id="display-container"> <div id="display-container"> Loading perguntas.js +1 −0 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ // type: "noAnswer", // tipo pergunta: answer -> tem resposta certa // type: "noAnswer", // tipo pergunta: answer -> tem resposta certa // // noAnswer -> não tem resposta certa // // noAnswer -> não tem resposta certa // theme: "Gestão Financeira", // tema da pergunta // theme: "Gestão Financeira", // tema da pergunta // themeIndex: 1 // Index do tema na lista de temas [0...total de temas-1] // question: "Separa o dinheiro pessoal do dinheiro da empresa?", // pergunta // question: "Separa o dinheiro pessoal do dinheiro da empresa?", // pergunta // options: [{ text:"Separo completamente.", score: 2}, // opções de resposta (Array): // options: [{ text:"Separo completamente.", score: 2}, // opções de resposta (Array): // // text: texto da resposta // // text: texto da resposta Loading script.js +22 −8 Original line number Original line Diff line number Diff line // Configurções // Baseado no tutorial em https://codingartistweb.com/2022/06/quiz-app-with-javascript/ acessado em 02/08/2023 const time4Question = 16 // Adaptado para pt-BR e acrescentadas fncionalidades adicionais por Gastón Morales@Faros Educacional // // Configurações const time4Question = 0 // tempo em segundos (+1) para cada pergunta ser respondida, se 0 (zero) não tem tempo const porTemas = false // perguntas apresentadas agrupadas por tema (true) ou não (false) //References //References let timeDiv = document.querySelector(".timer-div"); let timeLeft = document.querySelector(".time-left"); let timeLeft = document.querySelector(".time-left"); let quizContainer = document.getElementById("container"); let quizContainer = document.getElementById("container"); let nextBtn = document.getElementById("next-button"); let nextBtn = document.getElementById("next-button"); Loading Loading @@ -70,10 +76,12 @@ nextBtn.addEventListener( questionCount + 1 + " de " + quizArray.length + " perguntas"; questionCount + 1 + " de " + quizArray.length + " perguntas"; //display quiz //display quiz quizDisplay(questionCount); quizDisplay(questionCount); if ( time4Question > 0 ) { count = time4Question; count = time4Question; clearInterval(countdown); clearInterval(countdown); timerDisplay(); timerDisplay(); } } } }) }) ); ); Loading Loading @@ -216,9 +224,15 @@ function initial() { quizContainer.innerHTML = ""; quizContainer.innerHTML = ""; questionCount = 0; questionCount = 0; scoreCount = 0; scoreCount = 0; // if time to answer question is enabled if ( time4Question > 0 ) { count = time4Question; count = time4Question; clearInterval(countdown); clearInterval(countdown); timerDisplay(); timerDisplay(); } else { timeDiv.classList.add("hide"); } themeList = []; themeList = []; themeListCreator(); themeListCreator(); quizCreator(); quizCreator(); Loading Loading
index.html +3 −0 Original line number Original line Diff line number Diff line Loading @@ -14,6 +14,9 @@ </head> </head> <body> <body> <div class="start-screen"> <div class="start-screen"> <h4> Tela inicial - blá blá blá inicial </h4> <button id="start-button">Iniciar</button> <button id="start-button">Iniciar</button> </div> </div> <div id="display-container"> <div id="display-container"> Loading
perguntas.js +1 −0 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ // type: "noAnswer", // tipo pergunta: answer -> tem resposta certa // type: "noAnswer", // tipo pergunta: answer -> tem resposta certa // // noAnswer -> não tem resposta certa // // noAnswer -> não tem resposta certa // theme: "Gestão Financeira", // tema da pergunta // theme: "Gestão Financeira", // tema da pergunta // themeIndex: 1 // Index do tema na lista de temas [0...total de temas-1] // question: "Separa o dinheiro pessoal do dinheiro da empresa?", // pergunta // question: "Separa o dinheiro pessoal do dinheiro da empresa?", // pergunta // options: [{ text:"Separo completamente.", score: 2}, // opções de resposta (Array): // options: [{ text:"Separo completamente.", score: 2}, // opções de resposta (Array): // // text: texto da resposta // // text: texto da resposta Loading
script.js +22 −8 Original line number Original line Diff line number Diff line // Configurções // Baseado no tutorial em https://codingartistweb.com/2022/06/quiz-app-with-javascript/ acessado em 02/08/2023 const time4Question = 16 // Adaptado para pt-BR e acrescentadas fncionalidades adicionais por Gastón Morales@Faros Educacional // // Configurações const time4Question = 0 // tempo em segundos (+1) para cada pergunta ser respondida, se 0 (zero) não tem tempo const porTemas = false // perguntas apresentadas agrupadas por tema (true) ou não (false) //References //References let timeDiv = document.querySelector(".timer-div"); let timeLeft = document.querySelector(".time-left"); let timeLeft = document.querySelector(".time-left"); let quizContainer = document.getElementById("container"); let quizContainer = document.getElementById("container"); let nextBtn = document.getElementById("next-button"); let nextBtn = document.getElementById("next-button"); Loading Loading @@ -70,10 +76,12 @@ nextBtn.addEventListener( questionCount + 1 + " de " + quizArray.length + " perguntas"; questionCount + 1 + " de " + quizArray.length + " perguntas"; //display quiz //display quiz quizDisplay(questionCount); quizDisplay(questionCount); if ( time4Question > 0 ) { count = time4Question; count = time4Question; clearInterval(countdown); clearInterval(countdown); timerDisplay(); timerDisplay(); } } } }) }) ); ); Loading Loading @@ -216,9 +224,15 @@ function initial() { quizContainer.innerHTML = ""; quizContainer.innerHTML = ""; questionCount = 0; questionCount = 0; scoreCount = 0; scoreCount = 0; // if time to answer question is enabled if ( time4Question > 0 ) { count = time4Question; count = time4Question; clearInterval(countdown); clearInterval(countdown); timerDisplay(); timerDisplay(); } else { timeDiv.classList.add("hide"); } themeList = []; themeList = []; themeListCreator(); themeListCreator(); quizCreator(); quizCreator(); Loading