mirror of
https://github.com/ZetaKebab/japanese-conjugation-drill.git
synced 2025-01-14 22:08:44 +00:00
Added progress bar.
This commit is contained in:
parent
9113878947
commit
d6ebdc5a95
@ -316,3 +316,14 @@ div.halfSpeed {
|
|||||||
font-size: 50%;
|
font-size: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.progressContainer {
|
||||||
|
width: 100vw;
|
||||||
|
height: 5px;
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBar {
|
||||||
|
height: 5px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
@ -218,6 +218,11 @@
|
|||||||
|
|
||||||
<div id="quizSection">
|
<div id="quizSection">
|
||||||
|
|
||||||
|
<div class="progressContainer">
|
||||||
|
<div class="progressBar" style="width: 0%">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="questionOuter">
|
<div class="questionOuter">
|
||||||
<div id="question">
|
<div id="question">
|
||||||
<div id="questionFirstHalf"></div>
|
<div id="questionFirstHalf"></div>
|
||||||
|
@ -557,6 +557,11 @@ function processAnswer() {
|
|||||||
"correct": correct
|
"correct": correct
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var totalQuestions = $('#numQuestions').val();
|
||||||
|
var answeredQuestions = log.history.length;
|
||||||
|
|
||||||
|
updateProgressBar(answeredQuestions / totalQuestions * 100);
|
||||||
|
|
||||||
$('#answer').val("");
|
$('#answer').val("");
|
||||||
$('#responseButton').prop('class', klass).text(response);
|
$('#responseButton').prop('class', klass).text(response);
|
||||||
|
|
||||||
@ -652,6 +657,10 @@ function updateHistoryView(log) {
|
|||||||
$('#scoreSectionTitleWide').text(resultString);
|
$('#scoreSectionTitleWide').text(resultString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateProgressBar(progress) {
|
||||||
|
$('.progressBar').attr('style', 'width: ' + progress + '%');
|
||||||
|
}
|
||||||
|
|
||||||
function proceed() {
|
function proceed() {
|
||||||
if (log.history.length == $('#numQuestions').val()) {
|
if (log.history.length == $('#numQuestions').val()) {
|
||||||
endQuiz();
|
endQuiz();
|
||||||
@ -681,6 +690,8 @@ function startQuiz() {
|
|||||||
voiceSelectError.style.display = "none";
|
voiceSelectError.style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateProgressBar(0);
|
||||||
|
|
||||||
$('#splash').hide();
|
$('#splash').hide();
|
||||||
$('#quizSection').show();
|
$('#quizSection').show();
|
||||||
$('#scoreSection').hide();
|
$('#scoreSection').hide();
|
||||||
|
Loading…
Reference in New Issue
Block a user