This commit is contained in:
Kar l5
2024-08-07 21:43:47 +05:30
commit 2677abe35f
97 changed files with 7134 additions and 0 deletions

17
src/routes/api/apiTest.js Normal file
View File

@@ -0,0 +1,17 @@
const apiTest = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const responseObject = {
message: 'Hello, this is your JSON response!',
success: true,
data: {
name: 'John Doe',
age: 30,
job: 'Developer'
}
};
res.json(responseObject);
};
module.exports = apiTest

View File

@@ -0,0 +1,149 @@
const classMates = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
let classmatesData = [
{
id: "1",
name: "Daniel Nguyen",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar1.png"
},
{
id: "2",
name: "Sarah Anderson",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar2.png"
},
{
id: "3",
name: "John Smith",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar3.png"
},
{
id: "4",
name: "Emily Davis",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar4.png"
},
{
id: "5",
name: "Michael Johnson",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar5.png"
},
{
id: "6",
name: "Jessica Wilson",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar6.png"
},
{
id: "7",
name: "David Brown",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar1.png"
},
{
id: "8",
name: "Laura Lee",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar2.png"
},
{
id: "9",
name: "Chris Miller",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar3.png"
},
{
id: "10",
name: "Sophia Taylor",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar4.png"
},
{
id: "11",
name: "James Anderson",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar5.png"
},
{
id: "12",
name: "Olivia Thomas",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar6.png"
},
{
id: "13",
name: "Ethan Martinez",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar1.png"
},
{
id: "14",
name: "Ava Garcia",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar2.png"
},
{
id: "15",
name: "Noah Rodriguez",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar3.png"
},
{
id: "16",
name: "Mia Martinez",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar4.png"
},
{
id: "17",
name: "Lucas Wilson",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar5.png"
},
{
id: "18",
name: "Isabella Clark",
program: "Undergraduate Program",
type: "Student",
avatar: "/assets/avatar6.png"
},
{
id: "19",
name: "Liam Walker",
program: "Graduate Program",
type: "Student",
avatar: "/assets/avatar1.png"
},
{
id: "20",
name: "Charlotte Lewis",
program: "Post-Graduate Program",
type: "Student",
avatar: "/assets/avatar2.png"
}
];
res.json(classmatesData);
};
module.exports = classMates;

View File

@@ -0,0 +1,70 @@
const mysql = require("mysql2");
const continueLearning = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM continue_learning`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = continueLearning;
// let courseData = [
// {
// id : "1",
// title : "Life History of Dr. Maria Montessori",
// chapter : "1",
// Program : "Graduate Program",
// img : "/assets/course1.jpg"
// },
// {
// id : "2",
// title : "Introduction to Montessori Methods",
// chapter : "2",
// Program : "Graduate Program",
// img : "/assets/course2.jpg"
// },
// {
// id : "3",
// title : "Exercises on Practical Life",
// chapter : "3",
// Program : "Graduate Program",
// img : "/assets/course3.jpg"
// }
// ];
// res.json(courseData);

View File

@@ -0,0 +1,35 @@
const mysql = require("mysql2");
const generateQuestions = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const { questions } = req.body;
res.send( questions );
questions.forEach(question => {
const { questionText, options, correctAnswer } = question;
const sql = 'INSERT INTO quiz_questions (questionText, option1, option2, option3, option4, correctAnswer) VALUES (?, ?, ?, ?, ?, ?)';
db.query(sql, [questionText, options[0], options[1], options[2], options[3], correctAnswer], (err, result) => {
if (err) {
console.error('Error inserting question:', err);
res.status(500).send('Error inserting question');
return;
}
});
});
res.status(200).send('Questions added successfully');
}
module.exports = generateQuestions;

View File

@@ -0,0 +1,32 @@
const mysql = require("mysql2");
const getGameScore = (req, res) => {
const pool = mysql.createPool({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: 'beanstalk_game',
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
});
const promisePool = pool.promise();
const { userId, gameName, gameID } = req.body;
const query = 'SELECT score, gameTime FROM gameData WHERE userId = ? AND gameName = ? AND gameID = ?';
pool.query(query, [userId, gameName, gameID], (error, results) => {
if (error) {
return res.status(500).json({ message: 'Database query failed', error });
}
if (results.length > 0) {
const game = results[0];
res.json({ score: game.score, gameTime: game.gameTime });
} else {
res.status(404).json({ message: 'Game data not found' });
}
});
};
module.exports = getGameScore;

View File

@@ -0,0 +1,63 @@
const mysql = require("mysql2");
const knowledgeQuests = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM knowledge_quests WHERE status = 1`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = knowledgeQuests;
// let knowledgeData = [
// {
// id: "1",
// status: "1",
// title: "Assessment on Special Education",
// challenge: "Challenge yourself & climb the leaderboard.",
// question: "Subjective Question",
// img: "/assets/knowledge1.jpg"
// },
// {
// id: "2",
// status: "1",
// title: "Quiz on Children Psychology",
// challenge: "Challenge yourself & climb the leaderboard.",
// question: "MCQ",
// img: "/assets/knowledge2.jpg"
// },
// {
// id: "3",
// status: "1",
// title: "Quiz on Montessori Methods",
// challenge: "Challenge yourself & climb the leaderboard.",
// question: "MCQ",
// img: "/assets/knowledge3.jpg"
// }
// ];
// res.json(knowledgeData);

View File

@@ -0,0 +1,180 @@
const knowledgeQuestsCompleted = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
let knowledgeCompleted = [
{
id: "1",
status: "1",
title: "Assessment on Special Education",
challenge: "Challenge yourself & climb the leaderboard.",
question: "Subjective Question",
img: "/assets/knowledge1.jpg"
},
{
id: "2",
status: "1",
title: "Quiz on Children Psychology",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge2.jpg"
},
{
id: "3",
status: "1",
title: "Quiz on Montessori Methods",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge3.jpg"
},
{
id: "4",
status: "1",
title: "Assessment on Special Education",
challenge: "Challenge yourself & climb the leaderboard.",
question: "Subjective Question",
img: "/assets/knowledge1.jpg"
},
{
id: "5",
status: "1",
title: "Quiz on Children Psychology",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge2.jpg"
},
{
id: "6",
status: "1",
title: "Quiz on Montessori Methods",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge3.jpg"
},
{
id: "7",
status: "1",
title: "Workshop on Child Development",
challenge: "Expand your knowledge & earn badges.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "8",
status: "1",
title: "Webinar on Educational Psychology",
challenge: "Join & enhance your skills.",
question: "Discussion",
img: "/assets/knowledge2.jpg"
},
{
id: "9",
status: "1",
title: "Seminar on Inclusive Education",
challenge: "Participate & gain insights.",
question: "Lecture",
img: "/assets/knowledge3.jpg"
},
{
id: "10",
status: "1",
title: "Course on Early Childhood Education",
challenge: "Complete the course & get certified.",
question: "Multiple Modules",
img: "/assets/knowledge1.jpg"
},
{
id: "11",
status: "1",
title: "Training on Classroom Management",
challenge: "Improve your teaching strategies.",
question: "Practical Tasks",
img: "/assets/knowledge2.jpg"
},
{
id: "12",
status: "1",
title: "Lecture on Cognitive Development",
challenge: "Expand your understanding & get certified.",
question: "Q&A Session",
img: "/assets/knowledge3.jpg"
},
{
id: "13",
status: "1",
title: "Workshop on Behavioral Issues",
challenge: "Join & learn from experts.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "14",
status: "1",
title: "Seminar on Learning Disabilities",
challenge: "Participate & enhance your knowledge.",
question: "Lecture",
img: "/assets/knowledge2.jpg"
},
{
id: "15",
status: "1",
title: "Webinar on Child Psychology",
challenge: "Join & expand your skills.",
question: "Discussion",
img: "/assets/knowledge3.jpg"
},
{
id: "16",
status: "1",
title: "Course on Special Education Needs",
challenge: "Complete the course & get certified.",
question: "Multiple Modules",
img: "/assets/knowledge1.jpg"
},
{
id: "17",
status: "1",
title: "Training on Autism Spectrum Disorder",
challenge: "Improve your teaching strategies.",
question: "Practical Tasks",
img: "/assets/knowledge2.jpg"
},
{
id: "18",
status: "1",
title: "Lecture on Emotional Development",
challenge: "Expand your understanding & get certified.",
question: "Q&A Session",
img: "/assets/knowledge3.jpg"
},
{
id: "19",
status: "1",
title: "Workshop on ADHD",
challenge: "Join & learn from experts.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "20",
status: "1",
title: "Seminar on Speech and Language Disorders",
challenge: "Participate & enhance your knowledge.",
question: "Lecture",
img: "/assets/knowledge2.jpg"
},
{
id: "21",
status: "1",
title: "Webinar on Child Nutrition",
challenge: "Join & expand your skills.",
question: "Discussion",
img: "/assets/knowledge3.jpg"
}
];
res.json(knowledgeCompleted);
};
module.exports = knowledgeQuestsCompleted;
// knowledgeQuestsAllContent

View File

@@ -0,0 +1,180 @@
const knowledgeQuestsAllContent = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
let knowledgeData = [
{
id: "1",
status: "1",
title: "Assessment on Special Education",
challenge: "Challenge yourself & climb the leaderboard.",
question: "Subjective Question",
img: "/assets/knowledge1.jpg"
},
{
id: "2",
status: "1",
title: "Quiz on Children Psychology",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge2.jpg"
},
{
id: "3",
status: "1",
title: "Quiz on Montessori Methods",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge3.jpg"
},
{
id: "4",
status: "1",
title: "Assessment on Special Education",
challenge: "Challenge yourself & climb the leaderboard.",
question: "Subjective Question",
img: "/assets/knowledge1.jpg"
},
{
id: "5",
status: "1",
title: "Quiz on Children Psychology",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge2.jpg"
},
{
id: "6",
status: "1",
title: "Quiz on Montessori Methods",
challenge: "Challenge yourself & climb the leaderboard.",
question: "MCQ",
img: "/assets/knowledge3.jpg"
},
{
id: "7",
status: "1",
title: "Workshop on Child Development",
challenge: "Expand your knowledge & earn badges.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "8",
status: "1",
title: "Webinar on Educational Psychology",
challenge: "Join & enhance your skills.",
question: "Discussion",
img: "/assets/knowledge2.jpg"
},
{
id: "9",
status: "1",
title: "Seminar on Inclusive Education",
challenge: "Participate & gain insights.",
question: "Lecture",
img: "/assets/knowledge3.jpg"
},
{
id: "10",
status: "1",
title: "Course on Early Childhood Education",
challenge: "Complete the course & get certified.",
question: "Multiple Modules",
img: "/assets/knowledge1.jpg"
},
{
id: "11",
status: "1",
title: "Training on Classroom Management",
challenge: "Improve your teaching strategies.",
question: "Practical Tasks",
img: "/assets/knowledge2.jpg"
},
{
id: "12",
status: "1",
title: "Lecture on Cognitive Development",
challenge: "Expand your understanding & get certified.",
question: "Q&A Session",
img: "/assets/knowledge3.jpg"
},
{
id: "13",
status: "1",
title: "Workshop on Behavioral Issues",
challenge: "Join & learn from experts.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "14",
status: "1",
title: "Seminar on Learning Disabilities",
challenge: "Participate & enhance your knowledge.",
question: "Lecture",
img: "/assets/knowledge2.jpg"
},
{
id: "15",
status: "1",
title: "Webinar on Child Psychology",
challenge: "Join & expand your skills.",
question: "Discussion",
img: "/assets/knowledge3.jpg"
},
{
id: "16",
status: "1",
title: "Course on Special Education Needs",
challenge: "Complete the course & get certified.",
question: "Multiple Modules",
img: "/assets/knowledge1.jpg"
},
{
id: "17",
status: "1",
title: "Training on Autism Spectrum Disorder",
challenge: "Improve your teaching strategies.",
question: "Practical Tasks",
img: "/assets/knowledge2.jpg"
},
{
id: "18",
status: "1",
title: "Lecture on Emotional Development",
challenge: "Expand your understanding & get certified.",
question: "Q&A Session",
img: "/assets/knowledge3.jpg"
},
{
id: "19",
status: "1",
title: "Workshop on ADHD",
challenge: "Join & learn from experts.",
question: "Interactive Session",
img: "/assets/knowledge1.jpg"
},
{
id: "20",
status: "1",
title: "Seminar on Speech and Language Disorders",
challenge: "Participate & enhance your knowledge.",
question: "Lecture",
img: "/assets/knowledge2.jpg"
},
{
id: "21",
status: "1",
title: "Webinar on Child Nutrition",
challenge: "Join & expand your skills.",
question: "Discussion",
img: "/assets/knowledge3.jpg"
}
];
res.json(knowledgeData);
};
module.exports = knowledgeQuestsAllContent;
// knowledgeQuestsAllContent

View File

@@ -0,0 +1,34 @@
const mysql = require("mysql2");
const newQuestion = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `INSERT INTO quiz_questions (questionText, option1, option2, option3, option4, correctAnswer, moduleId) VALUES (?, ?, ?, ?, ?, ?, ?)`;
const values = [data.question, data.option1, data.option2, data.option3, data.option4, data.correctAnswer, data.moduleId];
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
}
module.exports = newQuestion
;

34
src/routes/api/newQuiz.js Normal file
View File

@@ -0,0 +1,34 @@
const mysql = require("mysql2");
const newQuiz = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `INSERT INTO quiz (moduleName, type) VALUES (?, ?)`;
const values = [data.moduleName, data.moduleType];
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
}
module.exports = newQuiz
;

View File

@@ -0,0 +1,182 @@
const mysql = require("mysql2");
const questionList = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
function generateUniqueId() {
let timestamp = new Date().getTime().toString();
let randomNumber = Math.floor(Math.random() * 100000).toString();
let uniqueId = timestamp + randomNumber;
if (uniqueId.length > 10) {
uniqueId = uniqueId.substring(0, 10);
} else if (uniqueId.length < 10) {
while (uniqueId.length < 10) {
uniqueId += Math.floor(Math.random() * 10).toString();
}
}
return uniqueId;
}
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM quiz_questions LIMIT 6`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
const uniqueId = generateUniqueId();
results.forEach(obj => {
obj.newQuizId = uniqueId
})
res.status(200).json(results);
});
};
module.exports = questionList;
// {
// id: 1,
// question: "What is the capital of France?",
// options: ["Berlin", "Madrid", "Paris", "Rome"],
// answer: "Paris",
// },
// {
// id: 2,
// question: "Which planet is known as the Red Planet?",
// options: ["Earth", "Mars", "Jupiter", "Saturn"],
// answer: "Mars",
// },
// {
// id: 3,
// question: "What is the chemical symbol for gold?",
// options: ["Au", "Ag", "Pb", "Fe"],
// answer: "Au",
// },
// {
// id: 4,
// question: "Who wrote 'To Kill a Mockingbird'?",
// options: ["Harper Lee", "Mark Twain", "Ernest Hemingway", "J.K. Rowling"],
// answer: "Harper Lee",
// },
// {
// id: 5,
// question: "What is the largest ocean on Earth?",
// options: ["Atlantic Ocean", "Indian Ocean", "Arctic Ocean", "Pacific Ocean"],
// answer: "Pacific Ocean",
// },
// {
// id: 6,
// question: "Which element has the atomic number 1?",
// options: ["Helium", "Hydrogen", "Oxygen", "Carbon"],
// answer: "Hydrogen",
// },
// {
// id: 7,
// question: "In which year did the Titanic sink?",
// options: ["1912", "1905", "1898", "1923"],
// answer: "1912",
// },
// {
// id: 8,
// question: "Who is the author of '1984'?",
// options: ["George Orwell", "Aldous Huxley", "Ray Bradbury", "J.D. Salinger"],
// answer: "George Orwell",
// },
// {
// id: 9,
// question: "What is the hardest natural substance on Earth?",
// options: ["Gold", "Platinum", "Diamond", "Iron"],
// answer: "Diamond",
// },
// {
// id: 10,
// question: "What is the largest planet in our solar system?",
// options: ["Earth", "Saturn", "Neptune", "Jupiter"],
// answer: "Jupiter",
// },
// {
// id: 11,
// question: "What is the main ingredient in guacamole?",
// options: ["Tomato", "Avocado", "Pepper", "Onion"],
// answer: "Avocado",
// },
// {
// id: 12,
// question: "Which country is known as the Land of the Rising Sun?",
// options: ["China", "Japan", "Thailand", "South Korea"],
// answer: "Japan",
// },
// {
// id: 13,
// question: "What is the smallest prime number?",
// options: ["1", "2", "3", "5"],
// answer: "2",
// },
// {
// id: 14,
// question: "Who painted the Mona Lisa?",
// options: ["Vincent van Gogh", "Leonardo da Vinci", "Pablo Picasso", "Claude Monet"],
// answer: "Leonardo da Vinci",
// },
// {
// id: 15,
// question: "What is the capital city of Australia?",
// options: ["Sydney", "Melbourne", "Canberra", "Brisbane"],
// answer: "Canberra",
// },
// {
// id: 16,
// question: "Which gas do plants primarily use for photosynthesis?",
// options: ["Oxygen", "Nitrogen", "Carbon Dioxide", "Hydrogen"],
// answer: "Carbon Dioxide",
// },
// {
// id: 17,
// question: "What is the boiling point of water in Celsius?",
// options: ["90°C", "100°C", "110°C", "120°C"],
// answer: "100°C",
// },
// {
// id: 18,
// question: "Which language is primarily spoken in Brazil?",
// options: ["Spanish", "Portuguese", "French", "English"],
// answer: "Portuguese",
// },
// {
// id: 19,
// question: "What is the smallest unit of life?",
// options: ["Tissue", "Organ", "Cell", "Organism"],
// answer: "Cell",
// },
// {
// id: 20,
// question: "Who developed the theory of relativity?",
// options: ["Isaac Newton", "Galileo Galilei", "Albert Einstein", "Niels Bohr"],
// answer: "Albert Einstein",
// },
// {
// id: 21,
// question: "In what year did World War II end?",
// options: ["1945", "1944", "1946", "1943"],
// answer: "1945",
// },
// ];

View File

@@ -0,0 +1,33 @@
const mysql = require("mysql2");
const quizList = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM quiz`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = quizList;

View File

@@ -0,0 +1,419 @@
const mysql = require("mysql2");
const quizModuleData = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
// const connection = mysql.createConnection({
// host: process.env.MARIA_HOST,
// user: process.env.MARIA_USER,
// password: process.env.MARIA_PASS,
// database: process.env.MARIA_DBNM
// });
// connection.connect((err) => {
// if(err) {
// console.error('Error connecting to the database:', err);
// return;
// }
// console.log('Connected to the MariaDB database.');
// });
// const data = req.body;
// const query = `SELECT * FROM quiz_questions`;
// connection.query(query, (err, results) => {
// if (err) {
// console.error('Error inserting data:', err);
// res.status(500).send('Internal Server Error');
// return;
// }
// res.status(200).json(results);
// });
let quizModuleData = {
modules: [
{
moduleId: 1,
type: "Theory Quiz Scores",
moduleName: "Module 1 - Life History of Dr. Maria Montessori",
quizzes: [
{
quizId: 1,
quizName: "Lorem Ipsum Dolor Sit",
attendQuestion: 48,
totalQuestion: 50,
internalMarks: 28,
attendance: 20,
questions: [
{
questionId: 1,
questionText: "What is the capital of France?",
options: [
"Paris",
"London",
"Berlin",
"Madrid"
],
correctAnswer: "Paris"
},
{
questionId: 2,
questionText: "What is 2 + 2?",
options: [
"3",
"4",
"5",
"6"
],
correctAnswer: "4"
},
{
questionId: 3,
questionText: "What is the boiling point of water?",
options: [
"90°C",
"100°C",
"110°C",
"120°C"
],
correctAnswer: "100°C"
},
{
questionId: 4,
questionText: "Who wrote 'To Kill a Mockingbird'?",
options: [
"Harper Lee",
"Mark Twain",
"J.K. Rowling",
"Ernest Hemingway"
],
correctAnswer: "Harper Lee"
},
{
questionId: 5,
questionText: "What is the largest planet in our solar system?",
options: [
"Earth",
"Mars",
"Jupiter",
"Saturn"
],
correctAnswer: "Jupiter"
},
{
questionId: 6,
questionText: "What is the speed of light?",
options: [
"300,000 km/s",
"150,000 km/s",
"100,000 km/s",
"50,000 km/s"
],
correctAnswer: "300,000 km/s"
},
{
questionId: 7,
questionText: "Who painted the Mona Lisa?",
options: [
"Vincent van Gogh",
"Pablo Picasso",
"Leonardo da Vinci",
"Claude Monet"
],
correctAnswer: "Leonardo da Vinci"
},
{
questionId: 8,
questionText: "What is the chemical symbol for gold?",
options: [
"Au",
"Ag",
"Pt",
"Pb"
],
correctAnswer: "Au"
},
{
questionId: 9,
questionText: "What is the tallest mountain in the world?",
options: [
"K2",
"Kangchenjunga",
"Mount Everest",
"Lhotse"
],
correctAnswer: "Mount Everest"
},
{
questionId: 10,
questionText: "What is the smallest unit of life?",
options: [
"Cell",
"Atom",
"Molecule",
"Organ"
],
correctAnswer: "Cell"
}
]
},
{
quizId: 2,
quizName: "Lorem Ipsum Dolor Sit",
attendQuestion: 45,
totalQuestion: 50,
internalMarks: 29,
attendance: 20,
questions: [
{
questionId: 1,
questionText: "What is the capital of Italy?",
options: [
"Rome",
"Venice",
"Florence",
"Milan"
],
correctAnswer: "Rome"
},
{
questionId: 2,
questionText: "What is 3 + 5?",
options: [
"7",
"8",
"9",
"10"
],
correctAnswer: "8"
},
{
questionId: 3,
questionText: "What is the freezing point of water?",
options: [
"0°C",
"32°C",
"100°C",
"273K"
],
correctAnswer: "0°C"
},
{
questionId: 4,
questionText: "Who wrote 'Pride and Prejudice'?",
options: [
"Jane Austen",
"Charles Dickens",
"Emily Brontë",
"George Eliot"
],
correctAnswer: "Jane Austen"
},
{
questionId: 5,
questionText: "What is the smallest planet in our solar system?",
options: [
"Mercury",
"Venus",
"Earth",
"Mars"
],
correctAnswer: "Mercury"
},
{
questionId: 6,
questionText: "What is the speed of sound?",
options: [
"343 m/s",
"300 m/s",
"1500 m/s",
"1000 m/s"
],
correctAnswer: "343 m/s"
},
{
questionId: 7,
questionText: "Who painted the Starry Night?",
options: [
"Vincent van Gogh",
"Pablo Picasso",
"Leonardo da Vinci",
"Claude Monet"
],
correctAnswer: "Vincent van Gogh"
},
{
questionId: 8,
questionText: "What is the chemical symbol for silver?",
options: [
"Au",
"Ag",
"Pt",
"Pb"
],
correctAnswer: "Ag"
},
{
questionId: 9,
questionText: "What is the second tallest mountain in the world?",
options: [
"K2",
"Kangchenjunga",
"Mount Everest",
"Lhotse"
],
correctAnswer: "K2"
},
{
questionId: 10,
questionText: "What is the largest organ in the human body?",
options: [
"Liver",
"Heart",
"Skin",
"Brain"
],
correctAnswer: "Skin"
}
]
}
]
},
{
moduleId: 2,
type: "Theory Quiz Scores",
moduleName: "Module 2",
attendQuestion: 42,
totalQuestion: 50,
internalMarks: 22,
attendance: 20,
quizzes: [
{
quizId: 1,
quizName: "Quiz 1",
attendQuestion: 49,
totalQuestion: 50,
internalMarks: 2,
attendance: 20,
questions: [
{
questionId: 1,
questionText: "What is the capital of Germany?",
options: [
"Berlin",
"Munich",
"Hamburg",
"Frankfurt"
],
correctAnswer: "Berlin"
},
{
questionId: 2,
questionText: "What is 5 + 3?",
options: [
"7",
"8",
"9",
"10"
],
correctAnswer: "8"
},
{
questionId: 3,
questionText: "What is the melting point of ice?",
options: [
"0°C",
"32°C",
"100°C",
"273K"
],
correctAnswer: "0°C"
},
{
questionId: 4,
questionText: "Who wrote '1984'?",
options: [
"George Orwell",
"Aldous Huxley",
"Ray Bradbury",
"J.D. Salinger"
],
correctAnswer: "George Orwell"
},
{
questionId: 5,
questionText: "What is the second smallest planet in our solar system?",
options: [
"Mercury",
"Venus",
"Earth",
"Mars"
],
correctAnswer: "Mars"
},
{
questionId: 6,
questionText: "What is the speed of light in a vacuum?",
options: [
"300,000 km/s",
"150,000 km/s",
"299,792 km/s",
"299,792 m/s"
],
correctAnswer: "299,792 km/s"
},
{
questionId: 7,
questionText: "Who painted the Last Supper?",
options: [
"Vincent van Gogh",
"Pablo Picasso",
"Leonardo da Vinci",
"Claude Monet"
],
correctAnswer: "Leonardo da Vinci"
},
{
questionId: 8,
questionText: "What is the chemical symbol for iron?",
options: [
"Fe",
"Ir",
"In",
"I"
],
correctAnswer: "Fe"
},
{
questionId: 9,
questionText: "What is the third tallest mountain in the world?",
options: [
"K2",
"Kangchenjunga",
"Mount Everest",
"Lhotse"
],
correctAnswer: "Kangchenjunga"
},
{
questionId: 10,
questionText: "What is the smallest bone in the human body?",
options: [
"Stapes",
"Femur",
"Tibia",
"Fibula"
],
correctAnswer: "Stapes"
}
]
}
]
}
]
}
res.json(quizModuleData);
};
module.exports = quizModuleData;

View File

@@ -0,0 +1,34 @@
const mysql = require("mysql2");
const quizModuleList = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM quiz_modules WHERE moduleId = ?`;
const values = req.query.module_id;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = quizModuleList;

View File

@@ -0,0 +1,34 @@
const mysql = require("mysql2");
const quizModuleList = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
let values = req.query.module_id ? req.query.module_id : '';
const query = `SELECT * FROM quiz_modules WHERE moduleId = ?`;
// const values = req.query.module_id;
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = quizModuleList;

View File

@@ -0,0 +1,33 @@
const mysql = require("mysql2");
const quizNewModule = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `INSERT INTO quiz_modules (moduleName, type) VALUES (?, ?)`;
const values = [data.moduleName, data.moduleType];
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
}
module.exports = quizNewModule;

View File

@@ -0,0 +1,176 @@
const mysql = require("mysql2");
const quizzesScore = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM quiz_score`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = quizzesScore;
// let quizData = [
// {
// quizId: 1,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 1",
// percentage: "60"
// },
// {
// quizId: 2,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 2",
// percentage: "75"
// },
// {
// quizId: 3,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 3",
// percentage: "80"
// },
// {
// quizId: 4,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 4",
// percentage: "65"
// },
// {
// quizId: 5,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 5",
// percentage: "70"
// },
// {
// quizId: 6,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 6",
// percentage: "85"
// },
// {
// quizId: 7,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 7",
// percentage: "90"
// },
// {
// quizId: 8,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 8",
// percentage: "95"
// },
// {
// quizId: 9,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 9",
// percentage: "88"
// },
// {
// quizId: 10,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 10",
// percentage: "92"
// },
// {
// quizId: 11,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 11",
// percentage: "77"
// },
// {
// quizId: 12,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 12",
// percentage: "82"
// },
// {
// quizId: 13,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 13",
// percentage: "68"
// },
// {
// quizId: 14,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 14",
// percentage: "73"
// },
// {
// quizId: 15,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 15",
// percentage: "79"
// },
// {
// quizId: 16,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 16",
// percentage: "87"
// },
// {
// quizId: 17,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 17",
// percentage: "93"
// },
// {
// quizId: 18,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 18",
// percentage: "67"
// },
// {
// quizId: 19,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 19",
// percentage: "89"
// },
// {
// quizId: 20,
// quizType: "AI Quiz",
// quizName: "Assessment on Special Education - 20",
// percentage: "91"
// }
// ]
// res.json(quizData);

View File

@@ -0,0 +1,93 @@
const mysql = require("mysql2");
const resultAfterQuizSubmit = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
res.status(500).send('Internal Server Error');
return;
}
console.log('Connected to the MariaDB database.');
});
const queryData = req.query;
const responseValues = [queryData.id]; // Ensure this is an array
const responseQuery = `SELECT * FROM quiz_response WHERE quizId = ?`;
connection.query(responseQuery, responseValues, (err, results) => {
if (err) {
console.error('Error retrieving data:', err);
res.status(500).send('Internal Server Error');
connection.end();
return;
}
let questionsProcessed = 0;
let allResults = [];
results.forEach((resultData, index) => {
const questionId = [resultData.questionId]; // Ensure this is an array
const answerQuery = `SELECT * FROM quiz_questions WHERE questionId = ?`;
connection.query(answerQuery, questionId, (err, questionResults) => {
if (err) {
console.error('Error retrieving question data:', err);
res.status(500).send('Internal Server Error');
connection.end();
return;
}
allResults.push({
response: resultData,
question: questionResults[0] // Assuming it returns one result per questionId
});
questionsProcessed++;
if (questionsProcessed === results.length) {
let correctAnswers = 0;
allResults.forEach(item => {
if (item.response.selectedOption === item.question.correctAnswer) {
correctAnswers++;
}
});
let quizMessage;
if(correctAnswers > 3){
quizMessage = 'Congratulations on your achievement.'
}else if(correctAnswers < 3){
quizMessage = 'You not paassed the quiz Try Again'
}
res.status(200).json({
totalQuestions: results.length,
correctAnswers: correctAnswers,
message: quizMessage,
details: allResults
});
connection.end();
}
});
});
if (results.length === 0) {
res.status(200).json({
totalQuestions: 0,
correctAnswers: 0,
details: []
});
connection.end();
}
});
};
module.exports = resultAfterQuizSubmit;

View File

@@ -0,0 +1,66 @@
var MongoClient = require('mongodb').MongoClient;
const AWS = require('aws-sdk');
const saveGameScore = (req, res) => {
const url = process.env.MONGODB_URL;
const dbName = process.env.MONGO_DB_NAME;
const client = new MongoClient(url, { useUnifiedTopology: true });
client.connect((err) => {
if (err) {
console.error('Failed to connect to the server', err);
return;
}
// console.log('Connected successfully to server');
const db = client.db(dbName);
const collection = db.collection('gameData');
// const data = req.body;
const { userId, gameName, gameID, gameTime, score, screenShot } = req.body;
const data = {
userId: userId,
gameName: gameName,
gameID: gameID
};
collection.insertOne(data, (err, result) => {
if (err) {
console.error('Failed to insert document', err);
} else {
// console.log('Document inserted with _id: ', result.insertedId);
}
client.close((err) => {
if (err) {
console.error('Failed to close connection', err);
} else {
// console.log('Connection closed');
const s3 = new AWS.S3({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
region: process.env.AWS_REGION
});
if (screenShot != undefined) {
// Upload image to S3
let base64Image = screenShot.split(";base64,").pop();
const buffer = Buffer.from(base64Image, 'base64');
const s3Params = {
Bucket: process.env.S3_BUCKET_NAME,
Key: `images/${result.insertedId}.png`, // Change the file extension to .png
Body: buffer,
ContentEncoding: 'base64',
ContentType: 'image/jpeg' // Change the content type to image/png
};
try {
const data = s3.upload(s3Params).promise();
console.log(`File uploaded successfully at ${data.Location}`);
} catch (err) {
console.error(err);
}
};
res.send(result.insertedId);
}
});
});
});
};
module.exports = saveGameScore;

View File

@@ -0,0 +1,33 @@
const mysql = require("mysql2");
const savePostData = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `INSERT INTO tst (name, email) VALUES (?, ?)`;
const values = [data.name, data.email];
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).send('Data inserted successfully');
});
}
module.exports = savePostData;

View File

@@ -0,0 +1,59 @@
const mysql = require("mysql2");
const saveQuizResponse = (req, res) => {
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if (err) {
console.error('Error connecting to the database:', err);
res.status(500).send('Internal Server Error');
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
// console.log(data);
const query = `INSERT INTO quiz_response (questionId, quizId, selectedOption) VALUES (?, ?, ?)`;
let errorOccurred = false;
let promises = [];
data.forEach((response) => {
const values = [response.questionId, response.quizId, response.selectedOption];
const promise = new Promise((resolve, reject) => {
connection.query(query, values, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
errorOccurred = true;
reject(err);
} else {
resolve(results);
}
});
});
promises.push(promise);
});
Promise.all(promises)
.then(() => {
if (!errorOccurred) {
res.status(200).json({success: true, quizId: data[0].quizId, message: 'All responses saved successfully.' });
}
})
.catch((error) => {
console.error('Error saving responses:', error);
res.status(500).send('Internal Server Error');
})
.finally(() => {
connection.end();
});
};
module.exports = saveQuizResponse;

View File

@@ -0,0 +1,231 @@
const mysql = require("mysql2");
const topPerformers = (req, res) => {
// res.send(req.query.doa); //get
// res.send(req.body.doa); //post
const connection = mysql.createConnection({
host: process.env.MARIA_HOST,
user: process.env.MARIA_USER,
password: process.env.MARIA_PASS,
database: process.env.MARIA_DBNM
});
connection.connect((err) => {
if(err) {
console.error('Error connecting to the database:', err);
return;
}
console.log('Connected to the MariaDB database.');
});
const data = req.body;
const query = `SELECT * FROM top_performers`;
connection.query(query, (err, results) => {
if (err) {
console.error('Error inserting data:', err);
res.status(500).send('Internal Server Error');
return;
}
res.status(200).json(results);
});
};
module.exports = topPerformers;
// let performersData = [
// {
// id: "1",
// name: "Eiden",
// score: "48/50",
// points: "999",
// rank: "1",
// program: "Graduate Program",
// avatar: "/assets/avatar1.png"
// },
// {
// id: "2",
// name: "Jackson",
// score: "45/50",
// points: "997",
// rank: "2",
// program: "Graduate Program",
// avatar: "/assets/avatar2.png"
// },
// {
// id: "3",
// name: "Emma Aria",
// score: "43/50",
// points: "994",
// rank: "3",
// program: "Graduate Program",
// avatar: "/assets/avatar3.png"
// },
// {
// id: "4",
// name: "John Doe",
// score: "40/50",
// points: "990",
// rank: "4",
// program: "Graduate Program",
// avatar: "/assets/avatar4.png"
// },
// {
// id: "5",
// name: "Jane Cooper",
// score: "37/50",
// points: "987",
// rank: "5",
// program: "Graduate Program",
// avatar: "/assets/avatar5.png"
// },
// {
// id: "6",
// name: "John Doe",
// score: "35/50",
// points: "982",
// rank: "6",
// program: "Graduate Program",
// avatar: "/assets/avatar6.png"
// },
// {
// id: "7",
// name: "Alice",
// score: "33/50",
// points: "980",
// rank: "7",
// program: "Graduate Program",
// avatar: "/assets/avatar1.png"
// },
// {
// id: "8",
// name: "Bob",
// score: "32/50",
// points: "978",
// rank: "8",
// program: "Graduate Program",
// avatar: "/assets/avatar2.png"
// },
// {
// id: "9",
// name: "Charlie",
// score: "30/50",
// points: "975",
// rank: "9",
// program: "Graduate Program",
// avatar: "/assets/avatar3.png"
// },
// {
// id: "10",
// name: "Diana",
// score: "28/50",
// points: "972",
// rank: "10",
// program: "Graduate Program",
// avatar: "/assets/avatar4.png"
// },
// {
// id: "11",
// name: "Edward",
// score: "27/50",
// points: "970",
// rank: "11",
// program: "Graduate Program",
// avatar: "/assets/avatar5.png"
// },
// {
// id: "12",
// name: "Fiona",
// score: "26/50",
// points: "968",
// rank: "12",
// program: "Graduate Program",
// avatar: "/assets/avatar6.png"
// },
// {
// id: "13",
// name: "George",
// score: "25/50",
// points: "965",
// rank: "13",
// program: "Graduate Program",
// avatar: "/assets/avatar1.png"
// },
// {
// id: "14",
// name: "Hannah",
// score: "23/50",
// points: "962",
// rank: "14",
// program: "Graduate Program",
// avatar: "/assets/avatar2.png"
// },
// {
// id: "15",
// name: "Ian",
// score: "22/50",
// points: "960",
// rank: "15",
// program: "Graduate Program",
// avatar: "/assets/avatar3.png"
// },
// {
// id: "16",
// name: "Julia",
// score: "20/50",
// points: "957",
// rank: "16",
// program: "Graduate Program",
// avatar: "/assets/avatar4.png"
// },
// {
// id: "17",
// name: "Kyle",
// score: "19/50",
// points: "955",
// rank: "17",
// program: "Graduate Program",
// avatar: "/assets/avatar5.png"
// },
// {
// id: "18",
// name: "Laura",
// score: "18/50",
// points: "953",
// rank: "18",
// program: "Graduate Program",
// avatar: "/assets/avatar6.png"
// },
// {
// id: "19",
// name: "Michael",
// score: "17/50",
// points: "950",
// rank: "19",
// program: "Graduate Program",
// avatar: "/assets/avatar1.png"
// },
// {
// id: "20",
// name: "Nancy",
// score: "16/50",
// points: "947",
// rank: "20",
// program: "Graduate Program",
// avatar: "/assets/avatar2.png"
// },
// {
// id: "21",
// name: "Oliver",
// score: "15/50",
// points: "945",
// rank: "21",
// program: "Graduate Program",
// avatar: "/assets/avatar3.png"
// }
// ];
// res.json(performersData);