Skip to content
Snippets Groups Projects
Commit 1ad81b3a authored by ywb16155's avatar ywb16155
Browse files

commit #44 - refactoring

parent 19377fe4
No related branches found
No related tags found
No related merge requests found
<div *ngIf="!isLoading && responseChart">
<label for="year-select">Choose a Year:</label>
<label for="year-select">Choose a Year: </label>
<select id="year-select" [(ngModel)]="currentYear" (change)="switchYears()" name="classes">
<option [ngValue]="undefined" selected>Select...</option>
<option *ngFor="let year of years" [ngValue]="year">{{year}}</option>
......
<div *ngIf="!isLoading && studentResponseChart">
<label for="class-select">Choose a Year:</label>
<label for="class-select">Choose a Class: </label>
<select id="class-select" [(ngModel)]="currentClass" (change)="switchClass()" name="classes">
<option [ngValue]="undefined" selected>Select...</option>
<option *ngFor="let ompClass of responseGraphClasses" [ngValue]="ompClass">{{ompClass.classCode}}</option>
<option *ngFor="let rgc of responseGraphClasses" [ngValue]="rgc">{{rgc.classCode}}</option>
</select>
<div [chart]="studentResponseChart"></div>
</div>
......@@ -15,7 +15,7 @@ export class StudentResponseChartComponent implements OnInit, OnDestroy {
public studentResponseChart: any;
public isLoading: boolean;
public currentClass: OmpClassDao;
public currentClass: ResponseGraphDetailsDao;
public responseGraphClasses: ResponseGraphDetailsDao[];
public studentResponses: StudentGraphDetailsDao[];
public currentlyViewedYear;
......@@ -38,6 +38,7 @@ export class StudentResponseChartComponent implements OnInit, OnDestroy {
});
this.generateGraph$.subscribe(flag => {
if (flag) {
this.currentClass = this.responseGraphClasses[0];
this.getStudentResponseData(this.responseGraphClasses[0].classCode);
}
});
......@@ -56,7 +57,6 @@ export class StudentResponseChartComponent implements OnInit, OnDestroy {
this.studentResponses = data;
this.buildChart();
this.isLoading = false;
console.log('LOADED');
}
);
}
......@@ -83,7 +83,7 @@ export class StudentResponseChartComponent implements OnInit, OnDestroy {
type: 'column'
},
title: {
text: 'Individual Student Responses For Each Class'
text: 'Individual Student Responses For ' + this.currentClass.classCode
},
xAxis: {
categories: this.createXAxisHeaders(),
......
......@@ -17,8 +17,8 @@
</ul>
</div>
<div>
<form class="form-inline">
<button class="btn btn-outline-warning my-2 my-sm-0" (click)="logout()">Logout</button> <!-- TODO add logout mechanism -->
<form #lecturerNavBarForm="ngForm" class="form-inline">
<button class="btn btn-outline-warning my-2 my-sm-0" (click)="logout()">Logout</button>
</form>
</div>
</nav>
#paper-grid{
margin-top: 1%;
margin-right: 0;
}
#closed-papers {
margin-left: 4.5%;
margin-right: 5%;
margin-left: 2%;
margin-right: 0;
padding-right: 0;
width: 98%;
}
#view-papers-grid {
margin-right: 0;
}
ag-grid-angular {
margin-right: 0;
}
<app-lecturer-navbar></app-lecturer-navbar>
<div class="row">
<div id="closed-papers" class="align-content-center">
<div id="paper-grid" class="row">
<div id="closed-papers" class="col">
<h3>Your Created One-minute Papers</h3>
<ag-grid-angular id="view-papers-grid"
style="width: 100%; height: 100%;"
style="width: 95%; height: 100%;"
class="ag-theme-balham"
[columnDefs]="columnDefs"
[rowData]="classPapers | async"
[gridOptions]="gridOptions"
[suppressAutoSize]="false"
>
</ag-grid-angular>
</div>
......
......@@ -40,7 +40,8 @@ export class LecturerPaperViewComponent implements OnInit, OnDestroy {
this.classCode = this.lecturerDataService.classCode;
this.lecturerId = sessionStorage.getItem('username');
this.gridOptions = {
context: {componentParent: this}
context: {componentParent: this},
suppressHorizontalScroll: false,
};
this.classPapers = this.lecturerInfoService.getClassPapers(this.lecturerId, this.classCode);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment