From aff599a883f6b7485732c1ea0004d32a4a664649 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Thu, 3 Oct 2024 13:33:08 +0530 Subject: [PATCH 1/3] s1 --- src/pages/cross/cross_phonics_v1.astro | 4 +++- src/pages/cross/cross_phonics_v2.astro | 3 ++- src/pages/cross/v1.astro | 3 ++- src/pages/cross/v2.astro | 3 ++- src/pages/cross/v3.astro | 2 +- src/pages/tick/tick_phonics_v1.astro | 3 ++- src/pages/tick/tick_phonics_v2.astro | 3 ++- src/pages/tick/tick_phonics_v3.astro | 1 + src/pages/tick/v1.astro | 5 +++-- src/pages/tick/v2.astro | 5 +++-- src/pages/tick/v3.astro | 1 + 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/pages/cross/cross_phonics_v1.astro b/src/pages/cross/cross_phonics_v1.astro index 79fb968..6283292 100644 --- a/src/pages/cross/cross_phonics_v1.astro +++ b/src/pages/cross/cross_phonics_v1.astro @@ -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"; diff --git a/src/pages/cross/cross_phonics_v2.astro b/src/pages/cross/cross_phonics_v2.astro index 3b0b27c..f8b840e 100644 --- a/src/pages/cross/cross_phonics_v2.astro +++ b/src/pages/cross/cross_phonics_v2.astro @@ -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"; diff --git a/src/pages/cross/v1.astro b/src/pages/cross/v1.astro index 77352c1..5a6fc5a 100644 --- a/src/pages/cross/v1.astro +++ b/src/pages/cross/v1.astro @@ -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"; diff --git a/src/pages/cross/v2.astro b/src/pages/cross/v2.astro index e56aa3b..dfb8d79 100644 --- a/src/pages/cross/v2.astro +++ b/src/pages/cross/v2.astro @@ -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"; diff --git a/src/pages/cross/v3.astro b/src/pages/cross/v3.astro index 75922c2..9d2a3f6 100644 --- a/src/pages/cross/v3.astro +++ b/src/pages/cross/v3.astro @@ -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(); diff --git a/src/pages/tick/tick_phonics_v1.astro b/src/pages/tick/tick_phonics_v1.astro index cde4917..2ff3efb 100644 --- a/src/pages/tick/tick_phonics_v1.astro +++ b/src/pages/tick/tick_phonics_v1.astro @@ -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"; diff --git a/src/pages/tick/tick_phonics_v2.astro b/src/pages/tick/tick_phonics_v2.astro index 0fc16ee..edb92f0 100644 --- a/src/pages/tick/tick_phonics_v2.astro +++ b/src/pages/tick/tick_phonics_v2.astro @@ -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"; diff --git a/src/pages/tick/tick_phonics_v3.astro b/src/pages/tick/tick_phonics_v3.astro index 6f448f4..1af9187 100644 --- a/src/pages/tick/tick_phonics_v3.astro +++ b/src/pages/tick/tick_phonics_v3.astro @@ -182,6 +182,7 @@ import Layout from "../../layouts/Layout.astro"; element.classList.add('redBorder'); } } else { + wrongCount -= 1; element.classList.remove('greenBorder', 'redBorder'); } } diff --git a/src/pages/tick/v1.astro b/src/pages/tick/v1.astro index 381960f..47e485b 100644 --- a/src/pages/tick/v1.astro +++ b/src/pages/tick/v1.astro @@ -211,15 +211,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"; diff --git a/src/pages/tick/v2.astro b/src/pages/tick/v2.astro index 80a9b26..8901875 100644 --- a/src/pages/tick/v2.astro +++ b/src/pages/tick/v2.astro @@ -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"; diff --git a/src/pages/tick/v3.astro b/src/pages/tick/v3.astro index 3179c13..c7e7cd6 100644 --- a/src/pages/tick/v3.astro +++ b/src/pages/tick/v3.astro @@ -193,6 +193,7 @@ import Layout from "../../layouts/Layout.astro"; element.classList.add('redBorder'); } } else { + wrongCount -= 1; element.classList.remove('greenBorder', 'redBorder'); } } -- 2.34.1 From d9243a1b7cfbda4e72e33967aee78febf3a33aa9 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Fri, 4 Oct 2024 17:49:07 +0530 Subject: [PATCH 2/3] s1 --- src/pages/tick/v1.astro | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/tick/v1.astro b/src/pages/tick/v1.astro index 47e485b..4e337d9 100644 --- a/src/pages/tick/v1.astro +++ b/src/pages/tick/v1.astro @@ -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); @@ -365,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) { -- 2.34.1 From 9ebf6f5d60f1e070aba1801912361d2d16661a5c Mon Sep 17 00:00:00 2001 From: Suvodip Date: Mon, 14 Oct 2024 11:15:56 +0530 Subject: [PATCH 3/3] s1 --- public/saveGameData.js | 3 ++- src/pages/cross/cross_phonics_v1.astro | 2 +- src/pages/cross/cross_phonics_v2.astro | 2 +- src/pages/cross/v1.astro | 2 +- src/pages/cross/v2.astro | 2 +- src/pages/cross/v3.astro | 2 +- src/pages/drag/dragdrop_phonics.astro | 4 ++-- src/pages/drag/index.astro | 6 +++--- src/pages/drag/match_phonics.astro | 4 ++-- src/pages/drag/v2.astro | 4 ++-- src/pages/drag/v3.astro | 4 ++-- src/pages/drag/v4.astro | 4 ++-- src/pages/tick/tick_phonics_v1.astro | 2 +- src/pages/tick/tick_phonics_v2.astro | 2 +- src/pages/tick/tick_phonics_v3.astro | 2 +- src/pages/tick/v1.astro | 2 +- src/pages/tick/v2.astro | 2 +- src/pages/tick/v3.astro | 2 +- 18 files changed, 26 insertions(+), 25 deletions(-) diff --git a/public/saveGameData.js b/public/saveGameData.js index f45cec7..f01c837 100644 --- a/public/saveGameData.js +++ b/public/saveGameData.js @@ -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'); diff --git a/src/pages/cross/cross_phonics_v1.astro b/src/pages/cross/cross_phonics_v1.astro index 6283292..87e56ee 100644 --- a/src/pages/cross/cross_phonics_v1.astro +++ b/src/pages/cross/cross_phonics_v1.astro @@ -254,7 +254,7 @@ import Layout from "../../layouts/Layout.astro"; 'userId': userId, 'gameTime': timeDifferenceInSeconds, 'score': totalPoints, - 'star': starValue + 'gameStar': starValue }; // console.log(userData); progressIncrement(); diff --git a/src/pages/cross/cross_phonics_v2.astro b/src/pages/cross/cross_phonics_v2.astro index f8b840e..1dd6e2f 100644 --- a/src/pages/cross/cross_phonics_v2.astro +++ b/src/pages/cross/cross_phonics_v2.astro @@ -288,7 +288,7 @@ import Layout from "../../layouts/Layout.astro"; 'userId': userId, 'gameTime': timeDifferenceInSeconds, 'score': totalPoints, - 'star': starValue + 'gameStar': starValue }; // console.log(userData); progressIncrement(); diff --git a/src/pages/cross/v1.astro b/src/pages/cross/v1.astro index 5a6fc5a..cc05a19 100644 --- a/src/pages/cross/v1.astro +++ b/src/pages/cross/v1.astro @@ -256,7 +256,7 @@ import Layout from "../../layouts/Layout.astro"; 'userId': userId, 'gameTime': timeDifferenceInSeconds, 'score': totalPoints, - 'star': starValue + 'gameStar': starValue }; progressIncrement(); addStarScalingStyles(); diff --git a/src/pages/cross/v2.astro b/src/pages/cross/v2.astro index dfb8d79..fd73558 100644 --- a/src/pages/cross/v2.astro +++ b/src/pages/cross/v2.astro @@ -275,7 +275,7 @@ import Layout from "../../layouts/Layout.astro"; 'userId': userId, 'gameTime': timeDifferenceInSeconds, 'score': totalPoints, - 'star': starValue + 'gameStar': starValue }; progressIncrement(); addStarScalingStyles(); diff --git a/src/pages/cross/v3.astro b/src/pages/cross/v3.astro index 9d2a3f6..020bf63 100644 --- a/src/pages/cross/v3.astro +++ b/src/pages/cross/v3.astro @@ -226,7 +226,7 @@ import Layout from "../../layouts/Layout.astro"; 'userId': userId, 'gameTime': timeDifferenceInSeconds, 'score': totalPoints, - 'star': starValue + 'gameStar': starValue }; progressIncrement(); addStarScalingStyles(); diff --git a/src/pages/drag/dragdrop_phonics.astro b/src/pages/drag/dragdrop_phonics.astro index a83232c..c6ae5b1 100644 --- a/src/pages/drag/dragdrop_phonics.astro +++ b/src/pages/drag/dragdrop_phonics.astro @@ -18,11 +18,11 @@ import Layout from '../../layouts/Layout.astro';
- +
-
+
Clip Art
diff --git a/src/pages/drag/index.astro b/src/pages/drag/index.astro index 8e7bb87..d771211 100644 --- a/src/pages/drag/index.astro +++ b/src/pages/drag/index.astro @@ -23,11 +23,11 @@ const numberOfTimes = starNumberOfTime;
- +
-
+
Clip Art
@@ -587,7 +587,7 @@ const numberOfTimes = starNumberOfTime; -