forked from WISE-Community/WISE-DEPRECATED
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created Milestone Grading View component. #18
- Loading branch information
1 parent
0155464
commit c36e5b0
Showing
6 changed files
with
248 additions
and
166 deletions.
There are no files selected for viewing
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
63 changes: 63 additions & 0 deletions
63
...itor/classroomMonitorComponents/milestones/milestoneGradingView/milestoneGradingView.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,63 @@ | ||
<div class="l-constrained grading"> | ||
<md-list class="user-list"> | ||
<md-list-item class="md-whiteframe-1dp md-with-secondary list-item list-item--actions" | ||
layout-wrap> | ||
<div flex-xs="100" flex-sm="100"> | ||
<workgroup-select-autocomplete></workgroup-select-autocomplete> | ||
</div> | ||
<span flex hide-xs hide-sm></span> | ||
<div class="md-secondary-container" flex-xs="100" flex-sm="100" | ||
layout-column layout-align="center center"> | ||
<md-button aria-label="{{ ::'expandAllLabel' | translate }}" | ||
class="button--small md-primary" ng-click="$ctrl.expandAll()"> | ||
{{ ::'expandAll' | translate }} | ||
</md-button> | ||
<md-button aria-label="{{ ::'collapseAllLabel' | translate }}" | ||
class="button--small md-primary" ng-click="$ctrl.collapseAll()"> | ||
{{ ::'collapseAll' | translate }} | ||
</md-button> | ||
</div> | ||
</md-list-item> | ||
<md-list-item class="table--list__thead table--list__thead__th md-whiteframe-1dp"> | ||
<div class="md-list-item-text table--list__thead__tr" layout="row" flex> | ||
<md-button class="table--list__thead__link" flex layout="row" layout-align="start center" | ||
ng-click="$ctrl.setSort('team')" aria-label="{{::'sortByTeam' | translate}}"> | ||
<span translate="team"></span> | ||
<md-icon ng-if="$ctrl.sort === 'team' || $ctrl.sort === '-team'" | ||
class="text-light table--list__thead__sort" md-theme="default" | ||
ng-class="{'table--list__thead__sort--reverse': $ctrl.sort === '-team'}"> | ||
arrow_drop_up | ||
</md-icon> | ||
</md-button> | ||
<md-button class="table--list__thead__link" flex="30" | ||
layout="row" layout-align="center center" ng-click="$ctrl.setSort('status')" | ||
aria-label="{{::'sortByCompletion' | translate}}"> | ||
<span translate="status"></span> | ||
<md-icon ng-if="$ctrl.sort === 'status' || $ctrl.sort === '-status'" | ||
class="text-light table--list__thead__sort" md-theme="default" | ||
ng-class="{'table--list__thead__sort--reverse': $ctrl.sort === '-status'}"> | ||
arrow_drop_up | ||
</md-icon> | ||
</md-button> | ||
<md-button class="table--list__thead__link" flex="20" layout="row" | ||
layout-align="center center" ng-click="$ctrl.setSort('score')" | ||
aria-label="{{::'sortByScore' | translate}}"> | ||
<span translate="score"></span> | ||
<md-icon ng-if="$ctrl.sort === 'score' || $ctrl.sort === '-score'" | ||
class="text-light table--list__thead__sort" md-theme="default" | ||
ng-class="{'table--list__thead__sort--reverse': $ctrl.sort === '-score'}"> | ||
arrow_drop_up | ||
</md-icon> | ||
</md-button> | ||
</div> | ||
</md-list-item> | ||
<workgroup-item ng-repeat="workgroup in $ctrl.workgroupsById | toArray | orderBy:$ctrl.getOrderBy()" | ||
ng-if="$ctrl.isWorkgroupShown(workgroup)" | ||
expand="$ctrl.workVisibilityById[workgroup.$key]" max-score="$ctrl.maxScore" | ||
show-score="true" node-id="$ctrl.nodeId" | ||
component-id="$ctrl.componentId" workgroup-id="::workgroup.workgroupId" | ||
workgroup-data="workgroup" hidden-components="$ctrl.hiddenComponents" | ||
on-update-expand="$ctrl.onUpdateExpand(workgroupId, value)" | ||
in-view="$ctrl.workgroupInView(workgroup.$key, $inview)"></workgroup-item> | ||
</md-list> | ||
</div> |
131 changes: 131 additions & 0 deletions
131
...onitor/classroomMonitorComponents/milestones/milestoneGradingView/milestoneGradingView.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,131 @@ | ||
import { Directive } from '@angular/core'; | ||
import { AnnotationService } from '../../../../services/annotationService'; | ||
import { ConfigService } from '../../../../services/configService'; | ||
import { MilestoneService } from '../../../../services/milestoneService'; | ||
import { NodeService } from '../../../../services/nodeService'; | ||
import { NotificationService } from '../../../../services/notificationService'; | ||
import { StudentStatusService } from '../../../../services/studentStatusService'; | ||
import { TeacherDataService } from '../../../../services/teacherDataService'; | ||
import { TeacherProjectService } from '../../../../services/teacherProjectService'; | ||
import { NodeGradingViewController } from '../../nodeGrading/nodeGradingView/nodeGradingView'; | ||
|
||
@Directive() | ||
class MilestoneGradingViewController extends NodeGradingViewController { | ||
milestone: any; | ||
nodeId: string; | ||
componentId: string; | ||
|
||
constructor( | ||
protected $filter: any, | ||
protected AnnotationService: AnnotationService, | ||
protected ConfigService: ConfigService, | ||
protected MilestoneService: MilestoneService, | ||
protected NodeService: NodeService, | ||
protected NotificationService: NotificationService, | ||
protected ProjectService: TeacherProjectService, | ||
protected StudentStatusService: StudentStatusService, | ||
protected TeacherDataService: TeacherDataService | ||
) { | ||
super( | ||
$filter, | ||
AnnotationService, | ||
ConfigService, | ||
MilestoneService, | ||
NodeService, | ||
NotificationService, | ||
ProjectService, | ||
StudentStatusService, | ||
TeacherDataService | ||
); | ||
} | ||
|
||
$onInit() { | ||
this.nodeId = this.milestone.nodeId; | ||
this.componentId = this.milestone.componentId; | ||
this.maxScore = this.getMaxScore(); | ||
this.retrieveStudentData(); | ||
this.subscribeToEvents(); | ||
this.saveNodeGradingViewDisplayedEvent(); | ||
} | ||
|
||
getScoreByWorkgroupId(workgroupId: number): number { | ||
let score = null; | ||
const latestScoreAnnotation = this.AnnotationService.getLatestScoreAnnotation( | ||
this.nodeId, | ||
this.componentId, | ||
workgroupId | ||
); | ||
if (latestScoreAnnotation) { | ||
score = this.AnnotationService.getScoreValueFromScoreAnnotation(latestScoreAnnotation); | ||
} | ||
return typeof score === 'number' ? score : -1; | ||
} | ||
|
||
expandAll(): void { | ||
super.expandAll(); | ||
this.saveMilestoneStudentWorkExpandCollapseAllEvent('MilestoneStudentWorkExpandAllClicked'); | ||
} | ||
|
||
collapseAll(): void { | ||
super.collapseAll(); | ||
this.saveMilestoneStudentWorkExpandCollapseAllEvent('MilestoneStudentWorkCollapseAllClicked'); | ||
} | ||
|
||
saveMilestoneStudentWorkExpandCollapseAllEvent(event) { | ||
const context = 'ClassroomMonitor', | ||
nodeId = null, | ||
componentId = null, | ||
componentType = null, | ||
category = 'Navigation', | ||
data = { milestoneId: this.milestone.id }; | ||
this.TeacherDataService.saveEvent( | ||
context, | ||
nodeId, | ||
componentId, | ||
componentType, | ||
category, | ||
event, | ||
data | ||
); | ||
} | ||
|
||
onUpdateExpand(workgroupId: number, isExpanded: boolean): void { | ||
super.onUpdateExpand(workgroupId, isExpanded); | ||
this.saveMilestoneWorkgroupItemViewedEvent(workgroupId, isExpanded); | ||
} | ||
|
||
saveMilestoneWorkgroupItemViewedEvent(workgroupId, isExpanded) { | ||
let event = ''; | ||
if (isExpanded) { | ||
event = 'MilestoneStudentWorkOpened'; | ||
} else { | ||
event = 'MilestoneStudentWorkClosed'; | ||
} | ||
const context = 'ClassroomMonitor', | ||
nodeId = null, | ||
componentId = null, | ||
componentType = null, | ||
category = 'Navigation', | ||
data = { milestoneId: this.milestone.id, workgroupId: workgroupId }; | ||
this.TeacherDataService.saveEvent( | ||
context, | ||
nodeId, | ||
componentId, | ||
componentType, | ||
category, | ||
event, | ||
data | ||
); | ||
} | ||
} | ||
|
||
const MilestoneGradingView = { | ||
bindings: { | ||
milestone: '<' | ||
}, | ||
controller: MilestoneGradingViewController, | ||
templateUrl: | ||
'/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestoneGradingView/milestoneGradingView.html' | ||
}; | ||
|
||
export default MilestoneGradingView; |
8 changes: 6 additions & 2 deletions
8
src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestones.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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
'use strict'; | ||
|
||
import MilestoneDetails from './milestoneDetails/milestoneDetails'; | ||
import * as angular from 'angular'; | ||
import MilestoneDetails from './milestoneDetails/milestoneDetails'; | ||
import MilestoneGradingView from './milestoneGradingView/milestoneGradingView'; | ||
|
||
const Milestones = angular.module('milestones', []).component('milestoneDetails', MilestoneDetails); | ||
const Milestones = angular | ||
.module('milestones', []) | ||
.component('milestoneDetails', MilestoneDetails) | ||
.component('milestoneGradingView', MilestoneGradingView); | ||
|
||
export default Milestones; |
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
Oops, something went wrong.