update progress tracker
This commit is contained in:
parent
c293f2e4f9
commit
c5b4008519
1 changed files with 20 additions and 0 deletions
20
index.html
20
index.html
|
|
@ -435,10 +435,30 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
function displayQuestion(questionId=1) {
|
function displayQuestion(questionId=1) {
|
||||||
|
|
||||||
currentQuestionId = questionId;
|
currentQuestionId = questionId;
|
||||||
|
currentQuestionId = parseInt(currentQuestionId, 10);
|
||||||
var questionContainer = document.getElementById('questionContainer');
|
var questionContainer = document.getElementById('questionContainer');
|
||||||
questionContainer.classList.remove('show');
|
questionContainer.classList.remove('show');
|
||||||
|
|
||||||
|
var secondProgressSteps = document.querySelectorAll('.progress-tracker li:nth-child(2)');
|
||||||
|
secondProgressSteps.forEach(function(firstProgressStep) {
|
||||||
|
if (currentQuestionId === 1) {
|
||||||
|
firstProgressStep.classList.remove('is-complete');
|
||||||
|
}
|
||||||
|
if (currentQuestionId > 1) {
|
||||||
|
firstProgressStep.classList.add('is-complete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var lastProgressSteps = document.querySelectorAll('.progress-tracker li:nth-child(3)');
|
||||||
|
lastProgressSteps.forEach(function(lastProgressStep) {
|
||||||
|
if ([10, 11, 12, 13, 14, 15, 22, 23].includes(currentQuestionId)) {
|
||||||
|
lastProgressStep.classList.add('is-complete');
|
||||||
|
} else {
|
||||||
|
lastProgressStep.classList.remove('is-complete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
questionContainer.innerHTML = '';
|
questionContainer.innerHTML = '';
|
||||||
var question = questions[currentQuestionId];
|
var question = questions[currentQuestionId];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue