Skip to content

Commit 00fe48c

Browse files
Merge branch 'MontessoriVisualization:main' into main
2 parents 1babc27 + 99531cf commit 00fe48c

9 files changed

Lines changed: 413 additions & 41 deletions

File tree

‎.github/workflows/node.js.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x, 22.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- run: npm ci
30+
- run: npm run build --if-present
31+
- run: npm test

‎.vscode/launch.json‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"address": "TCP/IP address of process to be debugged",
9+
"localRoot": "${workspaceFolder}",
10+
"name": "Attach to Remote",
11+
"port": 9229,
12+
"remoteRoot": "Absolute path to the remote directory containing the program",
13+
"request": "attach",
14+
"skipFiles": [
15+
"<node_internals>/**"
16+
],
17+
"type": "node"
18+
},
19+
{
20+
"type": "chrome",
21+
"request": "launch",
22+
"name": "Launch Chrome against localhost",
23+
"url": "http://localhost:8080",
24+
"webRoot": "${workspaceFolder}"
25+
}
26+
]
27+
}

‎Students/Aakriti/task2.js‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,25 @@ let p1=createProduct("Laptop",1200,10)
2626
let p2=createProduct("Mouse",25,50)
2727
let p3=createProduct("Keyboard",100,20)
2828

29-
inventory=[p1,p2,p3]//all data was overridden by `p3
29+
// inventory=[{...p1,...p2,...p3}]//all data was overridden by `p3`
30+
// console.log(inventory)
31+
inventory=[
32+
{name:"Laptop",
33+
price:1200,
34+
quantity:10
35+
},
36+
{name:"Mouse",
37+
price:25,
38+
quantity:50
39+
},
40+
{name:"Keyboard",
41+
price:100,
42+
quantity:20
43+
}
3044

31-
// Updating Data (Accessing Constraints)
45+
]
46+
console.log(inventory)
47+
// Updating Data (Accessing Constraints):
3248

3349
// Oh no! The "Mouse" price was wrong. Access the second item in your inventory array and update its price to 30.
3450
// Access the "Laptop" (first item) and add a new property category with the value "Electronics".
@@ -48,7 +64,7 @@ const extraDetails={
4864
color:"Silver"
4965
}
5066

51-
let updatedLaptop={...inventory[0],...extraDetails}
67+
let updatedLaptop = { ...inventory[0], ...extraDetails };
5268
console.log(updatedLaptop)
5369

5470
// The Sale Function (Arrow Functions):
@@ -72,6 +88,7 @@ console.log("The total value of Keyboard is",totalValOfKeyboard)
7288
// Write an if statement: If adminUser.permissions.canEdit is true, console log "Access Granted: Inventory updated."
7389
// Why this works:
7490
// Functions: They practice passing arguments (name, price) effectively.
91+
7592
// Objects: They learn to store grouped data instead of just single variables.
7693
// Spread: Real-world use case (adding extra specs to a product).
7794
// Nested Access: Reviewing how to dig into data (user.permissions.canEdit).

‎Students/Aakriti/task3.js‎

Lines changed: 172 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,175 @@
1-
//check whether a person is elligible to vote or not
2-
//should be 18 plus and should havea citizenship to cast vote
1+
// Create a system that processes student data, calculates grades, filters results, and generates reports. It should handle real-world logic like grade calculations, filtering by criteria, and data transformations.
32

4-
const age=24
5-
const citizenshipNum=23456
6-
if (age>=18){
7-
if(Boolean(citizenshipNum)){
8-
console.log("You are elligible to cast vote...")
3+
// What to Build:
4+
// An array of student objects, where each student has: name, marks (array of subject scores), attendance percentage
5+
// Functions that:
6+
// Calculate average marks and assign grades (A/B/C/D based on ranges)
7+
// Filter students by criteria (e.g., "show only students with > 75 average")
8+
// Find top performer and lowest scorer
9+
// Check eligibility (average > 40 AND attendance > 75%)
10+
// Loops to iterate through data and transform it
11+
// Conditionals to apply grading rules (use switch for grade assignment or if/else for eligibility)
12+
// Generate a summary report showing: total students, pass count, fail count, average class score
13+
// How to Approach It:
14+
// Start with data structure — Create realistic student objects with nested arrays (marks per subject)
15+
// Build utility functions — Each function should do ONE thing (calculate average, assign grade, filter students)
16+
// Use loops strategically — .map() mindset (though not required): transform data from one form to another
17+
// Apply game logic — Use conditionals creatively (e.g., bonus points if attendance > 90%)
18+
// Combine everything — Chain functions and loops to build the final report
19+
// Challenge Twist (Optional):
20+
// Add a pass/fail rule: If marks < 40, fail regardless of attendance
21+
// Add a merit scholarship checker: Show students eligible for scholarship (average > 80 AND attendance 100)
22+
// Export data to a formatted string report using template literals
23+
// This project forces them to design with objects, organize logic with functions, and process data with loops — all core pillars.
24+
25+
let students=[
26+
{name:"Aakriti",marks:[90,60,70,30],attendance:69},
27+
{name:"Monika",marks:[20,40,20,47],attendance:29},
28+
{name:"Hangma",marks:[20,60,90,47],attendance:89},
29+
{name:"Hari",marks:[80,69,97,90],attendance:30},
30+
{name:"Gita",marks:[80,39,17,90],attendance:70},
31+
{name:"Subash",marks:[80,99,97,90],attendance:100},
32+
{name:"Sita",marks:[20,60,20,47],attendance:85},
33+
{name:"Shree",marks:[90,70,90,89],attendance:25}
34+
35+
]
36+
console.log(students)
37+
38+
function calcAvg(stu){
39+
40+
let totalMarks=0;
41+
for(j=0; j<stu.marks.length;j++){
42+
totalMarks+=stu.marks[j]
43+
}
44+
return totalMarks/stu.marks.length;
45+
}
46+
47+
let avgmarks=[];
48+
for(let i=0; i<students.length;i++){
49+
avgmarks.push(calcAvg(students[i]))
50+
}
51+
console.log("The average marks of each student",avgmarks)
52+
53+
let grade=[];
54+
for(let i=0; i<avgmarks.length;i++){
55+
56+
if (avgmarks[i]>=80 && avgmarks[i]<=100){
57+
grade.push("A")
58+
}
59+
else if(avgmarks[i]<=80 && avgmarks[i]>=60){
60+
grade.push("B")
61+
}
62+
else if(avgmarks[i]<=60 && avgmarks[i]>=40){
63+
grade.push("C")
64+
}
65+
else{
66+
grade.push("F")
67+
}
68+
}
69+
console.log("The grade of each student",grade)
70+
71+
72+
73+
//updating students profile
74+
for(let i=0; i<students.length;i++){
75+
students[i].Average_Marks=avgmarks[i]
76+
students[i].Grade=grade[i]
77+
78+
}
79+
console.log("Updated Students Profile with grade and avgmarks:",students)
80+
81+
//students with > 75 average
82+
for (let i=0; i<students.length;i++){
83+
if(students[i].Average_Marks>75){
84+
console.log(students[i].name)//with meassage
85+
}
86+
}
87+
//top performer
88+
let topPerformer=avgmarks[0]
89+
for (let i=0; i<avgmarks.length;i++){
90+
if(avgmarks[i]>topPerformer){
91+
topPerformer=avgmarks[i]
92+
93+
}
94+
95+
}
96+
// console.log(`${students[i].name} is a top performer with average marks: ${students[i].Average_Marks}`)
97+
console.log(`The top performer is : ${topPerformer}`)
98+
99+
//low scorer
100+
let lowScorer=avgmarks[0]
101+
for(let i=0; i<avgmarks.length;i++){
102+
if(avgmarks[i]<lowScorer){
103+
lowScorer=avgmarks[i]
104+
}
105+
}
106+
console.log(`The loe Scorer is : ${lowScorer}`)
107+
108+
// Check eligibility (average > 40 AND attendance > 75%)
109+
let eligibility=[]
110+
for(let i=0; i<avgmarks.length;i++){
111+
if(students[i].Average_Marks>40 && students[i].attendance >75){
112+
eligibility.push("PASS")
113+
}
114+
else{
115+
eligibility.push("FAIL")
9116
}
10117
}
11-
else{
12-
console.log("you are not allowed to vote!!!")
13-
}
118+
console.log("The pass/fail eligibilty of each student; ",eligibility)
119+
120+
//again updating with results
121+
for(let i=0; i<students.length;i++){
122+
students[i].Result=eligibility[i]
123+
124+
}
125+
console.log("Updated Students Profile with grade and avgmarks:",students)
126+
127+
128+
//pass count
129+
let pcount=0;
130+
for(let i=0;i<eligibility.length;i++){
131+
132+
if(eligibility[i]==="PASS"){
133+
pcount+=1
134+
}
135+
}
136+
console.log("The pass count in letslearn is: ",pcount)
137+
138+
//fail count
139+
let fcount=0;
140+
for(let i=0;i<eligibility.length;i++){
141+
142+
if(eligibility[i]==="PASS"){
143+
continue;
144+
}
145+
else{
146+
fcount+=1
147+
}
148+
}
149+
console.log("The fail count in letslearn is: ",fcount)
150+
//average class score
151+
function classScore(){
152+
let avgClassScore=0;
153+
for(let i=0; i<avgmarks.length;i++){
154+
avgClassScore+=avgmarks[i]
155+
}
156+
return avgClassScore/students.length
157+
}
158+
159+
console.log("The average score of class is : ",classScore(avgmarks))
160+
161+
// summary report showing: total students, pass count, fail count, average class score
162+
console.log("==============CLASS REPORT OF LETSLEARN=============")
163+
console.log(`\nThe total students in Letslearn is : ${students.length}\nPass count of lets learn : ${pcount} \nFail count of letslearn : ${fcount}\nAverage class score of letslearn is : ${classScore(avgmarks)}`)
164+
console.log("====================================================")
165+
166+
// Add a merit scholarship checker: Show students eligible for scholarship (average > 80 AND attendance 100)
167+
// function merit(){
168+
// for(let i=0; i<students.length;i++){
169+
// if(students[i].attendance===100 && students[i].avgmarks>80){
170+
171+
// }
172+
// return students[i].name
173+
// }
174+
// }
175+
// console.log(merit())

‎getStarted/js/dropdown.html‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>DOM Manipulation</title>
6+
<style>
7+
.bro {
8+
display: none;
9+
}
10+
body {
11+
font-family: Arial, sans-serif;
12+
background-color: #494949;
13+
color: white;
14+
}
15+
.main,
16+
body {
17+
display: flex;
18+
flex-direction: column;
19+
align-items: center;
20+
justify-content: center;
21+
}
22+
button {
23+
padding: 10px 20px;
24+
font-size: 16px;
25+
margin-top: 20px;
26+
cursor: pointer;
27+
}
28+
.text {
29+
font-size: 20px;
30+
}
31+
</style>
32+
</head>
33+
<body>
34+
<div class="main">
35+
<div class="text">THis is the main text</div>
36+
<button>Hide</button>
37+
38+
39+
</div>
40+
</body>
41+
<script>
42+
const buttons = document.querySelector("button");
43+
const text = document.querySelector(".text");
44+
45+
buttons.addEventListener("click", () => {
46+
text.classList.toggle("bro");
47+
if (text.classList.contains("bro")) {
48+
buttons.textContent = "show";
49+
} else {
50+
buttons.textContent = "hide";
51+
}
52+
});
53+
</script>
54+
</html>

‎getStarted/js/reduce-map-forEach.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ const userNames = letslearnUsersObject.filter(function(user){
4444
}).reduce(function(acc,user){
4545
return acc + user
4646
},0)
47+
48+
49+
50+
51+
52+
4753
console.log(userNames)
4854
// const userNamesFor = [];
4955
// function getUserNames(users){

0 commit comments

Comments
 (0)