Skip to content

Commit 60a7473

Browse files
authored
Merge pull request #2823 from WISE-Community/issue-2822-upgrade-unit-rubric-authoring-to-angular
Upgraded unit rubric authoring to angular
2 parents 940d7c4 + 0472f1f commit 60a7473

7 files changed

Lines changed: 57 additions & 68 deletions

File tree

src/main/webapp/site/src/app/teacher-hybrid-angular.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { NodeAdvancedJsonAuthoringComponent } from '../../../wise5/authoringTool
2828
import { WorkgroupInfoComponent } from '../../../wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroupInfo/workgroup-info.component';
2929
import { NodeAdvancedGeneralAuthoringComponent } from '../../../wise5/authoringTool/node/advanced/general/node-advanced-general-authoring.component';
3030
import { WiseAuthoringTinymceEditorComponent } from '../../../wise5/directives/wise-tinymce-editor/wise-authoring-tinymce-editor.component';
31+
import { RubricAuthoringComponent } from '../../../wise5/authoringTool/rubric/rubric-authoring.component';
3132

3233
@NgModule({
3334
declarations: [
@@ -41,6 +42,7 @@ import { WiseAuthoringTinymceEditorComponent } from '../../../wise5/directives/w
4142
MilestoneReportDataComponent,
4243
NodeAdvancedGeneralAuthoringComponent,
4344
NodeAdvancedJsonAuthoringComponent,
45+
RubricAuthoringComponent,
4446
StatusIconComponent,
4547
WorkgroupInfoComponent,
4648
WorkgroupNodeScoreComponent,

src/main/webapp/site/src/messages.xlf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5782,6 +5782,10 @@
57825782
<context context-type="sourcefile">../../wise5/authoringTool/advanced/advanced-project-authoring.component.html</context>
57835783
<context context-type="linenumber">4</context>
57845784
</context-group>
5785+
<context-group purpose="location">
5786+
<context context-type="sourcefile">../../wise5/authoringTool/rubric/rubric-authoring.component.html</context>
5787+
<context context-type="linenumber">2</context>
5788+
</context-group>
57855789
</trans-unit>
57865790
<trans-unit datatype="html" id="077fb7924ecebe2ae768d860909315c29ee61fbe">
57875791
<source>Show JSON</source>
@@ -5981,6 +5985,13 @@
59815985
<context context-type="linenumber">2</context>
59825986
</context-group>
59835987
</trans-unit>
5988+
<trans-unit datatype="html" id="92328333ea9c72926ca7c631e9e1c0f081cbf565">
5989+
<source>Edit Unit Rubric</source>
5990+
<context-group purpose="location">
5991+
<context context-type="sourcefile">../../wise5/authoringTool/rubric/rubric-authoring.component.html</context>
5992+
<context context-type="linenumber">6</context>
5993+
</context-group>
5994+
</trans-unit>
59845995
<trans-unit datatype="html" id="f9c52903219e583ddefb23cd102d2057504ac980">
59855996
<source>(Team <x equiv-text="{{workgroupId}}" id="INTERPOLATION"/>)</source>
59865997
<context-group purpose="location">
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<button mat-button class='topButton mat-raised-button mat-primary' (click)='goBack()'
2+
matTooltip="Back to Unit Plan" i18n-matTooltip matToolTipPosition="above">
3+
<mat-icon>arrow_back</mat-icon>
4+
</button>
5+
<br/>
6+
<h5 i18n>Edit Unit Rubric</h5>
7+
<wise-authoring-tinymce-editor [(model)]='rubric' (modelChange)='rubricChanged()'>
8+
</wise-authoring-tinymce-editor>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ConfigService } from '../../services/configService';
2+
import { UtilService } from '../../services/utilService';
3+
import { TeacherProjectService } from '../../services/teacherProjectService';
4+
import { UpgradeModule } from '@angular/upgrade/static';
5+
import { Component } from '@angular/core';
6+
7+
@Component({
8+
templateUrl: 'rubric-authoring.component.html',
9+
})
10+
export class RubricAuthoringComponent {
11+
12+
rubric: string = '';
13+
14+
constructor(private upgrade: UpgradeModule, private ConfigService: ConfigService,
15+
private ProjectService: TeacherProjectService, private UtilService: UtilService) {
16+
}
17+
18+
ngOnInit(): void {
19+
this.rubric = this.ProjectService.replaceAssetPaths(this.ProjectService.getProjectRubric());
20+
}
21+
22+
rubricChanged(): void {
23+
const html = this.UtilService.insertWISELinks(
24+
this.ConfigService.removeAbsoluteAssetPaths(this.rubric));
25+
this.ProjectService.setProjectRubric(html);
26+
this.ProjectService.saveProject();
27+
}
28+
29+
goBack(): void {
30+
this.upgrade.$injector.get('$state').go('root.at.project');
31+
}
32+
}

src/main/webapp/wise5/authoringTool/rubric/rubricAuthoring.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/webapp/wise5/authoringTool/rubric/rubricAuthoringController.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/main/webapp/wise5/teacher/teacher-angular-js-module.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import NotebookGradingController from '../classroomMonitor/notebook/notebookGrad
3030
import ProjectAssetController from '../authoringTool/asset/projectAssetController';
3131
import ProjectController from '../authoringTool/project/projectController';
3232
import ProjectInfoController from '../authoringTool/info/projectInfoController';
33-
import RubricAuthoringController from '../authoringTool/rubric/rubricAuthoringController';
33+
import { RubricAuthoringComponent } from '../authoringTool/rubric/rubric-authoring.component';
3434
import StudentGradingController from '../classroomMonitor/studentGrading/studentGradingController';
3535
import StudentProgressController from '../classroomMonitor/studentProgress/studentProgressController';
3636
import WISELinkAuthoringController from '../authoringTool/wiseLink/wiseLinkAuthoringController';
@@ -121,7 +121,8 @@ import '../components/table/tableAuthoringComponentModule';
121121
.controller('ProjectAssetController', ProjectAssetController)
122122
.controller('ProjectController', ProjectController)
123123
.controller('ProjectInfoController', ProjectInfoController)
124-
.controller('RubricAuthoringController', RubricAuthoringController)
124+
.directive('rubricAuthoringComponent', downgradeComponent(
125+
{ component: RubricAuthoringComponent }) as angular.IDirectiveFactory)
125126
.controller('StudentGradingController', StudentGradingController)
126127
.controller('StudentProgressController', StudentProgressController)
127128
.controller('WISELinkAuthoringController', WISELinkAuthoringController)
@@ -264,9 +265,7 @@ import '../components/table/tableAuthoringComponentModule';
264265
})
265266
.state('root.at.project.rubric', {
266267
url: '/rubric',
267-
templateUrl: '/wise5/authoringTool/rubric/rubricAuthoring.html',
268-
controller: 'RubricAuthoringController',
269-
controllerAs: 'rubricAuthoringController'
268+
component: 'rubricAuthoringComponent'
270269
})
271270
.state('root.at.project.notebook', {
272271
url: '/notebook',

0 commit comments

Comments
 (0)