work on score calculations
This commit is contained in:
@@ -96,7 +96,7 @@ import Layout from '../../layouts/Layout.astro';
|
||||
return result;
|
||||
};
|
||||
shortUniqueID = generateShortUniqueID(10); // Change 10 to the desired length
|
||||
|
||||
let blockMatches;
|
||||
const targetZones = [
|
||||
{
|
||||
x: 0,
|
||||
@@ -123,24 +123,24 @@ import Layout from '../../layouts/Layout.astro';
|
||||
block: null,
|
||||
},
|
||||
];
|
||||
const blockMatches = [
|
||||
{
|
||||
blockName: "blocks1",
|
||||
targetName: "target1",
|
||||
},
|
||||
{
|
||||
blockName: "blocks2",
|
||||
targetName: "target2",
|
||||
},
|
||||
{
|
||||
blockName: "blocks3",
|
||||
targetName: "target3",
|
||||
},
|
||||
{
|
||||
blockName: "blocks4",
|
||||
targetName: "target4",
|
||||
},
|
||||
];
|
||||
// const blockMatches = [
|
||||
// {
|
||||
// blockName: "blocks1",
|
||||
// targetName: "target1",
|
||||
// },
|
||||
// {
|
||||
// blockName: "blocks2",
|
||||
// targetName: "target2",
|
||||
// },
|
||||
// {
|
||||
// blockName: "blocks3",
|
||||
// targetName: "target3",
|
||||
// },
|
||||
// {
|
||||
// blockName: "blocks4",
|
||||
// targetName: "target4",
|
||||
// },
|
||||
// ];
|
||||
// console.log(blockMatches.blockName, blockMatches.targetName)
|
||||
var assetsList = {}
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
@@ -303,6 +303,24 @@ import Layout from '../../layouts/Layout.astro';
|
||||
font: ` ${responsiveFontSize}px Quicksand`,
|
||||
fill: '#7c4c23',
|
||||
}).setOrigin(0.5);
|
||||
blockMatches = [
|
||||
{
|
||||
blockName: "blocks1",
|
||||
targetName: `target${data.answer1}`,
|
||||
},
|
||||
{
|
||||
blockName: "blocks2",
|
||||
targetName: `target${data.answer2}`,
|
||||
},
|
||||
{
|
||||
blockName: "blocks3",
|
||||
targetName: `target${data.answer3}`,
|
||||
},
|
||||
{
|
||||
blockName: "blocks4",
|
||||
targetName: `target${data.answer4}`,
|
||||
},
|
||||
];
|
||||
// this.add.text(displayW / 14 - 15, 50, data.LearningArea, {font: `20px`}).setTint(0x7c4c23);
|
||||
// this.add.text(displayW / 14 - 15, 70, data.LearningSubArea_copy, {font: `19px`}).setTint(0x7c4c23);
|
||||
// Left Image Name
|
||||
@@ -526,11 +544,12 @@ import Layout from '../../layouts/Layout.astro';
|
||||
submitButton.setVisible(true);
|
||||
}
|
||||
}
|
||||
let scoreTotal = 0;
|
||||
const match = blockMatches.find((m) => m.blockName === blockName && m.targetName === targetName);
|
||||
let scoreTotal=0;
|
||||
if(match){
|
||||
console.log(match)
|
||||
if(match !== undefined){
|
||||
scoreTotal++;
|
||||
// console.log(scoreTotal)
|
||||
console.log(scoreTotal)
|
||||
}
|
||||
// console.log(scoreTotal)
|
||||
// // console.log(match)
|
||||
|
||||
Reference in New Issue
Block a user