-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
309 lines (287 loc) · 15 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
let regulations = {
"2018": {
"CSE": {
"Semester 1": [
{ subject: "English", credit: 3 },
{ subject: "Calculus and Linear Algebra", credit: 4 },
{ subject: "Physics: Semiconductor Physics", credit: 5 },
{ subject: "Engineering Graphics and Design", credit: 3 },
{ subject: "Basic Electrical and Electronics Engineering", credit: 5 },
],
"Semester 2": [
{ subject: "Chinese / French / German / Japanese/ Korean", credit: 3 },
{ subject: "Advanced Calculus and Complex Analysis", credit: 4 },
{ subject: "Chemistry", credit: 5 },
{ subject: "Programming for Problem Solving", credit: 5 },
{ subject: "Civil and Mechanical Engineering Workshop", credit: 3 },
{ subject: "General Aptitude", credit: 1 },
],
"Semester 3": [
{ subject: "Transforms and Boundary Value Problems", credit: 4 },
{ subject: "Biology", credit: 2 },
{ subject: "Analog and Digital Electronics", credit: 4 },
{ subject: "Data Structures and Algorithms", credit: 4 },
{ subject: "Object Oriented Design and Programming", credit: 4 },
{ subject: "Computer Organization and Architecture", credit: 4 },
{ subject: "Management Principles for Engineers", credit: 2 },
],
"Semester 4": [
{ subject: "Probability and Queueing Theory", credit: 4 },
{ subject: "Computer Communications", credit: 3 },
{ subject: "Design and Analysis of Algorithms", credit: 4 },
{ subject: "Operating Systems", credit: 4 },
{ subject: "Software Engineering and Project Management", credit: 4 },
{ subject: "Advanced Programming Practice", credit: 4 },
{ subject: "Competitive Professional Skills-I", credit: 1 },
{ subject: "Social Engineering", credit: 2 },
],
"Semester 5": [
{ subject: "Discrete Mathematics for Engineers", credit: 4 },
{ subject: "Formal Language and Automata", credit: 3 },
{ subject: "Computer Networks", credit: 4 },
{ subject: "Competitive Professional Skills-II", credit: 1 },
{ subject: "Professional Elective - 1", credit: 3 },
{ subject: "Professional Elective - 2", credit: 3 },
{ subject: "Open Elective - 1", credit: 3 },
{ subject: "Massive Open Online Course - I/ Industrial Training-I/ Seminar - 1", credit: 1 },
],
"Semester 6": [
{ subject: "Database Management Systems", credit: 4 },
{ subject: "Compiler Design", credit: 4 },
{ subject: "Artificial Intelligence", credit: 4 },
{ subject: "Comprehension", credit: 1 },
{ subject: "Competitive Professional Skills-III", credit: 1 },
{ subject: "Professional Elective - 3", credit: 3 },
{ subject: "Professional Elective - 4", credit: 3 },
{ subject: "Open Elective - 2", credit: 3 },
{ subject: "Massive Open Online Course - II/ Industrial Training-II/ Seminar - II", credit: 1 },
{ subject: "Employability Skills and Practices", credit: 1 },
],
"Semester 7": [
{ subject: "Professional Elective - 5", credit: 3 },
{ subject: "Professional Elective - 6", credit: 3 },
{ subject: "Open Elective - 3", credit: 3 },
{ subject: "Minor Project/ Internship (4-6 weeks)", credit: 3 },
],
"Semester 8": [
{ subject: "Project/ Semester Internship", credit: 10 },
],
},
"AI-ML": {
"Semester 1": [
{ subject: "English", credit: 3 },
{ subject: "Calculus and Linear Algebra", credit: 4 },
{ subject: "Physics: Semiconductor Physics", credit: 5 },
{ subject: "Engineering Graphics and Design", credit: 3 },
{ subject: "Basic Electrical and Electronics Engineering", credit: 5 },
],
"Semester 2": [
{ subject: "Chinese / French / German / Japanese/ Korean", credit: 3 },
{ subject: "Advanced Calculus and Complex Analysis", credit: 4 },
{ subject: "Chemistry", credit: 5 },
{ subject: "Programming for Problem Solving", credit: 5 },
{ subject: "Civil and Mechanical Engineering Workshop", credit: 3 },
{ subject: "General Aptitude", credit: 1 },
],
"Semester 3": [
{ subject: "Transforms and Boundary Value Problems", credit: 4 },
{ subject: "Biology", credit: 2 },
{ subject: "Analog and Digital Electronics", credit: 4 },
{ subject: "Data Structures and Algorithms", credit: 4 },
{ subject: "Object Oriented Design and Programming", credit: 4 },
{ subject: "Computer Organization and Architecture", credit: 4 },
{ subject: "Management Principles for Engineers", credit: 2 },
],
"Semester 4": [
{ subject: "Probability and Queueing Theory", credit: 4 },
{ subject: "Computer Communications", credit: 3 },
{ subject: "Design and Analysis of Algorithms", credit: 4 },
{ subject: "Operating Systems", credit: 4 },
{ subject: "Software Engineering and Project Management", credit: 4 },
{ subject: "Advanced Programming Practice", credit: 4 },
{ subject: "Competitive Professional Skills-I", credit: 1 },
{ subject: "Social Engineering", credit: 2 },
],
"Semester 5": [
{ subject: "Discrete Mathematics for Engineers", credit: 4 },
{ subject: "Formal Language and Automata", credit: 3 },
{ subject: "Computer Networks", credit: 4 },
{ subject: "Competitive Professional Skills-II", credit: 1 },
{ subject: "Professional Elective - 1", credit: 3 },
{ subject: "Professional Elective - 2", credit: 3 },
{ subject: "Open Elective - 1", credit: 3 },
{ subject: "Massive Open Online Course - I/ Industrial Training-I/ Seminar - 1", credit: 1 },
],
"Semester 6": [
{ subject: "Database Management Systems", credit: 4 },
{ subject: "Compiler Design", credit: 4 },
{ subject: "Artificial Intelligence", credit: 4 },
{ subject: "Comprehension", credit: 1 },
{ subject: "Competitive Professional Skills-III", credit: 1 },
{ subject: "Professional Elective - 3", credit: 3 },
{ subject: "Professional Elective - 4", credit: 3 },
{ subject: "Open Elective - 2", credit: 3 },
{ subject: "Massive Open Online Course - II/ Industrial Training-II/ Seminar - II", credit: 1 },
{ subject: "Employability Skills and Practices", credit: 1 },
],
"Semester 7": [
{ subject: "Professional Elective - 5", credit: 3 },
{ subject: "Professional Elective - 6", credit: 3 },
{ subject: "Open Elective - 3", credit: 3 },
{ subject: "Minor Project/ Internship (4-6 weeks)", credit: 3 },
],
"Semester 8": [
{ subject: "Project/ Semester Internship", credit: 10 },
],
},
"ECE": {
"Semester 1": [
{ subject: "Foreign Language (Chinese/ French/ German/ Japanese / Korean)", credit: 3 },
{ subject: "Calculus and Linear Algebra", credit: 4 },
{ subject: "Chemistry", credit: 5 },
{ subject: "Programming for Problem Solving", credit: 5 },
{ subject: "Civil and Mechanical Engineering Workshop", credit: 3 },
],
"Semester 2": [
{ subject: "English", credit: 3 },
{ subject: "Advanced Calculus and Complex Analysis", credit: 4 },
{ subject: "Physics: Electromagnetic Theory, Quantum Mechanics", credit: 5 },
{ subject: "Engineering Graphics and Design", credit: 3 },
{ subject: "Basic Electrical and Electronics Engineering", credit: 5 },
{ subject: "General Aptitude", credit: 1 },
],
"Semester 3": [
{ subject: "Transforms and Boundary Value Problems", credit: 4 },
{ subject: "Control Systems", credit: 3 },
{ subject: "Electronic Devices", credit: 4 },
{ subject: "Digital Electronic Principles", credit: 4 },
{ subject: "Signals and Systems", credit: 4 },
{ subject: "Electromagnetics and Transmission Lines", credit: 3 },
{ subject: "Social Engineering", credit: 2 },
],
"Semester 4": [
{ subject: "Probability and Stochastic Process", credit: 4 },
{ subject: "Biology", credit: 2 },
{ subject: "Analog Electronic Circuits", credit: 4 },
{ subject: "Linear Integrated Circuits", credit: 4 },
{ subject: "Professional Elective-1", credit: 3 },
{ subject: "Open Elective-1", credit: 3 },
{ subject: "Management Principles for Engineers", credit: 2 },
],
"Semester 5": [
{ subject: "Discrete Mathematics for Engineers", credit: 4 },
{ subject: "Microprocessor, Microcontroller and Interfacing Techniques", credit: 4 },
{ subject: "Digital Signal Processing", credit: 4 },
{ subject: "Analog and Digital Communication", credit: 4 },
{ subject: "Professional Elective-2", credit: 3 },
{ subject: "Open Elective-2", credit: 3 },
{ subject: "Massive Open Online Course-I / Industrial Training-I / Seminar-I", credit: 1 },
],
"Semester 6": [
{ subject: "VLSI Design", credit: 4 },
{ subject: "Microwave and Optical Communications", credit: 4 },
{ subject: "Computer Communication Networks", credit: 4 },
{ subject: "Comprehension", credit: 1 },
{ subject: "Professional Elective-3", credit: 3 },
{ subject: "Professional Elective-4", credit: 3 },
{ subject: "Open Elective-3", credit: 3 },
{ subject: "Massive Open Online Course-II / Industrial Training-II / Seminar-II", credit: 1 },
{ subject: "Employability Skills and Practices", credit: 1 },
],
"Semester 7": [
{ subject: "Wireless Communications", credit: 4 },
{ subject: "Professional Elective-5", credit: 3 },
{ subject: "Professional Elective-6", credit: 3 },
{ subject: "Open Elective-4", credit: 3 },
{ subject: "Minor Project / Internship (4-6 weeks)", credit: 3 },
],
"Semester 8": [
{ subject: "Project / Semester Internship", credit: 10 },
],
},
},
};
const grades = {
"O": 10,
"A+": 9,
"A": 8,
"B+": 7,
"B": 6,
"C": 5,
"F": 0
};
function updateCourses() {
let regulation = document.getElementById("regulation").value;
let courseDropdown = document.getElementById("course");
// Clear previous options
courseDropdown.innerHTML = "";
for (let course in regulations[regulation]) {
let option = document.createElement("option");
option.value = course;
option.textContent = course;
courseDropdown.appendChild(option);
}
// Update semesters for the first course by default
updateSemesters();
}
function updateSemesters() {
let regulation = document.getElementById("regulation").value;
let course = document.getElementById("course").value;
let semesterDropdown = document.getElementById("semester");
// Clear previous options
semesterDropdown.innerHTML = "";
for (let semester in regulations[regulation][course]) {
let option = document.createElement("option");
option.value = semester;
option.textContent = semester;
semesterDropdown.appendChild(option);
}
}
function goToSubjectsPage() {
let regulation = document.getElementById("regulation").value;
let course = document.getElementById("course").value;
let semester = document.getElementById("semester").value;
localStorage.setItem("selectedRegulation", regulation);
localStorage.setItem("selectedCourse", course);
localStorage.setItem("selectedSemester", semester);
window.location.href = "subjects.html";
}
function populateSubjects() {
let regulation = localStorage.getItem("selectedRegulation");
let course = localStorage.getItem("selectedCourse");
let semester = localStorage.getItem("selectedSemester");
let subjects = regulations[regulation][course][semester];
let container = document.getElementById("subjectsContainer");
subjects.forEach(subjectObj => {
let label = document.createElement("label");
label.textContent = subjectObj.subject;
let select = document.createElement("select");
for (let grade in grades) {
let option = document.createElement("option");
option.value = grade;
option.textContent = grade;
select.appendChild(option);
}
container.appendChild(label);
container.appendChild(select);
});
}
function calculateGPA() {
let selects = document.getElementById("subjectsContainer").querySelectorAll("select");
let totalGradePoints = 0;
let totalCredits = 0;
selects.forEach((select, index) => {
let regulation = localStorage.getItem("selectedRegulation");
let course = localStorage.getItem("selectedCourse");
let semester = localStorage.getItem("selectedSemester");
let credit = regulations[regulation][course][semester][index].credit;
totalCredits += credit;
totalGradePoints += grades[select.value] * credit;
});
let gpa = totalGradePoints / totalCredits;
document.getElementById("result").innerText = `Your GPA is: ${gpa.toFixed(3)}`;
}
// If on subjects.html, populate subjects
if (window.location.pathname.includes("subjects.html")) {
populateSubjects();
}