Left -->
<h1>Student Progress Report</h1>
<!--
<button (click)='clicked()' type="button" class="btn btn-primary">Left</button> -->
<div class="container" style="padding:80px; display: inline; margin: 300px;">
<select name="Class" id="Class" [(ngModel)]="selectedClass">
<option *ngFor="let clas of classes" [value]="clas.Id">
{{clas.Name}}
</option>

</select>
<select name="Class" required id="Level" [(ngModel)]="selectedLevel ">
<!-- <option value="selected">select</option> -->
<option *ngFor="let lev of levels" [value]="lev.Name">
{{lev.Name}}
</option>
</select>
<button (click)="clicked()" type="button" class="btn btn-primary" style="padding: 1px; margin: auto;">Get
Report</button>
</div>






<div class="container mt-5">



<table class="table table-striped">
<thead>
<tr>
<th (click)="sortTable()">studentName </th>
<th>rank</th>
<th>peformanceLevel</th>
<th>mid1Score</th>
<th>mid2score</th>
<th [hidden]='ishidden'>finalscore</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let Student of students">
<td>{{ Student.studentName }}</td>
<td>{{ Student.rank }}</td>
<td>{{ Student.peformanceLevel }}</td>
<td>{{ Student.mid1Score }}</td>
<td>{{ Student.mid2score }}</td>
<td [hidden]='ishidden'>{{ Student.finalscore }}</td>
</tr>
</tbody>
</table>
<button (click)="hideit()" type="button" class="btn btn-primary" style="padding: 1px; margin: auto;">>
</button>
<button (click)="unhideit()" type="button" class="btn btn-primary" style="padding: 1px; margin: auto;"><
</button>

</div>








import { Component, HostListener, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';

interface Student{
studentName: String;
rank: number;
peformanceLevel: String;
mid1Score: number;
mid2score:number;
finalscore:number;

}

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
// title = 'ict';
classes!: { Id: number; Name: string; }[];
levels!: { Id: number; Name: string; }[];
ngOnInit(): void {
this.classes=[
{Id:0,Name:"class6"},
{Id:1,Name:"class7"},
{Id:2,Name:"class8"},
{Id:3,Name:"class9"},
{Id:4,Name:"class10"},
]
this.levels=[
{Id:0,Name:"all-level"},
{Id:1,Name:"Below-level"},
{Id:2,Name:"On-Level"},
{Id:3,Name:"Above-level"},

]
this.selectedClass=0;
this.selectedLevel='';
}
name = 'AngularIct';




classesObj={
'0':
[
{
studentName: "Abdullah",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 468,
mid2score: 581,
finalscore: 563,
},
{
studentName: "Rakesh",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 345,
mid2score: 346,
finalscore: 466,
},
{
studentName: "raju",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 456,
mid2score: 476,
finalscore: 436,
},
{
studentName: "kavin",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 458,
mid2score: 501,
finalscore: 569,
},
{
studentName: "bhanu teja",
rank: 1,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 567,
mid2score: 561,
finalscore: 59,
},
{
studentName: "Rohith",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 445,
mid2score: 555,
finalscore: 567,
},
{
studentName: "vandana",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "teju",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
},
],
'1':[
{
studentName: "vandu",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "yogesh",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "nav",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
},
{
studentName: "swetha",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "bhanu teja",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "kavin",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "gambir",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "bhanu",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
}
],
'2':[
{
studentName: "teja",
rank: 1,
peformanceLevel:
"Above-Level " + '' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "aarni",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "sudeer",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
},
{
studentName: "sandeep",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "vand",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "shruthi",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "teju",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
}
],
'3':[
{
studentName: "gani",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "ravi",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "mourish",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
},
{
studentName: "warner",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "pavan",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "lokesh",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "chandra",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
}
],
'4':[
{
studentName: "viany",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "teju",
rank: 2,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 368,
mid2score: 369,
finalscore: 401,
},
{
studentName: "mani",
rank: 3,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 234,
mid2score: 326,
finalscore: 289,
},
{
studentName: "vijay",
rank: 1,
peformanceLevel:
"Above-Level " + ' ' + " 85%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "Mira",
rank: 1,
peformanceLevel:
"Below-Level " + ' ' + " 55%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
},
{
studentName: "zaheer",
rank: 1,
peformanceLevel:
"On-Level " + ' ' + " 65%",
mid1Score: 498,
mid2score: 501,
finalscore: 499,
}
]
}

students=this.classesObj[0]
public selectedClass!: number;
public selectedLevel!: string;

clicked(){
if(this.selectedLevel[0]=="a"){

this.students=this.classesObj[this.selectedClass]
console.log(this.selectedClass);
}
else{
this.students=[];
for(var i=0;i<this.classesObj[this.selectedClass].length;i++){

if(this.classesObj[this.selectedClass][i].peformanceLevel[0]==this.selectedLevel[0]){
this.students.push(this.classesObj[this.selectedClass][i]);
}
}
}

}




dynamicsort(property, order) {
var sort_order = 1;
if (order === "desc") {
sort_order = -1;
}
return function (a, b) {
// a should come before b in the sorted order
if (a[property] < b[property]) {
return -1 * sort_order;
// a should come after b in the sorted order
} else if (a[property] > b[property]) {
return 1 * sort_order;
// a and b are the same
} else {
return 0 * sort_order;
}
}
}
order = true;
sortTable(){
// console.log('clicked');

let tempOrder;
if (this.order) {
tempOrder = 'asc';
} else {
tempOrder = 'desc';
}
this.students = this.students.sort(this.dynamicsort('studentName', tempOrder));
this.order=!this.order;
}
ishidden=false;
hideit(){
this.ishidden=true;
console.log(this.getScreenHeight,this.getScreenWidth);
}
unhideit(){
this.ishidden=false;
}

getScreenWidth = window.innerWidth;
getScreenHeight = window.innerHeight;

@HostListener('window:resize', ['$event'])
onWindowResize() {
this.getScreenWidth = window.innerWidth;
this.getScreenHeight = window.innerHeight;
console.log('changed');
if(this.getScreenWidth<801){
this.ishidden=true;
}else{
this.ishidden=false;
}
}

};






     
 
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.