pull/25/head
parent
2e342cd642
commit
aff599a883
|
@ -198,9 +198,11 @@ import Layout from "../../layouts/Layout.astro";
|
|||
if (gameData[id.replace('image', 'a')] === true) {
|
||||
element.classList.add('redBorder');
|
||||
} else {
|
||||
wrongCount += 1;
|
||||
element.classList.add('greenBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('redBorder', 'greenBorder');
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +211,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
function saveUserData() {
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -227,6 +227,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
// console.log(wrongCount)
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('redBorder', 'greenBorder');
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +238,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -202,6 +202,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
wrongCount +=1;
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('redBorder', 'greenBorder');
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +212,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -220,6 +220,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
wrongCount +=1;
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('redBorder', 'greenBorder');
|
||||
}
|
||||
// console.log(wrongCount)
|
||||
|
@ -232,7 +233,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -187,11 +187,11 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('greenBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('redBorder', 'greenBorder');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveUserData() {
|
||||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const endTime = Date.now();
|
||||
|
|
|
@ -213,6 +213,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
@ -221,7 +222,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -244,6 +244,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +253,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -182,6 +182,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
wrongCount += 1;
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +220,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -240,17 +240,18 @@ import Layout from "../../layouts/Layout.astro";
|
|||
} else {
|
||||
element.classList.add('redBorder');
|
||||
wrongCount += 1;
|
||||
console.log("Wrong Count ", wrongCount)
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
||||
function saveUserData() {
|
||||
document.getElementById('allParentDiv').style.display = 'block';
|
||||
const checkboxes = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9'];
|
||||
const checkedCount = checkboxes.filter(id => document.getElementById(id).checked).length;
|
||||
if (checkedCount < 0) {
|
||||
if (checkedCount < 1) {
|
||||
// Show error message if less than 3 checkboxes are checked
|
||||
let errorMessageSection = document.getElementById('errorMessage');
|
||||
errorMessageSection.style.display = "block";
|
||||
|
|
|
@ -193,6 +193,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue