Notes
Notes - notes.io |
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
.dropdown {
display: flex;
justify-content: center;
}
.selectedText1 {
display: flex;
justify-content: center;
}
.selectedText2 {
display: flex;
justify-content: center;
}
.jai {
display: flex;
justify-content: center;
}
.heading {
font-family: 'Times New Roman', Times, serif;
font-style: normal;
font-weight: bold;
font-size: 44px;
line-height: 48px;
text-align: center;
letter-spacing: -0.5px;
}
.hello {
height: 40px;
width: 212px;
font-family: noto-sans;
font-style: normal;
font-weight: 400;
font-size: 14px;
}
.hello1 {
height: 40px;
width: 212px;
font-family: noto-sans;
font-style: normal;
font-weight: 400;
font-size: 14px;
}
.button {
height: 40px;
width: 128px;
font-family: noto-sans;
font-style: normal;
font-weight: 400;
font-size: 14px;
background: #009DD1;
color: #ffffff;
}
</style>
</head>
<body>
<h1 class="heading">Student Progress Report</h1>
<div class="dropdown">
<select id="sel1" class="hello">
</select>
<select id="sel2" class="hello1">
<option>- Select Level</option>
</select>
<button onclick="getOption()" class="button"> Get Report</button>
</div>
<div class="selectedText1">
<p> The value of the option selected is:
<span class="output1"></span>
</p>
</div>
<div class="selectedText2">
<p> The value of the option selected is:
<span class="output2"></span>
</p>
</div>
<div class="jai">
<table border="2px" class="TablePart">
<tr>
<th>STUDENT NAME</th>
<th>RANK</th>
<th>PERFORMANCE LEVEL</th>
<th>COMPELETED PERCENTAGE</th>
<th>MID 1 SCORE OUT OF 600</th>
<th>MID 2 SCORE OUT OF 600</th>
<th>FINAL SCORE OUT OF 600</th>
</tr>
<tbody id="table"></tbody>
</table>
</div>
<script>
var classes = [
{
"className": "Class 10",
"studentresults": [
{
"studentName": "ANR",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},
{
"studentName": "NTR",
"rank": 2,
"peformanceLevel": "On-Level",
"completedPercent": "65%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},
{
"studentName": "KRISHNA",
"rank": 3,
"peformanceLevel": "Below-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "SHOBAN BABU",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
}
]
},
{
"className": "Class 9",
"studentresults": [
{
"studentName": "JR NTR",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},
{
"studentName": "PRABHAS",
"rank": 2,
"peformanceLevel": "On-Level",
"completedPercent": "65%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},
{
"studentName": "RAVI TEJA",
"rank": 3,
"peformanceLevel": "Below-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "BALAKRISHNA",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
}
]
},
{
"className": "Class 8",
"studentresults": [
{
"studentName": "CHIRANJEEVE",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},
{
"studentName": "PAWAN KALYAN",
"rank": 2,
"peformanceLevel": "On-Level",
"completedPercent": "65%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},
{
"studentName": "ALLU ARJUN",
"rank": 3,
"peformanceLevel": "Below-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "RAM CHARAN",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
}
]
}
]
// 1st dropdown i iterated from array
let PerformanceLevel = ["Above-Level", "On-Level", "Below-Level"]
let l = 0;
l = classes.length;
let i = 0;
let select1 = document.getElementById("sel1");
for (i = 0; i < l; i++) {
var opt1 = document.createElement('option');
opt1.innerHTML = classes[i].className;
select1.appendChild(opt1);
}
//2nd dropdown iterated from an array
let m = 0;
m = PerformanceLevel.length;
let n = 0;
let select2 = document.getElementById("sel2");
for (n = 0; n < m; n++) {
var opt2 = document.createElement('option');
opt2.innerHTML = PerformanceLevel[n]
select2.appendChild(opt2);
}
// table part is displayed by default by function calling , and function defining .
buildTable(classes)
function buildTable(data) {
var Table = document.getElementById('table');
for (var j = 0; j < data.length; j++) {
for (var k = 0; k < data[j].studentresults.length; k++) {
var row = `<tr>
<td>${data[j].studentresults[k].studentName}</td>
<td>${data[j].studentresults[k].rank}</td>
<td>${data[j].studentresults[k].peformanceLevel}</td>
<td>${data[j].studentresults[k].completedPercent}</td>
<td>${data[j].studentresults[k].mid1Score}</td>
<td>${data[j].studentresults[k].mid2score}</td>
<td>${data[j].studentresults[k].finalscore}</td>
</tr>
`
Table.innerHTML += row;
}
}
}
function getOption() {
$("#table tr").remove();
selectElement = document.querySelector('#sel1');
output1 = selectElement.value;
selectElement2 = document.querySelector('#sel2');
output2 = selectElement2.value;
document.querySelector('.output1').textContent = output1;
document.querySelector('.output2').textContent = output2;
var Table = document.getElementById('table');
for (let p = 0; p < classes.length; p++) {
if (output1 === classes[p].className) {
for (let q = 0; q < classes[p].studentresults.length; q++) {
if (output2 === classes[p].studentresults[q].peformanceLevel) {
var row = `<tr>
<td>${classes[p].studentresults[q].studentName}</td>
<td>${classes[p].studentresults[q].rank}</td>
<td>${classes[p].studentresults[q].peformanceLevel}</td>
<td>${classes[p].studentresults[q].completedPercent}</td>
<td>${classes[p].studentresults[q].mid1Score}</td>
<td>${classes[p].studentresults[q].mid2score}</td>
<td>${classes[p].studentresults[q].finalscore}</td>
</tr>
`
Table.innerHTML += row;
}
}
}
}
}
</script>
</body>
</html>
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team