commit
9c4e7f184d
|
@ -190,7 +190,7 @@ function submitUserData(drawingZone) {
|
|||
'userId' : userId,
|
||||
'gameTime' : timeDifferenceInSeconds,
|
||||
'score' : scoreTotal,
|
||||
'star' : starValue
|
||||
'gameStar' : starValue
|
||||
};
|
||||
console.log(userData);
|
||||
fetch(`https://api.teachertrainingkolkata.in/api/saveGameScore`, {
|
||||
|
@ -208,6 +208,7 @@ function submitUserData(drawingZone) {
|
|||
loadingDiv.style.display = 'none';
|
||||
starContainer.style.display = 'flex';
|
||||
starContainer.style.flexDirection = 'row';
|
||||
document.getElementById('wsSavedImg').classList.remove('-z-10');
|
||||
document.getElementById('starFeedbackMessage').innerHTML = feedbackMessage;
|
||||
for (let i = 0; i < starValue; i++) {
|
||||
const starDiv = document.createElement('div');
|
||||
|
|
|
@ -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";
|
||||
|
@ -252,7 +254,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
progressIncrement();
|
||||
|
|
|
@ -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";
|
||||
|
@ -287,7 +288,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
progressIncrement();
|
||||
|
|
|
@ -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";
|
||||
|
@ -255,7 +256,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
progressIncrement();
|
||||
addStarScalingStyles();
|
||||
|
|
|
@ -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";
|
||||
|
@ -274,7 +275,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
progressIncrement();
|
||||
addStarScalingStyles();
|
||||
|
|
|
@ -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();
|
||||
|
@ -226,7 +226,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
progressIncrement();
|
||||
addStarScalingStyles();
|
||||
|
|
|
@ -18,11 +18,11 @@ import Layout from '../../layouts/Layout.astro';
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container -z-10 absolute bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,11 +23,11 @@ const numberOfTimes = starNumberOfTime;
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button onclick="" class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container -z-10 absolute bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -587,7 +587,7 @@ const numberOfTimes = starNumberOfTime;
|
|||
|
||||
|
||||
</script>
|
||||
<style href="https://fonts.googleapis.com/css?family=Quicksand&display=swap" rel="stylesheet" >
|
||||
<style href="https://fonts.googleapis.com/css?family=Quicksand&display=swap" rel="stylesheet">
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
@ -19,11 +19,11 @@ import Layout from '../../layouts/Layout.astro';
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container -z-10 absolute bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -19,11 +19,11 @@ import Layout from '../../layouts/Layout.astro';
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container -z-10 absolute bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -19,11 +19,11 @@ import Layout from '../../layouts/Layout.astro';
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container -z-10 absolute bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,11 +18,11 @@ import Layout from '../../layouts/Layout.astro';
|
|||
</div>
|
||||
<div class="flex flex-col w-full max-w-sm items-center justify-center mx-auto gap-3">
|
||||
<button class="rounded-[4px] bg-[#0348A8] text-[#FFF] text-[12px] font-[700] p-2.5 w-full border-[1px] border-[#0348A8]">Wow, Lets Go</button>
|
||||
<button class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
<button onclick="retryGame();" class="border-[1px] border-[#0348A8] p-2.5 rounded-[4px] text-[#0348A8] w-full">Try Again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clip-art-container absolute bottom-0 right-0">
|
||||
<div id="wsSavedImg" class="clip-art-container absolute -z-10 bottom-0 right-0">
|
||||
<img src="/assets/svg/clip-art2.svg" alt="Clip Art" class="clip-art">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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";
|
||||
|
@ -264,7 +265,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
@ -292,7 +293,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
|
||||
};
|
||||
// console.log(userData);
|
||||
|
|
|
@ -182,6 +182,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +219,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
progressIncrement();
|
||||
|
|
|
@ -198,7 +198,6 @@ import Layout from "../../layouts/Layout.astro";
|
|||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function checkResult2(id) {
|
||||
const checkbox = document.getElementById('a' + id.slice(-1));
|
||||
const element = document.getElementById(id);
|
||||
|
@ -211,15 +210,16 @@ import Layout from "../../layouts/Layout.astro";
|
|||
wrongCount += 1;
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveUserData() {
|
||||
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";
|
||||
|
@ -261,7 +261,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);let progress = 0;
|
||||
progressIncrement();
|
||||
|
@ -364,8 +364,6 @@ import Layout from "../../layouts/Layout.astro";
|
|||
console.error('An error occurred', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const contactForm = document.getElementById('contactForm');
|
||||
contactForm.addEventListener('submit', async function (event) {
|
||||
|
|
|
@ -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";
|
||||
|
@ -301,7 +302,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
progressIncrement();
|
||||
|
|
|
@ -193,6 +193,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
element.classList.add('redBorder');
|
||||
}
|
||||
} else {
|
||||
wrongCount -= 1;
|
||||
element.classList.remove('greenBorder', 'redBorder');
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +230,7 @@ import Layout from "../../layouts/Layout.astro";
|
|||
'userId': userId,
|
||||
'gameTime': timeDifferenceInSeconds,
|
||||
'score': totalPoints,
|
||||
'star': starValue
|
||||
'gameStar': starValue
|
||||
};
|
||||
// console.log(userData);
|
||||
progressIncrement();
|
||||
|
|
Loading…
Reference in New Issue