-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
38 lines (28 loc) · 863 Bytes
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function showErrors() {
for (let el of document.querySelectorAll('.error'))
{
console.log(el);
if (el.innerText)
el.style.display = 'inline'}
}
function hideErrors() {
for (let el of document.querySelectorAll('.error'))
el.style.display = 'none';
};
setTimeout(showErrors,100);;
setTimeout(hideErrors,6000);
function scrollToElement(e) {
const y = document.getElementById(e).getBoundingClientRect().top + window.scrollY;
window.scroll({
top: y,
behavior: 'smooth'
});
}
function startQuiz() {
document.getElementById('PreExam').style.display = 'none';
document.getElementById('examForm').style.display = 'block'
}
function reviewQuiz() {
document.getElementById('PostExam').style.display = 'none';
document.getElementById('examForm').style.display = 'block'
}