-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
433 additions
and
748 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.20.1 | ||
5.20.2 |
21 changes: 21 additions & 0 deletions
21
...in/webapp/site/src/app/classroom-monitor/component-select/component-select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<mat-select *ngIf="components.length > 1" | ||
class="md-no-underline md-button mat-button-raised md-raised" | ||
[(ngModel)]="selectedComponents" | ||
(selectionChange)="selectedComponentsChange()" | ||
placeholder="{{getSelectedText()}}" | ||
multiple> | ||
<mat-select-trigger>{{getSelectedText()}}</mat-select-trigger> | ||
<mat-optgroup label="Assessment items to show" i18n-label> | ||
<mat-option value="{{component.id}}" *ngFor="let component of components; let i = index"> | ||
{{ i+1 }}: {{ getComponentTypeLabel(component.type) }} | ||
</mat-option> | ||
</mat-optgroup> | ||
</mat-select> | ||
<button mat-button class="md-body-1 mat-button-raised" | ||
*ngIf="components.length == 1" | ||
aria-label="Assessment items to show" | ||
i18n-aria-label | ||
disabled | ||
i18n> | ||
1 assessment item | ||
</button> |
7 changes: 7 additions & 0 deletions
7
...in/webapp/site/src/app/classroom-monitor/component-select/component-select.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mat-select { | ||
min-width: 150px; | ||
} | ||
|
||
mat-select, mat-select-trigger { | ||
text-transform: none; | ||
} |
58 changes: 58 additions & 0 deletions
58
...main/webapp/site/src/app/classroom-monitor/component-select/component-select.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Component, EventEmitter, Input, Output } from "@angular/core"; | ||
import { UpgradeModule } from "@angular/upgrade/static"; | ||
import { TeacherProjectService } from "../../../../../wise5/services/teacherProjectService"; | ||
import { UtilService } from "../../../../../wise5/services/utilService"; | ||
|
||
@Component({ | ||
selector: 'component-select', | ||
styleUrls: ['component-select.component.scss'], | ||
templateUrl: 'component-select.component.html' | ||
}) | ||
export class ComponentSelectComponent { | ||
|
||
components: any[]; | ||
|
||
@Output() | ||
modelChange: EventEmitter<any> = new EventEmitter<any>(); | ||
|
||
@Input() | ||
nodeId: string; | ||
|
||
selectedComponents: any[]; | ||
|
||
constructor(private upgrade: UpgradeModule, private ProjectService: TeacherProjectService, | ||
private UtilService: UtilService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.components = this.ProjectService.getComponentsByNodeId(this.nodeId).filter(component => { | ||
return this.ProjectService.componentHasWork(component); | ||
}); | ||
this.selectedComponents = this.components.map(component => { | ||
return component.id; | ||
}); | ||
} | ||
|
||
getComponentTypeLabel(componentType) { | ||
return this.UtilService.getComponentTypeLabel(componentType); | ||
} | ||
|
||
getSelectedText() { | ||
let nComponents = this.components.length; | ||
return this.upgrade.$injector.get('$filter')('translate')('selectedComponentsLabel', { | ||
selected: this.selectedComponents.length, | ||
total: nComponents | ||
}); | ||
} | ||
|
||
selectedComponentsChange() { | ||
const hiddenComponents = []; | ||
for (const component of this.components) { | ||
const id = component.id; | ||
if (this.selectedComponents.indexOf(id) < 0) { | ||
hiddenComponents.push(id); | ||
} | ||
} | ||
this.modelChange.emit(hiddenComponents); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/webapp/site/src/app/classroom-monitor/milestones/milestones.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="view-content view-content--with-sidemenu"> | ||
<div class="l-constrained"> | ||
<div fxLayout="row wrap" fxLayoutAlign="center center" fxLayoutAlign.gt-xs="start center"> | ||
<mat-card *ngFor="let milestone of milestones" | ||
class="milestone md-button" md-ink-ripple | ||
(click)="showMilestoneDetails(milestone, $event)"> | ||
<mat-card-content fxLayout="column" fxLayoutAlign="center center"> | ||
<div class="milestone__title" md-truncate>{{ milestone.name }}</div> | ||
<div class="milestone__progress"> | ||
<mat-progress-spinner diameter="96" | ||
mode="determinate" | ||
[value]="milestone.percentageCompleted" | ||
[ngClass]="{ 'success': milestone.percentageCompleted === 100 }"></mat-progress-spinner> | ||
<div class="milestone__progress__percent" fxLayout="row" fxLayoutAlign="center center"> | ||
<span *ngIf="milestone.percentageCompleted < 100">{{ milestone.percentageCompleted }}%</span> | ||
<mat-icon *ngIf="milestone.percentageCompleted === 100" class="success md-48"> check </mat-icon> | ||
</div> | ||
</div> | ||
<p class="md-body-1 text-secondary">{{ milestone.numberOfStudentsCompleted }}/{{ milestone.numberOfStudentsInRun }} teams completed</p> | ||
<p *ngIf="milestone.isReportAvailable" class="md-body-2 info" i18n>~ Report Available ~</p> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> | ||
</div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/main/webapp/site/src/app/classroom-monitor/milestones/milestones.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host ::ng-deep .success circle { | ||
stroke: #00C853; | ||
} |
80 changes: 80 additions & 0 deletions
80
src/main/webapp/site/src/app/classroom-monitor/milestones/milestones.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { Component } from '@angular/core'; | ||
import { AchievementService } from '../../../../../wise5/services/achievementService'; | ||
import { AnnotationService } from '../../../../../wise5/services/annotationService'; | ||
import { MilestoneService } from '../../../../../wise5/services/milestoneService'; | ||
import { TeacherDataService } from '../../../../../wise5/services/teacherDataService'; | ||
|
||
@Component({ | ||
selector: 'milestones', | ||
styleUrls: ['milestones.component.scss'], | ||
templateUrl: 'milestones.component.html' | ||
}) | ||
export class MilestonesComponent { | ||
milestones: any[]; | ||
annotationReceivedSubscription: any; | ||
currentPeriodChangedSubscription: any; | ||
newStudentAchievementSubscription: any; | ||
|
||
constructor(private AchievementService: AchievementService, | ||
private AnnotationService: AnnotationService, private MilestoneService: MilestoneService, | ||
private TeacherDataService: TeacherDataService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.loadProjectMilestones(); | ||
this.newStudentAchievementSubscription = | ||
this.AchievementService.newStudentAchievement$.subscribe((args: any) => { | ||
const studentAchievement = args.studentAchievement; | ||
this.AchievementService.addOrUpdateStudentAchievement(studentAchievement); | ||
this.updateMilestoneStatus(studentAchievement.achievementId); | ||
}); | ||
|
||
this.currentPeriodChangedSubscription = this.TeacherDataService.currentPeriodChanged$ | ||
.subscribe(() => { | ||
for (const milestone of this.milestones) { | ||
this.updateMilestoneStatus(milestone.id); | ||
} | ||
}); | ||
|
||
this.annotationReceivedSubscription = | ||
this.AnnotationService.annotationReceived$.subscribe(({ annotation }) => { | ||
for (const milestone of this.milestones) { | ||
if (milestone.nodeId === annotation.nodeId && | ||
milestone.componentId === annotation.componentId) { | ||
this.updateMilestoneStatus(milestone.id); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.annotationReceivedSubscription.unsubscribe(); | ||
this.currentPeriodChangedSubscription.unsubscribe(); | ||
this.newStudentAchievementSubscription.unsubscribe(); | ||
} | ||
|
||
loadProjectMilestones() { | ||
this.milestones = this.MilestoneService.getProjectMilestones(); | ||
for (let milestone of this.milestones) { | ||
milestone = this.MilestoneService.getProjectMilestoneStatus(milestone.id); | ||
} | ||
} | ||
|
||
updateMilestoneStatus(milestoneId) { | ||
let milestone = this.getProjectMilestoneById(milestoneId); | ||
milestone = this.MilestoneService.getProjectMilestoneStatus(milestoneId); | ||
} | ||
|
||
getProjectMilestoneById(milestoneId: string): any { | ||
for (const milestone of this.milestones) { | ||
if (milestone.id === milestoneId) { | ||
return milestone; | ||
} | ||
} | ||
return {}; | ||
} | ||
|
||
showMilestoneDetails(milestone, $event) { | ||
this.MilestoneService.showMilestoneDetails(milestone, $event); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../webapp/site/src/app/classroom-monitor/nav-item-progress/nav-item-progress.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<span fxLayout="row" fxLayoutAlign="start center"> | ||
<span class="progress-wrapper" tabindex="0" [ngSwitch]="period.periodId"> | ||
<mat-progress-bar *ngSwitchCase="-1" | ||
matTooltip="{{nodeCompletion}}% completed (All periods)" | ||
i18n-matTooltip | ||
matTooltipPosition="above" | ||
class="nav-item__progress" | ||
mode="determinate" | ||
value="{{nodeCompletion}}"></mat-progress-bar> | ||
<mat-progress-bar *ngSwitchDefault | ||
matTooltip="{{nodeCompletion}}% completed (Period: {{period.periodName}})" | ||
i18n-matTooltip | ||
matTooltipPosition="above" | ||
class="nav-item__progress" | ||
mode="determinate" | ||
value="{{nodeCompletion}}"></mat-progress-bar> | ||
</span> | ||
<span class="nav-item__progress-value md-body-2 text-secondary" hide-xs>{{nodeCompletion}}%</span> | ||
</span> |
3 changes: 3 additions & 0 deletions
3
.../webapp/site/src/app/classroom-monitor/nav-item-progress/nav-item-progress.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mat-progress-bar { | ||
height: 14px; | ||
} |
15 changes: 15 additions & 0 deletions
15
...in/webapp/site/src/app/classroom-monitor/nav-item-progress/nav-item-progress.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, Input } from "@angular/core"; | ||
|
||
@Component({ | ||
selector: 'nav-item-progress', | ||
styleUrls: ['nav-item-progress.component.scss'], | ||
templateUrl: 'nav-item-progress.component.html' | ||
}) | ||
export class NavItemProgressComponent { | ||
|
||
@Input() | ||
nodeCompletion: string; | ||
|
||
@Input() | ||
period: any; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/webapp/site/src/app/classroom-monitor/step-info/step-info.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div fxLayout="row" fxLayoutAlign="start center"> | ||
<node-icon [nodeId]="nodeId" size="18" fxHide.xs></node-icon> | ||
<span fxHide.xs> </span> | ||
<div class="heavy"> | ||
{{ stepTitle }} | ||
<status-icon *ngIf="hasAlert" | ||
[iconClass]="alertIconClass" | ||
[iconName]="alertIconName" | ||
[iconLabel]="alertIconLabel" | ||
[iconTooltip]="alertIconLabel"></status-icon> | ||
<status-icon *ngIf="hasRubrics" | ||
iconClass="info" | ||
iconName="info" | ||
[iconLabel]="rubricIconLabel" | ||
[iconTooltip]="rubricIconLabel"></status-icon> | ||
<span *ngIf="hasNewWork" class="badge badge--info animate-fade" i18n>New</span> | ||
</div> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
src/main/webapp/site/src/app/classroom-monitor/step-info/step-info.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { TeacherProjectService } from '../../../../../wise5/services/teacherProjectService'; | ||
|
||
@Component({ | ||
selector: 'step-info', | ||
templateUrl: 'step-info.component.html' | ||
}) | ||
export class StepInfoComponent { | ||
$translate: any; | ||
alertIconClass: string; | ||
alertIconLabel: string; | ||
alertIconName: string; | ||
@Input() | ||
hasAlert: boolean; | ||
@Input() | ||
hasNewAlert: boolean; | ||
@Input() | ||
hasNewWork: boolean; | ||
hasRubrics: boolean; | ||
@Input() | ||
nodeId: string; | ||
rubricIconLabel: string; | ||
stepTitle: string; | ||
|
||
constructor(private ProjectService: TeacherProjectService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.stepTitle = this.ProjectService.getNodePositionAndTitleByNodeId(this.nodeId); | ||
if (this.hasAlert) { | ||
this.alertIconClass = this.hasNewAlert ? 'warn' : 'text-disabled'; | ||
this.alertIconName = 'notifications'; | ||
this.alertIconLabel = this.hasNewAlert ? $localize`Has new alert(s)`: | ||
$localize`Has dismissed alert(s)`; | ||
} | ||
this.hasRubrics = this.ProjectService.getNumberOfRubricsByNodeId(this.nodeId) > 0; | ||
this.rubricIconLabel = $localize`Step has rubrics/teaching tips`; | ||
} | ||
} |
Oops, something went wrong.