Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MCQ Quiz App
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaston Morales
MCQ Quiz App
Commits
ebfa0d3d
Commit
ebfa0d3d
authored
Aug 22, 2023
by
Gaston Morales
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Permite configuração tempo por pergunta (sim/não)
parent
cbf45a07
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
index.html
index.html
+3
-0
perguntas.js
perguntas.js
+1
-0
script.js
script.js
+22
-8
No files found.
index.html
View file @
ebfa0d3d
...
...
@@ -14,6 +14,9 @@
</head>
<body>
<div
class=
"start-screen"
>
<h4>
Tela inicial - blá blá blá inicial
</h4>
<button
id=
"start-button"
>
Iniciar
</button>
</div>
<div
id=
"display-container"
>
...
...
perguntas.js
View file @
ebfa0d3d
...
...
@@ -19,6 +19,7 @@
// type: "noAnswer", // tipo pergunta: answer -> tem resposta certa
// // noAnswer -> não tem resposta certa
// 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
// options: [{ text:"Separo completamente.", score: 2}, // opções de resposta (Array):
// // text: texto da resposta
...
...
script.js
View file @
ebfa0d3d
// Configurções
const
time4Question
=
16
// Baseado no tutorial em https://codingartistweb.com/2022/06/quiz-app-with-javascript/ acessado em 02/08/2023
// 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
let
timeDiv
=
document
.
querySelector
(
".timer-div"
);
let
timeLeft
=
document
.
querySelector
(
".time-left"
);
let
quizContainer
=
document
.
getElementById
(
"container"
);
let
nextBtn
=
document
.
getElementById
(
"next-button"
);
...
...
@@ -70,10 +76,12 @@ nextBtn.addEventListener(
questionCount
+
1
+
" de "
+
quizArray
.
length
+
" perguntas"
;
//display quiz
quizDisplay
(
questionCount
);
if
(
time4Question
>
0
)
{
count
=
time4Question
;
clearInterval
(
countdown
);
timerDisplay
();
}
}
})
);
...
...
@@ -216,9 +224,15 @@ function initial() {
quizContainer
.
innerHTML
=
""
;
questionCount
=
0
;
scoreCount
=
0
;
// if time to answer question is enabled
if
(
time4Question
>
0
)
{
count
=
time4Question
;
clearInterval
(
countdown
);
timerDisplay
();
}
else
{
timeDiv
.
classList
.
add
(
"hide"
);
}
themeList
=
[];
themeListCreator
();
quizCreator
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment