NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

var students= [
{
"className": "Class 10",
"studentresults": [

{
"studentName": "Sravya",
"rank": 1,
"peformanceLevel": "On-Level",
"completedPercent": "85%",
"mid1Score": 437,
"mid2score": 500,
"finalscore": 480
},
{
"studentName": "Kalyani",
"rank": 2,
"peformanceLevel": "Above-Level",
"completedPercent": "95%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 500
},

{
"studentName": "kavya",
"rank": 3,
"peformanceLevel": "Below-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},

]
},
{
"className": "Class 9",
"studentresults": [
{
"studentName": "lalitha",
"rank": 1,
"peformanceLevel": "On-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},

{
"studentName": "harshitha",
"rank": 3,
"peformanceLevel": "Above-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "sarath",
"rank": 1,
"peformanceLevel": "Below-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
}
]
},
{
"className": "Class 8",
"studentresults": [
{
"studentName": "Student 9",
"rank": 1,
"peformanceLevel": "On-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},
{
"studentName": "Student 10",
"rank": 2,
"peformanceLevel": "Above-Level",
"completedPercent": "65%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},
{
"studentName": "Student 3",
"rank": 3,
"peformanceLevel": "On-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "Student 4",
"rank": 1,
"peformanceLevel": "Below-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
}
]
},
{
"className": "Class 7",
"studentresults": [
{
"studentName": "vandana",
"rank": 2,
"peformanceLevel": "On-Level",
"completedPercent": "65%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},

{
"studentName": "Padma",
"rank": 1,
"peformanceLevel": "Below-Level",
"completedPercent": "59%",
"mid1Score": 253,
"mid2score": 345,
"finalscore": 390
},
{
"studentName": "Student 3",
"rank": 3,
"peformanceLevel": "Above-Level",
"completedPercent": "55%",
"mid1Score": 234,
"mid2score": 326,
"finalscore": 289
},
{
"studentName": "Student 4",
"rank": 1,
"peformanceLevel": "Above-Level",
"completedPercent": "85%",
"mid1Score": 498,
"mid2score": 501,
"finalscore": 499
},
{
"studentName": "Ramya",
"rank": 2,
"peformanceLevel": "On-Level",
"completedPercent": "75%",
"mid1Score": 368,
"mid2score": 369,
"finalscore": 401
},
]
}
]




// let students=[
// {
// "STUDENT NAME":"John",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },
// {
// "STUDENT NAME":"Allen",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },
// {
// "STUDENT NAME":"Catherine",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },
// {
// "STUDENT NAME":"Bruce",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },
// {
// "STUDENT NAME":"Jack",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },
// {
// "STUDENT NAME":"Victoria",
// "RANK":"4",
// "PERFORMANCE LEVEL":"45% Below-Level",
// "MID 1 SCORE OUT OF 600":"286",
// "MID 2 SCORE OUT OF 600":"250",
// "FINAL SCORE OUT OF 600":"312"
// },

// ]
const table=document.querySelector('table');


function loadElements(){
loadForm();
constructTable();

// loadForm2();
}



function constructTable(){
const thead=document.createElement('thead')
let tr=document.createElement('tr');
input = document.getElementById("classname");
for(let i=0;i<students.length;i++)
{ var x=students[i];
// console.log(x.className);
// console.log(input.value);
//console.log(students[i]["studentresults"][0]);
if(x.className==input.value)
{
for(let key in x.studentresults[0]){
let th=document.createElement('th');
th.innerHTML=key;
tr.appendChild(th);
}
thead.appendChild(tr);
table.appendChild(thead);
constructTbody();
}
}
}

function constructTbody(stds=students){
//stds=students
let oldtbody=table.querySelector('tbody');
table.removeChild(oldtbody);
const tbody=document.createElement('tbody');
input = document.getElementById("classname");
for(let i=0;i<stds.length;i++)
{ var x=stds[i];

if(x.className==input.value)
{
for(let i=0;i<x.studentresults.length;i++){
let rowdata=x.studentresults[i];
let tr=document.createElement('tr');
for(key in rowdata){
let td=document.createElement('td');
td.innerHTML=rowdata[key];
tr.appendChild(td);
}
tbody.appendChild(tr);
}
table.appendChild(tbody)
}
// }
}
}





function loadForm(){
let select=document.getElementById('classname');
for(let i=0;i<students.length;i++){

let stdname=students[i]["className"];
let option=document.createElement('option');

option.innerHTML=stdname;

option.setAttribute("value",stdname)

select.appendChild(option);

}
select.options[0].selected = true;

}
function myFunction()
{
var input = document.getElementById("level");
var f = input.value.toUpperCase();
var table = document.querySelector("table");
console.log(table);
var tr = table.getElementsByTagName("tr");

// Loop through all table rows, and hide those who don't match the search query
for (let i = 0; i < tr.length; i++) {
var td = tr[i].getElementsByTagName("td");

let tdata = td[2] ;
if (tdata) {
if (tdata.innerHTML.toUpperCase().indexOf(f) > -1 ) {
tr[i].style.display = "";

} else {
tr[i].style.display = "none";
}
}


}

}

// function myFunction() {
// // Declare variables
//
// var input, filter, table, tr, td, i;
// input = document.getElementById("level");
// filter = input.value.toUpperCase();
// table = document.querySelector("table");
// tr = table.getElementsByTagName("tr");

// // Loop through all table rows, and hide those who don't match the search query
// for (i = 0; i < tr.length; i++) {
// td = tr[i].getElementsByTagName("td")[2];
// if (td) {
// if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
// tr[i].style.display = "";
// } else {
// tr[i].style.display = "none";
// }
// }
// }
// }



function sort() {
var n=0;
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;

var table = document.querySelector("table");
switching = true;
dir = "asc";
while (switching) {
// Start by saying: no switching is done:
switching = false;
rows = table.rows;
for (i = 1; i < (rows.length - 1); i++) {
shouldSwitch = false;
x = rows[i].getElementsByTagName("td")[n];
y = rows[i + 1].getElementsByTagName("td")[n];
if (dir == "asc") {
if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
// If so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
} else if (dir == "desc") {
if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
// If so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
}
}
if (shouldSwitch) {
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
// Each time a switch is done, increase this count by 1:
switchcount ++;
} else {
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}}

function showDocument(btn) {

// $(btn).show();
$("#excelDataTable th:last-child").show();
$("#excelDataTable td:last-child").show();
//Or show hidden column using single line
//$(".employee th:last-child, .employee td:last-child").show();
}
function hideDocument(btn) {

// $(btn).show();
$("#excelDataTable th:last-child").hide();
$("#excelDataTable td:last-child").hide();

//Or show hidden column using single line
//$(".employee th:last-child, .employee td:last-child").show();
}



     
 
what is notes.io
 

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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.