From 368a204d7d16b05280905f3535a0f2c41769d897 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 8 May 2025 14:58:32 -0700 Subject: [PATCH 01/17] fix(Create Run Dialog): Show spinner when run is being created (#2174) --- .../create-run-dialog.component.spec.ts | 18 ++++++------------ .../create-run-dialog.component.ts | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/app/teacher/create-run-dialog/create-run-dialog.component.spec.ts b/src/app/teacher/create-run-dialog/create-run-dialog.component.spec.ts index 6b8f450812a..1a04d0b61d9 100644 --- a/src/app/teacher/create-run-dialog/create-run-dialog.component.spec.ts +++ b/src/app/teacher/create-run-dialog/create-run-dialog.component.spec.ts @@ -3,14 +3,10 @@ import { TeacherService } from '../teacher.service'; import { CreateRunDialogComponent } from './create-run-dialog.component'; import { MatDialogRef, MatDialog } from '@angular/material/dialog'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatRadioModule } from '@angular/material/radio'; -import { ReactiveFormsModule } from '@angular/forms'; import { Observable } from 'rxjs'; import { of } from 'rxjs'; import { Project } from '../../domain/project'; import { Run } from '../../domain/run'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { Course } from '../../domain/course'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; @@ -40,7 +36,7 @@ export class MockTeacherService { const courses: Course[] = []; const course = new Course({ id: '1', name: 'Test' }); courses.push(course); - return Observable.create((observer) => { + return new Observable((observer) => { observer.next(courses); observer.complete(); }); @@ -106,24 +102,22 @@ describe('CreateRunDialogComponent', () => { { provide: MatDialogRef, useValue: { - afterClosed: () => { - return Observable.create((observer) => { + afterClosed: () => + new Observable((observer) => { observer.next({}); observer.complete(); - }); - }, + }), close: () => {} } }, { provide: MAT_DIALOG_DATA, useValue: { project: project } }, { provide: Router, useClass: MockRouter } - ], - schemas: [NO_ERRORS_SCHEMA] + ] }); fixture = TestBed.createComponent(CreateRunDialogComponent); component = fixture.componentInstance; component.project = project; - component.dialog = TestBed.get(MatDialog); + component.dialog = TestBed.inject(MatDialog); spyOn(component.dialog, 'closeAll').and.callThrough(); fixture.detectChanges(); }); diff --git a/src/app/teacher/create-run-dialog/create-run-dialog.component.ts b/src/app/teacher/create-run-dialog/create-run-dialog.component.ts index c319c9c31d7..beaa061d1e1 100644 --- a/src/app/teacher/create-run-dialog/create-run-dialog.component.ts +++ b/src/app/teacher/create-run-dialog/create-run-dialog.component.ts @@ -23,7 +23,6 @@ import { provideNativeDateAdapter } from '@angular/material/core'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatCardModule } from '@angular/material/card'; import { Router } from '@angular/router'; import { finalize } from 'rxjs/operators'; @@ -35,6 +34,7 @@ import { ListClassroomCoursesDialogComponent } from '../list-classroom-courses-d import { TeacherRun } from '../teacher-run'; import { MatDividerModule } from '@angular/material/divider'; import { MatRadioModule } from '@angular/material/radio'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; @Component({ imports: [ @@ -51,7 +51,7 @@ import { MatRadioModule } from '@angular/material/radio'; MatRadioModule, MatTooltipModule, MatFormFieldModule, - MatProgressSpinnerModule, + MatProgressBarModule, MatCardModule ], providers: [provideNativeDateAdapter()], From 442fc920d51fb6541791666f70411a6d7ba50a8e Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 8 May 2025 15:53:18 -0700 Subject: [PATCH 02/17] refactor(LibraryService): Move ProjectFilterValues out of class (#2169) --- src/app/curriculum/curriculum.component.ts | 3 ++- src/app/domain/projectFilterValues.ts | 8 +++++--- .../home-page-project-library.component.ts | 3 +-- .../library-filters.component.html | 16 ++++++++-------- .../library-filters.component.spec.ts | 8 ++++---- .../library-filters.component.ts | 19 ++++++++----------- .../library/library/library.component.ts | 13 ++++++------- .../official-library.component.spec.ts | 3 +-- .../official-library.component.ts | 5 ----- .../personal-library.component.spec.ts | 2 ++ .../personal-library.component.ts | 4 +++- .../public-library.component.spec.ts | 8 ++++---- ...ublic-unit-type-selector.component.spec.ts | 10 ++-------- .../public-unit-type-selector.component.ts | 8 +------- src/app/services/library.service.ts | 6 ------ src/messages.xlf | 12 ++++++------ 16 files changed, 53 insertions(+), 75 deletions(-) diff --git a/src/app/curriculum/curriculum.component.ts b/src/app/curriculum/curriculum.component.ts index 03f41e9f68f..341e9684b4d 100644 --- a/src/app/curriculum/curriculum.component.ts +++ b/src/app/curriculum/curriculum.component.ts @@ -11,6 +11,7 @@ import { Subscription } from 'rxjs'; import { UserService } from '../services/user.service'; import { MatButtonModule } from '@angular/material/button'; import { Router, RouterModule } from '@angular/router'; +import { ProjectFilterValues } from '../domain/projectFilterValues'; @Component({ imports: [ @@ -23,6 +24,7 @@ import { Router, RouterModule } from '@angular/router'; PublicLibraryComponent, RouterModule ], + providers: [ProjectFilterValues], styleUrl: './curriculum.component.scss', templateUrl: './curriculum.component.html' }) @@ -41,7 +43,6 @@ export class CurriculumComponent { ngOnInit(): void { this.showMyUnits = this.userService.isTeacher(); - this.libraryService.initFilterValues(); this.getLibraryProjects(); this.subscribeNumUnitsVisible(); } diff --git a/src/app/domain/projectFilterValues.ts b/src/app/domain/projectFilterValues.ts index 65ba0ee129c..6d0c258ae43 100644 --- a/src/app/domain/projectFilterValues.ts +++ b/src/app/domain/projectFilterValues.ts @@ -57,11 +57,13 @@ export class ProjectFilterValues { } clear(): void { - this.standardValue = []; this.disciplineValue = []; - this.unitTypeValue = []; - this.gradeLevelValue = []; this.featureValue = []; + this.gradeLevelValue = []; + this.publicUnitTypeValue = []; + this.searchValue = ''; + this.standardValue = []; + this.unitTypeValue = []; } private matchesUnitType(project: LibraryProject): boolean { diff --git a/src/app/modules/library/home-page-project-library/home-page-project-library.component.ts b/src/app/modules/library/home-page-project-library/home-page-project-library.component.ts index 6545594a939..b9384d0c715 100644 --- a/src/app/modules/library/home-page-project-library/home-page-project-library.component.ts +++ b/src/app/modules/library/home-page-project-library/home-page-project-library.component.ts @@ -3,14 +3,13 @@ import { LibraryService } from '../../../services/library.service'; import { ProjectFilterValues } from '../../../domain/projectFilterValues'; @Component({ + providers: [ProjectFilterValues], selector: 'app-home-page-project-library', styleUrls: ['./home-page-project-library.component.scss', '../library/library.component.scss'], templateUrl: './home-page-project-library.component.html', standalone: false }) export class HomePageProjectLibraryComponent { - protected filterValues: ProjectFilterValues = new ProjectFilterValues(); - constructor(private libraryService: LibraryService) { libraryService.getOfficialLibraryProjects(); } diff --git a/src/app/modules/library/library-filters/library-filters.component.html b/src/app/modules/library/library-filters/library-filters.component.html index 33c73c71c17..79e797d46d4 100644 --- a/src/app/modules/library/library-filters/library-filters.component.html +++ b/src/app/modules/library/library-filters/library-filters.component.html @@ -1,7 +1,7 @@
- +
}
diff --git a/src/messages.xlf b/src/messages.xlf index 192486b8aa9..f7831fea888 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -283,7 +283,7 @@ src/app/modules/library/library-project-details/library-project-details.component.html - 198,202 + 204,208 src/app/modules/library/public-unit-type-selector/community-library-details.html @@ -1059,7 +1059,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-filters/library-filters.component.html - 46,47 + 47,48 src/assets/wise5/authoringTool/milestones-authoring/milestones-authoring.component.html @@ -5493,7 +5493,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-filters/library-filters.component.html - 117,119 + 121,123 src/app/modules/mobile-menu/mobile-menu.component.html @@ -5795,46 +5795,53 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.29,34 + + Type filter explanation + + src/app/modules/library/library-filters/library-filters.component.html + 54,58 + + Discipline src/app/modules/library/library-filters/library-filters.component.html - 63,65 + 67,69 Grade Level src/app/modules/library/library-filters/library-filters.component.html - 81,83 + 85,87 Standards Addressed src/app/modules/library/library-filters/library-filters.component.html - 100,102 + 104,106 WISE Platform src/app/modules/library/library-filters/library-filters.component.ts - 46 + 48 Other Platform src/app/modules/library/library-filters/library-filters.component.ts - 47 + 49 NGSS src/app/modules/library/library-filters/library-filters.component.ts - 111 + 114 src/app/modules/library/library-project-details/library-project-details.component.ts @@ -5845,7 +5852,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Common Core src/app/modules/library/library-filters/library-filters.component.ts - 112 + 115 src/app/modules/library/library-project-details/library-project-details.component.ts @@ -5856,13 +5863,34 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Learning For Justice src/app/modules/library/library-filters/library-filters.component.ts - 113 + 116 src/app/modules/library/library-project-details/library-project-details.component.ts 51 + + "Type" indicates the platform on which a unit runs. "WISE Platform" units are created + using the WISE authoring tool. Students use WISE accounts to complete lessons and teachers can review and grade + work on the WISE platform. "Other" units are created using different platforms. Resources for these units + are linked in the unit details. + + src/app/modules/library/library-filters/library-filters.component.ts + 185,188 + + + + Unit Type + + src/app/modules/library/library-filters/library-filters.component.ts + 192 + + + src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.html + 1,2 + + : @@ -5913,81 +5941,88 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.37,39 + + Note: This unit was created outside of the WISE platform. Teaching resources are linked below. + + src/app/modules/library/library-project-details/library-project-details.component.html + 73,77 + + Resources: src/app/modules/library/library-project-details/library-project-details.component.html - 73,75 + 79,81 Discipline: src/app/modules/library/library-project-details/library-project-details.component.html - 86,88 + 92,94 Features: src/app/modules/library/library-project-details/library-project-details.component.html - 98,99 + 104,105 Standards Addressed: src/app/modules/library/library-project-details/library-project-details.component.html - 111,113 + 117,119 This unit is a copy of (used under CC BY-SA). src/app/modules/library/library-project-details/library-project-details.component.html - 154,156 + 160,162 This unit is a copy of by (used under CC BY-SA). src/app/modules/library/library-project-details/library-project-details.component.html - 160,163 + 166,169 This unit is licensed under CC BY-SA. src/app/modules/library/library-project-details/library-project-details.component.html - 171,173 + 177,179 This unit is licensed under CC BY-SA by . src/app/modules/library/library-project-details/library-project-details.component.html - 176,178 + 182,184 View License src/app/modules/library/library-project-details/library-project-details.component.html - 183,187 + 189,193 More src/app/modules/library/library-project-details/library-project-details.component.html - 191,197 + 197,203 Use with Class src/app/modules/library/library-project-details/library-project-details.component.html - 207,212 + 213,218 src/app/teacher/create-run-dialog/create-run-dialog.component.html @@ -5998,7 +6033,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Preview src/app/modules/library/library-project-details/library-project-details.component.html - 213,217 + 221,223 src/app/teacher/run-menu/run-menu.component.html @@ -6029,6 +6064,13 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.71,74 + + Unit Resources + + src/app/modules/library/library-project-details/library-project-details.component.html + 223,228 + + License pertains to original content created by the author(s). Authors are responsible for the usage and attribution of any third-party content linked to or included in this work. @@ -11245,13 +11287,6 @@ The branches will be removed but the steps will remain in the unit. 99 - - Unit Type - - src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.html - 1,2 - - WISE Platform (Uses features on this platform to collect student data) From a9a643fec4a071677950972f0a0359c869bc7ed5 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Tue, 13 May 2025 15:00:18 -0700 Subject: [PATCH 06/17] Remove routing to specific component. Show all components in NodeGrading view. Remove SelectComponentComponent. --- .../teacher/teacher-tools-routing.module.ts | 15 +-------- .../node-grading/node-grading.component.html | 9 ++---- .../node-grading.component.spec.ts | 6 +--- .../node-grading/node-grading.component.ts | 27 +++------------- .../select-component.component.html | 10 ------ .../select-component.component.scss | 24 -------------- .../select-component.component.spec.ts | 22 ------------- .../select-component.component.ts | 32 ------------------- src/messages.xlf | 9 +----- 9 files changed, 10 insertions(+), 144 deletions(-) delete mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.html delete mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.scss delete mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.spec.ts delete mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.ts diff --git a/src/app/teacher/teacher-tools-routing.module.ts b/src/app/teacher/teacher-tools-routing.module.ts index 49b59eb22ff..1f7761f8f85 100644 --- a/src/app/teacher/teacher-tools-routing.module.ts +++ b/src/app/teacher/teacher-tools-routing.module.ts @@ -1,4 +1,4 @@ -import { inject, NgModule } from '@angular/core'; +import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { ClassroomMonitorComponent } from '../../assets/wise5/classroomMonitor/classroom-monitor.component'; import { TeacherToolsResolver } from './teacher-tools.resolver'; @@ -17,7 +17,6 @@ import { ExportEventsComponent } from '../../assets/wise5/classroomMonitor/dataE import { ExportOneWorkgroupPerRowComponent } from '../../assets/wise5/classroomMonitor/dataExport/export-one-workgroup-per-row/export-one-workgroup-per-row.component'; import { ExportStudentWorkComponent } from '../../assets/wise5/classroomMonitor/dataExport/export-student-work/export-student-work.component'; import { NodeGradingComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component'; -import { TeacherProjectService } from '../../assets/wise5/services/teacherProjectService'; const routes: Routes = [ { @@ -38,18 +37,6 @@ const routes: Routes = [ { path: 'group/:nodeId', component: NodeProgressViewComponent }, { path: 'node/:nodeId', - pathMatch: 'full', - redirectTo: ({ params }) => { - const nodeId = params['nodeId']; - const projectService = inject(TeacherProjectService); - const components = projectService - .getComponents(nodeId) - .filter((component) => projectService.componentHasWork(component)); - return `node/${nodeId}/component/${components[0].id}`; - } - }, - { - path: 'node/:nodeId/component/:componentId', component: NodeGradingComponent }, { path: 'notebook', component: NotebookGradingComponent }, diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html index fa6759e4a44..b7297c46376 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html @@ -26,12 +26,9 @@

Question: -
- + @for (component of components; track component.id) { + + } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts index 3d0c5df16e7..dc2493e6eae 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts @@ -2,13 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NodeGradingComponent } from './node-grading.component'; import { TeacherProjectService } from '../../../../services/teacherProjectService'; import { TeacherDataService } from '../../../../services/teacherDataService'; -import { provideRouter } from '@angular/router'; import { MockProviders } from 'ng-mocks'; import { ClassroomStatusService } from '../../../../services/classroomStatusService'; import { Node } from '../../../../common/Node'; import { Observable, Subject } from 'rxjs'; -import { AnnotationService } from '../../../../services/annotationService'; -import { ComponentServiceLookupService } from '../../../../services/componentServiceLookupService'; import { ClassroomMonitorTestingModule } from '../../../classroom-monitor-testing.module'; import { WorkgroupService } from '../../../../../../app/services/workgroup.service'; @@ -44,7 +41,6 @@ describe('NodeGradingComponent', () => { imports: [NodeGradingComponent, ClassroomMonitorTestingModule], providers: [ MockProviders(ClassroomStatusService, TeacherProjectService, WorkgroupService), - provideRouter([]), { provide: TeacherDataService, useClass: MockDataService } ] }).compileComponents(); @@ -65,7 +61,6 @@ describe('NodeGradingComponent', () => { component = fixture.componentInstance; component.nodeId = 'node1'; component.ngOnInit(); - component.ngOnChanges(); }); periodChanged_RecalculateNodeCompletion(); @@ -74,6 +69,7 @@ describe('NodeGradingComponent', () => { function periodChanged_RecalculateNodeCompletion() { describe('period changed', () => { it('recalculates node completion', () => { + nodeCompletionSpy.calls.reset(); dataService.setCurrentPeriod({ periodId: 1 }); expect(nodeCompletionSpy).toHaveBeenCalledTimes(1); }); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts index e0606302b99..8bd2637ba8e 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts @@ -7,12 +7,9 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { MatIconModule } from '@angular/material/icon'; import { MatDialog } from '@angular/material/dialog'; import { ShowNodeInfoDialogComponent } from '../../../../../../app/classroom-monitor/show-node-info-dialog/show-node-info-dialog.component'; -import { SelectComponentComponent } from '../select-component/select-component.component'; import { Node } from '../../../../common/Node'; import { Subscription } from 'rxjs'; -import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { ComponentGradingViewComponent } from '../../component-grading-view/component-grading-view.component'; -import { ComponentContent } from '../../../../common/ComponentContent'; import { MatButtonModule } from '@angular/material/button'; @Component({ @@ -21,12 +18,8 @@ import { MatButtonModule } from '@angular/material/button'; ComponentGradingViewComponent, FlexLayoutModule, MatButtonModule, - MatIconModule, - RouterModule, - SelectComponentComponent + MatIconModule ], - selector: 'node-grading', - standalone: true, styles: [ ` .content-head-label { @@ -45,8 +38,6 @@ import { MatButtonModule } from '@angular/material/button'; templateUrl: './node-grading.component.html' }) export class NodeGradingComponent { - protected component: ComponentContent; - @Input() componentId: string; protected components: any[]; protected hasWork: boolean; protected node: Node; @@ -62,12 +53,11 @@ export class NodeGradingComponent { private classroomStatusService: ClassroomStatusService, private dataService: TeacherDataService, private dialog: MatDialog, - private projectService: TeacherProjectService, - private route: ActivatedRoute, - private router: Router + private projectService: TeacherProjectService ) {} ngOnInit(): void { + this.setFields(); this.subscriptions.add( this.dataService.currentPeriodChanged$.subscribe(() => this.setPeriod()) ); @@ -78,9 +68,7 @@ export class NodeGradingComponent { } ngOnChanges(): void { - if (this.nodeId && this.componentId) { - this.setFields(); - } + this.setFields(); } private setFields(): void { @@ -98,7 +86,6 @@ export class NodeGradingComponent { this.components = this.projectService .getComponents(this.nodeId) .filter((component) => this.projectService.componentHasWork(component)); - this.component = this.node.getComponent(this.componentId); this.numRubrics = this.node.getNumRubrics(); this.setPeriod(); } @@ -129,10 +116,4 @@ export class NodeGradingComponent { width: '90%' }); } - - protected navigateToComponent(component: ComponentContent): void { - this.router.navigate(['..', component.id], { - relativeTo: this.route - }); - } } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.html deleted file mode 100644 index 50a3187660e..00000000000 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.html +++ /dev/null @@ -1,10 +0,0 @@ - - - @for (component of components; track component.id; let i = $index) { - - {{ i + 1 }}. {{ getComponentTypeLabel(component.type) }} - - } - - - of {{ components.length }} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.scss b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.scss deleted file mode 100644 index 3efe750dd27..00000000000 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.scss +++ /dev/null @@ -1,24 +0,0 @@ -@use '@angular/material' as mat; -@use 'style/base/typography'; - -.select-component { - .mdc-line-ripple { - &:before, &:after { - display: none; - } - } - - .mdc-text-field--no-label:not(.mdc-text-field--outlined):not(.mdc-text-field--textarea) .mat-mdc-form-field-infix { - padding-top: 6px; - padding-bottom: 6px; - min-height: 28px; - } - - .mat-mdc-form-field-flex { - height: 36px; - } - -.mat-mdc-select-value-text, .mat-mdc-form-field-input-control.mat-mdc-form-field-input-control { - font-size: mat.m2-font-size(typography.$wise-typography, 'caption'); - } -} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.spec.ts deleted file mode 100644 index 7f6e965293c..00000000000 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { SelectComponentComponent } from './select-component.component'; - -describe('SelectComponentComponent', () => { - let component: SelectComponentComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [SelectComponentComponent] - }).compileComponents(); - - fixture = TestBed.createComponent(SelectComponentComponent); - component = fixture.componentInstance; - component.components = []; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.ts deleted file mode 100644 index 955f0965955..00000000000 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; -import { MatSelectModule } from '@angular/material/select'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { ComponentContent } from '../../../../common/ComponentContent'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { ComponentTypeService } from '../../../../services/componentTypeService'; - -@Component({ - encapsulation: ViewEncapsulation.None, - imports: [CommonModule, FormsModule, MatFormFieldModule, MatSelectModule], - selector: 'select-component', - standalone: true, - styleUrls: ['./select-component.component.scss'], - templateUrl: './select-component.component.html' -}) -export class SelectComponentComponent { - @Input() components: any[]; - @Input() selectedComponent: ComponentContent; - @Output() componentChangedEvent: EventEmitter = new EventEmitter(); - - constructor(private componentTypeService: ComponentTypeService) {} - - protected selectComponent(component: ComponentContent): void { - this.selectedComponent = component; - this.componentChangedEvent.emit(component); - } - - protected getComponentTypeLabel(componentType: string): string { - return this.componentTypeService.getComponentTypeLabel(componentType); - } -} diff --git a/src/messages.xlf b/src/messages.xlf index 74c6b198b3c..2a2f66463d9 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -14255,14 +14255,7 @@ The branches will be removed but the steps will remain in the unit. Question: src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html - 28,31 - - - - of - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/select-component/select-component.component.html - 10,11 + 28,30 From 76bb8e24f09940d1bb074601b32b6b40d53bb6c1 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Wed, 14 May 2025 11:56:06 -0700 Subject: [PATCH 07/17] Add FilterComponentsComponent to let teacher choose only components that they want to see --- .../filter-components.component.html | 24 +++++ .../filter-components.component.spec.ts | 89 +++++++++++++++++++ .../filter-components.component.ts | 46 ++++++++++ .../node-grading/node-grading.component.html | 6 +- .../node-grading.component.spec.ts | 4 +- .../node-grading/node-grading.component.ts | 11 ++- src/messages.xlf | 27 +++++- 7 files changed, 203 insertions(+), 4 deletions(-) create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html new file mode 100644 index 00000000000..dabc17a1b06 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html @@ -0,0 +1,24 @@ +@if (components.length == 1) { + +} @else if (components.length > 1) { + + + {{ selectedText }} + + @for (component of components; track component.id; let i = $index) { + + {{ i + 1 }}: {{ getComponentTypeLabel(component.type) }} + + } + + + +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts new file mode 100644 index 00000000000..dc571cb0550 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts @@ -0,0 +1,89 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { FilterComponentsComponent } from './filter-components.component'; +import { MockProvider } from 'ng-mocks'; +import { ComponentTypeService } from '../../../../services/componentTypeService'; +import { ComponentContent } from '../../../../common/ComponentContent'; +import { HarnessLoader } from '@angular/cdk/testing'; +import { MatSelectHarness } from '@angular/material/select/testing'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; + +let component: FilterComponentsComponent; +let fixture: ComponentFixture; +let loader: HarnessLoader; +let select: MatSelectHarness; +describe('FilterComponentsComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [FilterComponentsComponent], + providers: [MockProvider(ComponentTypeService)] + }).compileComponents(); + + fixture = TestBed.createComponent(FilterComponentsComponent); + loader = TestbedHarnessEnvironment.loader(fixture); + component = fixture.componentInstance; + }); + onlyOneComponent(); + moreThanOneComponent(); +}); + +function onlyOneComponent() { + describe('when there is only 1 component', () => { + beforeEach(async () => { + component.components = [ + { + id: 'c1', + type: 'MultipleChoice' + } as ComponentContent + ]; + fixture.detectChanges(); + }); + it('should show button when there is only 1 component', () => { + const button = fixture.nativeElement.querySelector('button'); + expect(button).toBeTruthy(); + expect(button.innerText).toBe('1 assessment item'); + expect(button.disabled).toBe(true); + }); + }); +} + +function moreThanOneComponent() { + describe('when there is more than 1 component', () => { + beforeEach(async () => { + component.components = [ + { + id: 'c1', + type: 'MultipleChoice' + } as ComponentContent, + { + id: 'c2', + type: 'OpenResponse' + } as ComponentContent + ]; + component.ngOnChanges(); + fixture.detectChanges(); + select = await loader.getHarness(MatSelectHarness); + }); + it('should show options', async () => { + await select.open(); + const optionGroups = await select.getOptionGroups(); + expect(optionGroups.length).toBe(1); + expect(await optionGroups[0].getLabelText()).toBe('Assessment items to show'); + const options = await select.getOptions(); + expect(options.length).toBe(2); + expect(await options[0].isSelected()).toBe(true); + expect(await options[1].isSelected()).toBe(true); + }); + it('clicking on an option should emit selected components', async () => { + const spy = spyOn(component.componentsChange, 'emit').and.callThrough(); + await select.open(); + const options = await select.getOptions(); + await options[0].click(); + expect(spy).toHaveBeenCalledWith([ + { + id: 'c2', + type: 'OpenResponse' + } as ComponentContent + ]); + }); + }); +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts new file mode 100644 index 00000000000..6dcfb089225 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts @@ -0,0 +1,46 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatButtonModule } from '@angular/material/button'; +import { FormsModule } from '@angular/forms'; +import { ComponentTypeService } from '../../../../services/componentTypeService'; +import { ComponentContent } from '../../../../common/ComponentContent'; + +@Component({ + imports: [CommonModule, FormsModule, MatButtonModule, MatFormFieldModule, MatSelectModule], + selector: 'filter-components', + templateUrl: './filter-components.component.html' +}) +export class FilterComponentsComponent { + @Input() components: ComponentContent[]; + @Output() componentsChange: EventEmitter = new EventEmitter< + ComponentContent[] + >(); + protected selectedComponents: ComponentContent[]; + protected selectedText: string; + + constructor(private componentTypeService: ComponentTypeService) {} + + ngOnChanges(): void { + this.selectedComponents = this.components; + this.updateSelectedText(); + } + + private updateSelectedText(): void { + this.selectedText = $localize`Showing ${this.selectedComponents.length}/${this.components.length} items`; + } + + protected getComponentTypeLabel(componentType: string): string { + return this.componentTypeService.getComponentTypeLabel(componentType); + } + + protected compareById(component1: ComponentContent, component2: ComponentContent): boolean { + return component1?.id === component2?.id; + } + + protected updateSelectedComponents(): void { + this.updateSelectedText(); + this.componentsChange.emit(this.selectedComponents); + } +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html index b7297c46376..8a3802d34a3 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html @@ -26,8 +26,12 @@

Question: +
- @for (component of components; track component.id) { + @for (component of visibleComponents; track component.id) { } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts index dc2493e6eae..3a9c7d17585 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.spec.ts @@ -2,12 +2,13 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NodeGradingComponent } from './node-grading.component'; import { TeacherProjectService } from '../../../../services/teacherProjectService'; import { TeacherDataService } from '../../../../services/teacherDataService'; -import { MockProviders } from 'ng-mocks'; +import { MockComponent, MockProviders } from 'ng-mocks'; import { ClassroomStatusService } from '../../../../services/classroomStatusService'; import { Node } from '../../../../common/Node'; import { Observable, Subject } from 'rxjs'; import { ClassroomMonitorTestingModule } from '../../../classroom-monitor-testing.module'; import { WorkgroupService } from '../../../../../../app/services/workgroup.service'; +import { FilterComponentsComponent } from '../filter-components/filter-components.component'; let classroomStatusService: ClassroomStatusService; let component: NodeGradingComponent; @@ -38,6 +39,7 @@ class MockDataService { describe('NodeGradingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ + declarations: [MockComponent(FilterComponentsComponent)], imports: [NodeGradingComponent, ClassroomMonitorTestingModule], providers: [ MockProviders(ClassroomStatusService, TeacherProjectService, WorkgroupService), diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts index 8bd2637ba8e..965fbaeab11 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts @@ -11,11 +11,14 @@ import { Node } from '../../../../common/Node'; import { Subscription } from 'rxjs'; import { ComponentGradingViewComponent } from '../../component-grading-view/component-grading-view.component'; import { MatButtonModule } from '@angular/material/button'; +import { FilterComponentsComponent } from '../filter-components/filter-components.component'; +import { ComponentContent } from '../../../../common/ComponentContent'; @Component({ imports: [ CommonModule, ComponentGradingViewComponent, + FilterComponentsComponent, FlexLayoutModule, MatButtonModule, MatIconModule @@ -38,7 +41,7 @@ import { MatButtonModule } from '@angular/material/button'; templateUrl: './node-grading.component.html' }) export class NodeGradingComponent { - protected components: any[]; + protected components: ComponentContent[]; protected hasWork: boolean; protected node: Node; protected nodeAverageScore: number; @@ -48,6 +51,7 @@ export class NodeGradingComponent { protected numRubrics: number; private periodId: number; private subscriptions: Subscription = new Subscription(); + protected visibleComponents: ComponentContent[]; constructor( private classroomStatusService: ClassroomStatusService, @@ -86,6 +90,7 @@ export class NodeGradingComponent { this.components = this.projectService .getComponents(this.nodeId) .filter((component) => this.projectService.componentHasWork(component)); + this.visibleComponents = this.components; this.numRubrics = this.node.getNumRubrics(); this.setPeriod(); } @@ -110,6 +115,10 @@ export class NodeGradingComponent { ).completionPct; } + protected setVisibleComponents(visibleComponents: ComponentContent[]): void { + this.visibleComponents = visibleComponents; + } + protected showRubric(): void { this.dialog.open(ShowNodeInfoDialogComponent, { data: this.nodeId, diff --git a/src/messages.xlf b/src/messages.xlf index 2a2f66463d9..72f67ed6231 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -14230,6 +14230,31 @@ The branches will be removed but the steps will remain in the unit. 92,93 + + Assessment items to show + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html + 2,5 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html + 15,16 + + + + 1 assessment item + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html + 3,6 + + + + Showing / items + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts + 31 + + Step Completion @@ -14255,7 +14280,7 @@ The branches will be removed but the steps will remain in the unit. Question: src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html - 28,30 + 28,31 From b8dfa212b8a1343295cdf5f86a7c0d41a23f2238 Mon Sep 17 00:00:00 2001 From: Jonathan Lim-Breitbart Date: Mon, 19 May 2025 09:17:50 -0700 Subject: [PATCH 08/17] feat(Unit Info): Hide standard names and show in tooltip (#2182) --- .../library-project-details.component.html | 8 +++- src/messages.xlf | 40 +++++++++---------- src/style/base/_base.scss | 4 -- src/style/styles.scss | 4 ++ 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.html b/src/app/modules/library/library-project-details/library-project-details.component.html index fc19f42cb8b..88d40e74cdb 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.html +++ b/src/app/modules/library/library-project-details/library-project-details.component.html @@ -3,8 +3,12 @@
{{ standardsName }}: @for (standard of standards; track standard.id; let last = $last) { - {{ standard.id }} {{ standard.name }}{{ standard.id }}{{ last ? '' : ' • ' }} }
diff --git a/src/messages.xlf b/src/messages.xlf index f7831fea888..9a3af762e7a 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -283,7 +283,7 @@ src/app/modules/library/library-project-details/library-project-details.component.html - 204,208 + 208,212 src/app/modules/library/public-unit-type-selector/community-library-details.html @@ -5902,28 +5902,28 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Grade level: src/app/modules/library/library-project-details/library-project-details.component.html - 24,27 + 28,31
Duration: src/app/modules/library/library-project-details/library-project-details.component.html - 38,39 + 42,43 Unit ID: src/app/modules/library/library-project-details/library-project-details.component.html - 43,44 + 47,48 This unit is from an old version of WISE that is no longer supported. Please find an alternate unit to use in the future or contact us for upgrade options. src/app/modules/library/library-project-details/library-project-details.component.html - 64,67 + 68,71 src/app/teacher/teacher-run-list-item/teacher-run-list-item.component.html @@ -5934,7 +5934,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Legacy Unit src/app/modules/library/library-project-details/library-project-details.component.html - 67,71 + 71,75 src/app/modules/library/library-project/library-project.component.html @@ -5945,84 +5945,84 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. Note: This unit was created outside of the WISE platform. Teaching resources are linked below. src/app/modules/library/library-project-details/library-project-details.component.html - 73,77 + 77,81 Resources: src/app/modules/library/library-project-details/library-project-details.component.html - 79,81 + 83,85 Discipline: src/app/modules/library/library-project-details/library-project-details.component.html - 92,94 + 96,98 Features: src/app/modules/library/library-project-details/library-project-details.component.html - 104,105 + 108,109 Standards Addressed: src/app/modules/library/library-project-details/library-project-details.component.html - 117,119 + 121,123 This unit is a copy of (used under CC BY-SA). src/app/modules/library/library-project-details/library-project-details.component.html - 160,162 + 164,166 This unit is a copy of by (used under CC BY-SA). src/app/modules/library/library-project-details/library-project-details.component.html - 166,169 + 170,173 This unit is licensed under CC BY-SA. src/app/modules/library/library-project-details/library-project-details.component.html - 177,179 + 181,183 This unit is licensed under CC BY-SA by . src/app/modules/library/library-project-details/library-project-details.component.html - 182,184 + 186,188 View License src/app/modules/library/library-project-details/library-project-details.component.html - 189,193 + 193,197 More src/app/modules/library/library-project-details/library-project-details.component.html - 197,203 + 201,207 Use with Class src/app/modules/library/library-project-details/library-project-details.component.html - 213,218 + 217,222 src/app/teacher/create-run-dialog/create-run-dialog.component.html @@ -6033,7 +6033,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Preview src/app/modules/library/library-project-details/library-project-details.component.html - 221,223 + 225,227 src/app/teacher/run-menu/run-menu.component.html @@ -6068,7 +6068,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Unit Resources src/app/modules/library/library-project-details/library-project-details.component.html - 223,228 + 227,232 diff --git a/src/style/base/_base.scss b/src/style/base/_base.scss index 92f41061a43..bdaf9d4d2e0 100644 --- a/src/style/base/_base.scss +++ b/src/style/base/_base.scss @@ -6,10 +6,6 @@ strong, b, .strong { font-weight: 500; } -a { - text-decoration: underline; -} - figure { &.image { display: inline-block; diff --git a/src/style/styles.scss b/src/style/styles.scss index ab41980cc10..d3444be1cdd 100644 --- a/src/style/styles.scss +++ b/src/style/styles.scss @@ -46,6 +46,10 @@ @tailwind components; @tailwind utilities; +a { + text-decoration: underline; +} + .app-styles { @include apps.apps-setup(); } From 66f3c79d9a12638ae7bd1bfba156dc2ea3300c29 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Wed, 21 May 2025 09:21:18 -0700 Subject: [PATCH 09/17] feat(Match): Filter out detected ideas from pre-authored choices #2184 (#2185) Co-authored-by: Jonathan Lim-Breitbart --- .../match-student-default.component.ts | 17 ++++++++++++----- src/messages.xlf | 8 ++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts b/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts index 02daaf0aac8..b4b072f3999 100644 --- a/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts +++ b/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts @@ -38,6 +38,7 @@ import { NotebookService } from '../../../../services/notebookService'; import { ProjectService } from '../../../../services/projectService'; import { StudentAssetService } from '../../../../services/studentAssetService'; import { StudentDataService } from '../../../../services/studentDataService'; +import { CRaterIdea } from '../../../common/cRater/CRaterIdea'; @Component({ imports: [ @@ -613,11 +614,17 @@ export class MatchStudentDefaultComponent extends ComponentStudent { } private addIdeasToSourceBucket(responses: any[], rubric: CRaterRubric): void { - getUniqueIdeas(responses, rubric).forEach((idea) => { - const choice = new Choice(idea.name, idea.text); - this.choices.push(choice); - this.getBucketById(this.sourceBucketId).items.push(choice); - }); + getUniqueIdeas(responses, rubric) + .filter((idea) => !this.isInSourceBucket(idea)) + .forEach((idea) => { + const choice = new Choice(idea.name, idea.text); + this.choices.push(choice); + this.getBucketById(this.sourceBucketId).items.push(choice); + }); + } + + private isInSourceBucket(idea: CRaterIdea): boolean { + return this.sourceBucket.items.some((item) => item.value === idea.text); } protected addChoice(): void { diff --git a/src/messages.xlf b/src/messages.xlf index 9a3af762e7a..25381e04756 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -10945,7 +10945,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 125 + 126 src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.html @@ -19584,7 +19584,7 @@ Warning: This will delete all existing choices and buckets in this component. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 470 + 471 src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html @@ -19615,7 +19615,7 @@ Warning: This will delete all existing choices and buckets in this component. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 470 + 471 src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html @@ -19680,7 +19680,7 @@ Warning: This will delete all existing choices and buckets in this component.Correct bucket but wrong position src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 463 + 464 From 6cd54089bdd24e0e49293e1cd8a05cd50db69bc2 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Wed, 21 May 2025 14:46:11 -0700 Subject: [PATCH 10/17] chore(AuthoringToolComponent): Convert to standalone (#2186) --- src/app/teacher/authoring-tool.module.ts | 10 +------ .../authoring-tool.component.html | 4 +-- .../authoringTool/authoring-tool.component.ts | 29 ++++++++++++++---- src/messages.xlf | 30 +++++++++---------- 4 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/app/teacher/authoring-tool.module.ts b/src/app/teacher/authoring-tool.module.ts index 32f1f2ba86f..586c98ddc2b 100644 --- a/src/app/teacher/authoring-tool.module.ts +++ b/src/app/teacher/authoring-tool.module.ts @@ -21,7 +21,6 @@ import { WiseTinymceEditorModule } from '../../assets/wise5/directives/wise-tiny import { NotebookAuthoringComponent } from '../../assets/wise5/authoringTool/notebook-authoring/notebook-authoring.component'; import { StructureAuthoringModule } from '../../assets/wise5/authoringTool/structure/structure-authoring.module'; import { MilestonesAuthoringComponent } from '../../assets/wise5/authoringTool/milestones-authoring/milestones-authoring.component'; -import { TopBarComponent } from '../../assets/wise5/authoringTool/components/top-bar/top-bar.component'; import { ProjectAssetAuthoringModule } from '../../assets/wise5/authoringTool/project-asset-authoring/project-asset-authoring.module'; import { ChooseSimulationComponent } from '../../assets/wise5/authoringTool/addNode/choose-simulation/choose-simulation.component'; import { ProjectInfoAuthoringComponent } from '../../assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component'; @@ -30,7 +29,6 @@ import { ConfigureAutomatedAssessmentComponent } from '../../assets/wise5/author import { ProjectListComponent } from '../../assets/wise5/authoringTool/project-list/project-list.component'; import { AddProjectComponent } from '../../assets/wise5/authoringTool/add-project/add-project.component'; import { MatBadgeModule } from '@angular/material/badge'; -import { AuthoringToolBarComponent } from '../../assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component'; import { ProjectAuthoringComponent } from '../../assets/wise5/authoringTool/project-authoring/project-authoring.component'; import { AuthoringToolComponent } from '../../assets/wise5/authoringTool/authoring-tool.component'; import { ChooseMoveNodeLocationComponent } from '../../assets/wise5/authoringTool/choose-node-location/choose-move-node-location/choose-move-node-location.component'; @@ -58,8 +56,6 @@ import { EditBranchComponent } from '../../assets/wise5/authoringTool/edit-branc import { ComponentTypeButtonComponent } from '../../assets/wise5/authoringTool/components/component-type-button/component-type-button.component'; import { MatExpansionModule } from '@angular/material/expansion'; import { AddComponentComponent } from '../../assets/wise5/authoringTool/node/add-component/add-component.component'; -import { SideMenuComponent } from '../../assets/wise5/common/side-menu/side-menu.component'; -import { MainMenuComponent } from '../../assets/wise5/common/main-menu/main-menu.component'; import { ChooseImportComponentComponent } from '../../assets/wise5/authoringTool/importComponent/choose-import-component/choose-import-component.component'; import { EditUnitResourcesComponent } from '../../assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component'; import { EditUnitTypeComponent } from '../../assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component'; @@ -67,7 +63,6 @@ import { EditUnitTypeComponent } from '../../assets/wise5/authoringTool/edit-uni @NgModule({ declarations: [ AdvancedProjectAuthoringComponent, - AuthoringToolComponent, ChooseMoveNodeLocationComponent, ConcurrentAuthorsMessageComponent, ConfigureAutomatedAssessmentComponent, @@ -92,7 +87,7 @@ import { EditUnitTypeComponent } from '../../assets/wise5/authoringTool/edit-uni AddProjectComponent, AddStepButtonComponent, AddYourOwnNodeComponent, - AuthoringToolBarComponent, + AuthoringToolComponent, ChooseAutomatedAssessmentComponent, ChooseCopyNodeLocationComponent, ChooseImportComponentComponent, @@ -115,7 +110,6 @@ import { EditUnitTypeComponent } from '../../assets/wise5/authoringTool/edit-uni MatExpansionModule, InsertNodeAfterButtonComponent, InsertNodeInsideButtonComponent, - MainMenuComponent, NgSelectModule, NodeAdvancedAuthoringModule, NodeIconAndTitleComponent, @@ -123,11 +117,9 @@ import { EditUnitTypeComponent } from '../../assets/wise5/authoringTool/edit-uni ProjectAssetAuthoringModule, ProjectListComponent, RouterModule, - SideMenuComponent, StructureAuthoringModule, StudentTeacherCommonModule, TeacherNodeIconComponent, - TopBarComponent, TranslatableInputComponent, TranslatableRichTextEditorComponent, TranslatableTextareaComponent, diff --git a/src/assets/wise5/authoringTool/authoring-tool.component.html b/src/assets/wise5/authoringTool/authoring-tool.component.html index d2b8157ba43..dc7a20e0f02 100644 --- a/src/assets/wise5/authoringTool/authoring-tool.component.html +++ b/src/assets/wise5/authoringTool/authoring-tool.component.html @@ -3,7 +3,7 @@
- + - + @if (showToolbar) { diff --git a/src/assets/wise5/authoringTool/authoring-tool.component.ts b/src/assets/wise5/authoringTool/authoring-tool.component.ts index 01105cedbb3..f1d5347d8d1 100644 --- a/src/assets/wise5/authoringTool/authoring-tool.component.ts +++ b/src/assets/wise5/authoringTool/authoring-tool.component.ts @@ -5,14 +5,32 @@ import { NotificationService } from '../services/notificationService'; import { TeacherProjectService } from '../services/teacherProjectService'; import { SessionService } from '../services/sessionService'; import { TeacherDataService } from '../services/teacherDataService'; -import { NavigationEnd, Router } from '@angular/router'; +import { NavigationEnd, Router, RouterModule } from '@angular/router'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { DialogWithConfirmComponent } from '../directives/dialog-with-confirm/dialog-with-confirm.component'; +import { CommonModule } from '@angular/common'; +import { AuthoringToolBarComponent } from './components/shared/authoring-tool-bar/authoring-tool-bar.component'; +import { MainMenuComponent } from '../common/main-menu/main-menu.component'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { TopBarComponent } from './components/top-bar/top-bar.component'; +import { SideMenuComponent } from '../common/side-menu/side-menu.component'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { ScrollingModule } from '@angular/cdk/scrolling'; @Component({ - styleUrls: ['./authoring-tool.component.scss'], - templateUrl: './authoring-tool.component.html', - standalone: false + imports: [ + AuthoringToolBarComponent, + CommonModule, + FlexLayoutModule, + MainMenuComponent, + MatSidenavModule, + RouterModule, + ScrollingModule, + SideMenuComponent, + TopBarComponent + ], + styleUrl: './authoring-tool.component.scss', + templateUrl: './authoring-tool.component.html' }) export class AuthoringToolComponent { protected isMenuOpen: boolean = false; @@ -233,7 +251,8 @@ export class AuthoringToolComponent { } private getElements(): any[] { - const elementsToDisable = 'button,input,textarea,mat-radio-button,mat-checkbox,mat-icon[cdkdraghandle]'; + const elementsToDisable = + 'button,input,textarea,mat-radio-button,mat-checkbox,mat-icon[cdkdraghandle]'; return Array.from( this.elem.nativeElement.querySelectorAll(`div.main-content ${elementsToDisable}`) ).concat( diff --git a/src/messages.xlf b/src/messages.xlf index 25381e04756..19ef8197188 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -821,7 +821,7 @@ src/assets/wise5/authoringTool/authoring-tool.component.ts - 96 + 114 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -2358,7 +2358,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/authoring-tool.component.ts - 25 + 43 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -9031,7 +9031,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/authoring-tool.component.ts - 68 + 86 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -10254,14 +10254,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Unit Home src/assets/wise5/authoringTool/authoring-tool.component.ts - 61 + 79 File Manager src/assets/wise5/authoringTool/authoring-tool.component.ts - 75 + 93 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -10272,7 +10272,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Notebook Settings src/assets/wise5/authoringTool/authoring-tool.component.ts - 82 + 100 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -10287,7 +10287,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Milestones src/assets/wise5/authoringTool/authoring-tool.component.ts - 89 + 107 src/assets/wise5/authoringTool/components/shared/authoring-tool-bar/authoring-tool-bar.component.ts @@ -10306,14 +10306,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Unit List src/assets/wise5/authoringTool/authoring-tool.component.ts - 103 + 121 You have been inactive for a long time. Do you want to stay logged in? src/assets/wise5/authoringTool/authoring-tool.component.ts - 117 + 135 src/assets/wise5/classroomMonitor/classroom-monitor.component.ts @@ -10328,7 +10328,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Session Timeout src/assets/wise5/authoringTool/authoring-tool.component.ts - 118 + 136 src/assets/wise5/classroomMonitor/classroom-monitor.component.ts @@ -10343,7 +10343,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Saving... src/assets/wise5/authoringTool/authoring-tool.component.ts - 142 + 160 src/assets/wise5/services/notificationService.ts @@ -10354,25 +10354,25 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Saved src/assets/wise5/authoringTool/authoring-tool.component.ts - 156 + 174 Error Saving Unit. Please refresh the page. src/assets/wise5/authoringTool/authoring-tool.component.ts - 163 + 181 You do not have permission to edit this unit. src/assets/wise5/authoringTool/authoring-tool.component.ts - 170 + 188 src/assets/wise5/authoringTool/authoring-tool.component.ts - 252 + 271 From 39439e8f0a8f8bf066b9c7321c72d85d6199621f Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 22 May 2025 09:13:06 -0700 Subject: [PATCH 11/17] Move summary display to top of page --- .../component-grading-view.component.html | 1 - .../component-grading-view.component.ts | 2 -- .../nodeGrading/node-grading/node-grading.component.html | 5 ++++- .../nodeGrading/node-grading/node-grading.component.ts | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.html index 5602d6be298..9660500f5a1 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.html @@ -33,4 +33,3 @@ }
- diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.ts index 4671091ae29..1f0de804660 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.ts @@ -7,7 +7,6 @@ import { TeacherDataService } from '../../../services/teacherDataService'; import { isMatchingPeriods } from '../../../common/period/period'; import { AnnotationService } from '../../../services/annotationService'; import { Node } from '../../../common/Node'; -import { ComponentClassResponsesComponent } from '../component-class-responses/component-class-responses.component'; import { MilestoneReportButtonComponent } from '../milestone-report-button/milestone-report-button.component'; import { PeerGroupButtonComponent } from '../peer-group-button/peer-group-button.component'; import { ComponentCompletionComponent } from '../component-completion/component-completion.component'; @@ -17,7 +16,6 @@ import { ComponentContent } from '../../../common/ComponentContent'; @Component({ imports: [ ComponentAverageScoreComponent, - ComponentClassResponsesComponent, ComponentCompletionComponent, MilestoneReportButtonComponent, PeerGroupButtonComponent, diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html index 8a3802d34a3..f5eb97f7b11 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html @@ -24,6 +24,9 @@

+ @for (component of components; track component.id) { + + }
Question: />
@for (component of visibleComponents; track component.id) { - + } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts index 965fbaeab11..4e76aa1a10c 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts @@ -13,10 +13,12 @@ import { ComponentGradingViewComponent } from '../../component-grading-view/comp import { MatButtonModule } from '@angular/material/button'; import { FilterComponentsComponent } from '../filter-components/filter-components.component'; import { ComponentContent } from '../../../../common/ComponentContent'; +import { ComponentClassResponsesComponent } from '../../component-class-responses/component-class-responses.component'; @Component({ imports: [ CommonModule, + ComponentClassResponsesComponent, ComponentGradingViewComponent, FilterComponentsComponent, FlexLayoutModule, From b45abd92e08863ae2c451685bb2edbbf8633abf3 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Fri, 23 May 2025 17:26:15 -0700 Subject: [PATCH 12/17] Add NodeClassResponses to show all the workgroup's work for the node and select component. --- .../node-class-responses.component.html | 98 +++++++++++ .../node-class-responses.component.scss | 12 ++ .../node-class-responses.component.spec.ts | 45 +++++ .../node-class-responses.component.ts | 127 ++++++++++++++ .../node-grading/node-grading.component.html | 7 +- .../node-grading/node-grading.component.ts | 8 +- .../node-workgroup-item.component.html | 66 +++++++ .../node-workgroup-item.component.scss | 24 +++ .../node-workgroup-item.component.spec.ts | 37 ++++ .../node-workgroup-item.component.ts | 163 ++++++++++++++++++ .../wise5/services/annotationService.ts | 13 ++ 11 files changed, 589 insertions(+), 11 deletions(-) create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.scss create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.ts create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.html create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.scss create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html new file mode 100644 index 00000000000..ab80d92c8a4 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html @@ -0,0 +1,98 @@ + + +
+ + + + +
+
+ +
+ + + +
+
+
+ @for (workgroup of sortedWorkgroups; track workgroup.workgroupId) { + @if (isWorkgroupShown(workgroup)) { + + } + } +
+
diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.scss b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.scss new file mode 100644 index 00000000000..5f34e4a1459 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.scss @@ -0,0 +1,12 @@ +.user-list { + padding-top: 0; +} + +.table--list__thead__link { + padding: 0; +} + +.mdc-list-item.user-list-controls { + height: auto; + padding: 8px 16px; +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts new file mode 100644 index 00000000000..87959dd21b9 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts @@ -0,0 +1,45 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { NodeClassResponsesComponent } from './node-class-responses.component'; +import { AnnotationService } from '../../../../services/annotationService'; +import { MockComponent, MockProvider, MockProviders } from 'ng-mocks'; +import { ClassroomStatusService } from '../../../../services/classroomStatusService'; +import { ComponentServiceLookupService } from '../../../../services/componentServiceLookupService'; +import { ConfigService } from '../../../../services/configService'; +import { TeacherDataService } from '../../../../services/teacherDataService'; +import { NotificationService } from '../../../../services/notificationService'; +import { TeacherProjectService } from '../../../../services/teacherProjectService'; +import { of } from 'rxjs'; +import { WorkgroupSelectAutocompleteComponent } from '../../../../../../app/classroom-monitor/workgroup-select/workgroup-select-autocomplete/workgroup-select-autocomplete.component'; + +describe('NodeClassResponsesComponent', () => { + let component: NodeClassResponsesComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [MockComponent(WorkgroupSelectAutocompleteComponent)], + imports: [NodeClassResponsesComponent], + providers: [ + MockProviders( + AnnotationService, + ClassroomStatusService, + ComponentServiceLookupService, + ConfigService, + TeacherDataService, + NotificationService + ), + MockProvider(TeacherProjectService, { + projectSaved$: of() + }) + ] + }).compileComponents(); + + fixture = TestBed.createComponent(NodeClassResponsesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.ts new file mode 100644 index 00000000000..90be65a0e18 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.ts @@ -0,0 +1,127 @@ +import { Component, Input } from '@angular/core'; +import { MatListModule } from '@angular/material/list'; +import { WorkgroupSelectAutocompleteComponent } from '../../../../../../app/classroom-monitor/workgroup-select/workgroup-select-autocomplete/workgroup-select-autocomplete.component'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { IntersectionObserverModule } from '@ng-web-apis/intersection-observer'; +import { CommonModule } from '@angular/common'; +import { AbstractClassResponsesComponent } from '../../AbstractClassResponsesComponent'; +import { Node } from '../../../../common/Node'; +import { ComponentContent } from '../../../../common/ComponentContent'; +import { NodeWorkgroupItemComponent } from '../node-workgroup-item/node-workgroup-item.component'; +import { AnnotationService } from '../../../../services/annotationService'; +import { ClassroomStatusService } from '../../../../services/classroomStatusService'; +import { ComponentServiceLookupService } from '../../../../services/componentServiceLookupService'; +import { ConfigService } from '../../../../services/configService'; +import { TeacherDataService } from '../../../../services/teacherDataService'; +import { NotificationService } from '../../../../services/notificationService'; +import { TeacherProjectService } from '../../../../services/teacherProjectService'; +import { Subscription } from 'rxjs'; + +@Component({ + imports: [ + CommonModule, + IntersectionObserverModule, + MatButtonModule, + MatIconModule, + MatListModule, + NodeWorkgroupItemComponent, + WorkgroupSelectAutocompleteComponent + ], + selector: 'node-class-responses', + styleUrl: './node-class-responses.component.scss', + templateUrl: './node-class-responses.component.html' +}) +export class NodeClassResponsesComponent extends AbstractClassResponsesComponent { + @Input() components: ComponentContent[]; + protected maxScore: number; + @Input() node: Node; + private subscriptions: Subscription = new Subscription(); + + constructor( + protected annotationService: AnnotationService, + protected classroomStatusService: ClassroomStatusService, + private componentServiceLookupService: ComponentServiceLookupService, + protected configService: ConfigService, + protected dataService: TeacherDataService, + protected notificationService: NotificationService, + protected projectService: TeacherProjectService + ) { + super( + annotationService, + classroomStatusService, + configService, + dataService, + notificationService, + projectService + ); + } + + ngOnInit(): void { + this.subscriptions.add(this.projectService.projectSaved$.subscribe(() => this.setMaxScore())); + } + + ngOnChanges(): void { + if (this.node && this.components) { + this.retrieveStudentData(this.node); + this.setMaxScore(); + } + } + + ngOnDestroy(): void { + this.subscriptions.unsubscribe(); + } + + private setMaxScore(): void { + this.maxScore = this.components + .map( + (component) => this.projectService.getMaxScoreForComponent(this.node.id, component.id) ?? 0 + ) + .reduce((accumulator, currentValue) => accumulator + currentValue, 0); + } + + protected setWorkgroupsById(): void { + this.workgroups.forEach((workgroup) => { + this.workgroupsById[workgroup.workgroupId] = workgroup; + this.updateWorkgroup(workgroup); + }); + } + + protected getWorkgroupScore(workgroupId: number): number { + return this.annotationService.getTotalNodeScore(workgroupId, this.node, this.components); + } + + protected hasWork(): boolean { + return this.projectService.nodeHasWork(this.node.id); + } + + protected isCompleted(workgroupId: number, nodeStatus: any): boolean { + return this.components.every((component) => this.isComponentCompleted(workgroupId, component)); + } + + private isComponentCompleted(workgroupId: number, component: ComponentContent): boolean { + const service = this.componentServiceLookupService.getService(component.type); + const workgroupComponentStates = this.dataService.getComponentStatesByWorkgroupIdAndComponentId( + workgroupId, + component.id + ); + return ['OpenResponse', 'Discussion'].includes(component.type) + ? service.isCompletedV2(this.node, component, { + componentStates: workgroupComponentStates + }) + : service.isCompleted( + component, + workgroupComponentStates, + this.dataService.getEventsByNodeId(this.node.id), + this.node + ); + } + + protected getComponentStates(): any[] { + return this.dataService + .getComponentStatesByNodeId(this.node.id) + .filter((componentState) => + this.components.some((component) => component.id === componentState.componentId) + ); + } +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html index f5eb97f7b11..3d28705aadd 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html @@ -24,9 +24,6 @@

- @for (component of components; track component.id) { - - }
Question: (componentsChange)="setVisibleComponents($event)" />
- @for (component of visibleComponents; track component.id) { - - } + diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts index 4e76aa1a10c..59249c2bc55 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.ts @@ -9,21 +9,19 @@ import { MatDialog } from '@angular/material/dialog'; import { ShowNodeInfoDialogComponent } from '../../../../../../app/classroom-monitor/show-node-info-dialog/show-node-info-dialog.component'; import { Node } from '../../../../common/Node'; import { Subscription } from 'rxjs'; -import { ComponentGradingViewComponent } from '../../component-grading-view/component-grading-view.component'; import { MatButtonModule } from '@angular/material/button'; import { FilterComponentsComponent } from '../filter-components/filter-components.component'; import { ComponentContent } from '../../../../common/ComponentContent'; -import { ComponentClassResponsesComponent } from '../../component-class-responses/component-class-responses.component'; +import { NodeClassResponsesComponent } from '../node-class-responses/node-class-responses.component'; @Component({ imports: [ CommonModule, - ComponentClassResponsesComponent, - ComponentGradingViewComponent, FilterComponentsComponent, FlexLayoutModule, MatButtonModule, - MatIconModule + MatIconModule, + NodeClassResponsesComponent ], styles: [ ` diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.html new file mode 100644 index 00000000000..29810d3cf82 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.html @@ -0,0 +1,66 @@ +
+ + @if (expanded && !disabled) { + +
+ @for (component of components; track component.id; let i = $index) { + @if (componentIdToIsVisible[component.id]) { +
+
+

+ {{ i + 1 + '. ' + getComponentTypeLabel(component.type) }}  + +

+ +
+
+ } + } +
+
+ } +
diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.scss b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.scss new file mode 100644 index 00000000000..57e36e9976f --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.scss @@ -0,0 +1,24 @@ +.grading__item-container { + height: auto; +} + +.node-workgroup-item { + .team-button { + min-height: 56px; + text-transform: none; + text-align: initial; + } + + .mdc-button__label { + text-transform: none; + width: 100%; + } + + .mdc-list-item.mdc-list-item--with-one-line { + height: auto; + } + + .mat-headline-5 { + margin: 0; + } +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts new file mode 100644 index 00000000000..8001e28b6ab --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts @@ -0,0 +1,37 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { NodeWorkgroupItemComponent } from './node-workgroup-item.component'; +import { MockProvider, MockProviders } from 'ng-mocks'; +import { AnnotationService } from '../../../../services/annotationService'; +import { ComponentTypeService } from '../../../../services/componentTypeService'; +import { TeacherProjectService } from '../../../../services/teacherProjectService'; +import { Node } from '../../../../common/Node'; +import { Annotation } from '../../../../common/Annotation'; +import { of } from 'rxjs'; + +describe('NodeWorkgroupItemComponent', () => { + let component: NodeWorkgroupItemComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NodeWorkgroupItemComponent], + providers: [ + MockProvider(AnnotationService, { + annotationReceived$: of({} as Annotation) + }), + MockProviders(ComponentTypeService, TeacherProjectService) + ] + }).compileComponents(); + + fixture = TestBed.createComponent(NodeWorkgroupItemComponent); + component = fixture.componentInstance; + component.node = { id: 'node1' } as Node; + component.components = []; + component.workgroup = { workgroupId: 1, nodeStatus: { componentStatus: {} } }; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts new file mode 100644 index 00000000000..18cd7164287 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts @@ -0,0 +1,163 @@ +import { + Component, + EventEmitter, + Input, + Output, + SimpleChanges, + ViewEncapsulation +} from '@angular/core'; +import { calculateComponentVisibility } from '../../shared/grading-helpers/grading-helpers'; +import { ComponentTypeService } from '../../../../services/componentTypeService'; +import { TeacherProjectService } from '../../../../services/teacherProjectService'; +import { WorkgroupComponentGradingComponent } from '../../workgroup-component-grading/workgroup-component-grading.component'; +import { ComponentNewWorkBadgeComponent } from '../../../../../../app/classroom-monitor/component-new-work-badge/component-new-work-badge.component'; +import { WorkgroupNodeScoreComponent } from '../../shared/workgroupNodeScore/workgroup-node-score.component'; +import { WorkgroupNodeStatusComponent } from '../../../../../../app/classroom-monitor/workgroup-node-status/workgroup-node-status.component'; +import { WorkgroupInfoComponent } from '../workgroupInfo/workgroup-info.component'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatListModule } from '@angular/material/list'; +import { MatButtonModule } from '@angular/material/button'; +import { CommonModule } from '@angular/common'; +import { Node } from '../../../../common/Node'; +import { ComponentContent } from '../../../../common/ComponentContent'; +import { filter, Subscription } from 'rxjs'; +import { AnnotationService } from '../../../../services/annotationService'; + +@Component({ + encapsulation: ViewEncapsulation.None, + imports: [ + CommonModule, + MatButtonModule, + MatListModule, + FlexLayoutModule, + WorkgroupInfoComponent, + WorkgroupNodeStatusComponent, + WorkgroupNodeScoreComponent, + ComponentNewWorkBadgeComponent, + WorkgroupComponentGradingComponent + ], + selector: 'node-workgroup-item', + templateUrl: './node-workgroup-item.component.html', + styleUrl: './node-workgroup-item.component.scss' +}) +export class NodeWorkgroupItemComponent { + private componentIdToHasWork: { [componentId: string]: boolean } = {}; + protected componentIdToIsVisible: { [componentId: string]: boolean } = {}; + @Input() components: ComponentContent[] = []; + protected disabled: boolean; + @Input() expanded: boolean; + protected hasAlert: boolean; + protected hasNewAlert: boolean; + @Input() maxScore: number; + private nodeHasWork: boolean; + @Input() node: Node; + @Output() onUpdateExpand: EventEmitter = new EventEmitter(); + protected score: any; + private status: any; + protected statusClass: string; + protected statusText: string = ''; + private subscriptions: Subscription = new Subscription(); + @Input() workgroup: any; + + constructor( + private annotationService: AnnotationService, + private componentTypeService: ComponentTypeService, + private projectService: TeacherProjectService + ) {} + + ngOnInit(): void { + this.updateNode(); + this.updateStatus(); + this.subscribeToAnnotations(); + } + + private subscribeToAnnotations(): void { + this.subscriptions.add( + this.annotationService.annotationReceived$ + .pipe( + filter( + (annotation) => + annotation.nodeId === this.node.id && + annotation.toWorkgroupId === this.workgroup.workgroupId + ) + ) + .subscribe( + () => + (this.score = this.annotationService.getTotalNodeScore( + this.workgroup.workgroupId, + this.node, + this.components + )) + ) + ); + } + + private updateNode(): void { + this.nodeHasWork = this.projectService.nodeHasWork(this.node.id); + this.componentIdToHasWork = this.projectService.calculateComponentIdToHasWork(this.components); + this.componentIdToIsVisible = calculateComponentVisibility( + this.componentIdToHasWork, + this.workgroup.nodeStatus.componentStatuses + ); + } + + ngOnChanges(changes: SimpleChanges): void { + if (changes.workgroup) { + const workgroup = changes.workgroup.currentValue; + this.hasAlert = workgroup.hasAlert; + this.hasNewAlert = workgroup.hasNewAlert; + this.status = workgroup.completionStatus; + this.score = workgroup.score != null ? workgroup.score : '-'; + this.workgroup = workgroup; + this.updateNode(); + this.updateStatus(); + } + if (changes.nodeId) { + this.updateNode(); + } + } + + ngOnDestroy(): void { + this.subscriptions.unsubscribe(); + } + + protected getComponentTypeLabel(componentType): string { + return this.componentTypeService.getComponentTypeLabel(componentType); + } + + private updateStatus(): void { + switch (this.status) { + case -1: + this.statusClass = ' '; + this.statusText = $localize`Not Assigned`; + break; + case 2: + this.statusClass = 'success'; + if (this.nodeHasWork) { + this.statusText = $localize`Completed`; + } else { + this.statusText = $localize`Visited`; + } + break; + case 1: + this.statusClass = 'text'; + this.statusText = $localize`Partially Completed`; + break; + default: + this.statusClass = 'text-secondary'; + if (this.nodeHasWork) { + this.statusText = $localize`No Work`; + } else { + this.statusText = $localize`Not Visited`; + } + } + if (this.hasNewAlert) { + this.statusClass = 'warn'; + } + this.disabled = this.status === -1; + } + + protected toggleExpand(): void { + this.onUpdateExpand.emit({ workgroupId: this.workgroup.workgroupId, value: !this.expanded }); + } +} diff --git a/src/assets/wise5/services/annotationService.ts b/src/assets/wise5/services/annotationService.ts index 8f9998c0e34..aa9b3fe024f 100644 --- a/src/assets/wise5/services/annotationService.ts +++ b/src/assets/wise5/services/annotationService.ts @@ -5,6 +5,8 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable, Subject } from 'rxjs'; import { generateRandomKey } from '../common/string/string'; import { Annotation } from '../common/Annotation'; +import { Node } from '../common/Node'; +import { ComponentContent } from '../common/ComponentContent'; @Injectable() export class AnnotationService { @@ -251,6 +253,17 @@ export class AnnotationService { return annotation.type === 'score' || annotation.type === 'autoScore'; } + getTotalNodeScore(workgroupId: number, node: Node, components: ComponentContent[]): number { + return this.getTotalScore( + this.annotations.filter( + (annotation) => + annotation.nodeId === node.id && + annotation.toWorkgroupId === workgroupId && + components.some((component) => component.id === annotation.componentId) + ) + ); + } + getTotalNodeScoreForWorkgroup(workgroupId: number, nodeId: string) { const annotationsForNodeAndWorkgroup = this.annotations.filter((annotation) => { return annotation.nodeId === nodeId && annotation.toWorkgroupId === workgroupId; From f92779d0ea1ec753d1a62e921f4e6326b4d90a02 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Tue, 27 May 2025 09:19:25 -0700 Subject: [PATCH 13/17] Add tests for the new components --- .../node-class-responses.component.spec.ts | 15 +++++++++++++-- .../node-workgroup-item.component.spec.ts | 5 ++++- .../node-workgroup-item.component.ts | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts index 87959dd21b9..579a1fde24d 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.spec.ts @@ -10,10 +10,14 @@ import { NotificationService } from '../../../../services/notificationService'; import { TeacherProjectService } from '../../../../services/teacherProjectService'; import { of } from 'rxjs'; import { WorkgroupSelectAutocompleteComponent } from '../../../../../../app/classroom-monitor/workgroup-select/workgroup-select-autocomplete/workgroup-select-autocomplete.component'; +import { MatButtonHarness } from '@angular/material/button/testing'; +import { HarnessLoader } from '@angular/cdk/testing'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; describe('NodeClassResponsesComponent', () => { let component: NodeClassResponsesComponent; let fixture: ComponentFixture; + let loader: HarnessLoader; beforeEach(async () => { await TestBed.configureTestingModule({ @@ -35,11 +39,18 @@ describe('NodeClassResponsesComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(NodeClassResponsesComponent); + loader = TestbedHarnessEnvironment.loader(fixture); component = fixture.componentInstance; + component['sortedWorkgroups'] = [ + { workgroupId: 1, name: 'Workgroup 1' }, + { workgroupId: 2, name: 'Workgroup 2' } + ]; fixture.detectChanges(); }); - it('should create', () => { - expect(component).toBeTruthy(); + it('clicking on the expand all button should expand all teams', async () => { + expect(component['allWorkgroupsExpanded']).toBeFalsy(); + await (await loader.getHarness(MatButtonHarness.with({ text: '+ Expand all' }))).click(); + expect(component['allWorkgroupsExpanded']).toBeTrue(); }); }); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts index 8001e28b6ab..48803a537b6 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.spec.ts @@ -31,7 +31,10 @@ describe('NodeWorkgroupItemComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it('should show team 1 with status', () => { expect(component).toBeTruthy(); + const textContent = fixture.nativeElement.textContent; + expect(textContent).toContain('Team 1'); + expect(textContent).toContain('Not Visited'); }); }); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts index 18cd7164287..41f7b6b1c3c 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts @@ -37,8 +37,8 @@ import { AnnotationService } from '../../../../services/annotationService'; WorkgroupComponentGradingComponent ], selector: 'node-workgroup-item', - templateUrl: './node-workgroup-item.component.html', - styleUrl: './node-workgroup-item.component.scss' + styleUrl: './node-workgroup-item.component.scss', + templateUrl: './node-workgroup-item.component.html' }) export class NodeWorkgroupItemComponent { private componentIdToHasWork: { [componentId: string]: boolean } = {}; From ef826c5fb48cf9eacb75a7e88b019e67661bd1e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 May 2025 16:34:00 +0000 Subject: [PATCH 14/17] Updated messages --- src/messages.xlf | 418 +++++++++++++++++++++++------------------------ 1 file changed, 202 insertions(+), 216 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index f3703ac3b7e..3482fed0f25 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -2409,14 +2409,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/assets/wise5/authoringTool/select-branch-criteria/branch-criteria-help/branch-criteria-help.component.html 29,30 - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 71,73 - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html 90,92 + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 71,73 + src/assets/wise5/classroomMonitor/student-grading/student-grading.component.html 100,102 @@ -9307,10 +9307,6 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/app/teacher/select-runs-controls/select-runs-controls.component.html 23,24 - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.ts - 69 - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details/milestone-details.component.html 85,88 @@ -9319,6 +9315,10 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts 143 + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 137 + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts 104 @@ -11510,10 +11510,6 @@ The branches will be removed but the steps will remain in the unit. src/assets/wise5/authoringTool/new-project-template.ts 80 - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestone-report-button/milestone-report-button.component.html - 5,9 - src/assets/wise5/services/notebookService.ts 45 @@ -13434,203 +13430,6 @@ The branches will be removed but the steps will remain in the unit. 64 - - Expand all teams - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 8,11 - - - - + Expand all - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 14,18 - - - - Collapse all teams - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 18,21 - - - - - Collapse all - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 24,28 - - - - Sort by team - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 34,38 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html - 47,50 - - - - Team - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 37,38 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html - 50,52 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details/milestone-details.component.html - 83,86 - - - src/assets/wise5/classroomMonitor/notebook-grading/notebook-grading.component.html - 52,54 - - - src/assets/wise5/classroomMonitor/student-progress/student-progress.component.ts - 40 - - - - Sorty by completion - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 51,55 - - - - Status - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 54,55 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html - 70,72 - - - src/assets/wise5/classroomMonitor/student-grading/student-grading.component.html - 81,83 - - - - Sort by score - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-class-responses/component-class-responses.component.html - 68,72 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html - 87,90 - - - src/assets/wise5/classroomMonitor/student-grading/student-grading.component.html - 97,100 - - - - Component Completion - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-grading-view/component-grading-view.component.html - 6,7 - - - - Show/hide team's work for this step - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.html - 11,14 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.html - 11,13 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.html - 12,14 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.html - 12,14 - - - - Not Assigned - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.ts - 65 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts - 139 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts - 99 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts - 91 - - - - Partially Completed - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.ts - 73 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts - 147 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts - 111 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts - 103 - - - - Not Completed - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.ts - 78 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details/milestone-details.component.html - 109,113 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts - 152 - - - - No Work - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-workgroup-item/component-workgroup-item.component.ts - 80 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts - 154 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts - 116 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts - 108 - - No feedback given for this version @@ -14106,6 +13905,40 @@ The branches will be removed but the steps will remain in the unit. 29,32 + + Sort by team + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html + 47,50 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 34,38 + + + + Team + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html + 50,52 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details/milestone-details.component.html + 83,86 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 37,38 + + + src/assets/wise5/classroomMonitor/notebook-grading/notebook-grading.component.html + 52,54 + + + src/assets/wise5/classroomMonitor/student-progress/student-progress.component.ts + 40 + + Sort by completion @@ -14117,6 +13950,36 @@ The branches will be removed but the steps will remain in the unit. 78,81 + + Status + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html + 70,72 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 54,55 + + + src/assets/wise5/classroomMonitor/student-grading/student-grading.component.html + 81,83 + + + + Sort by score + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-class-responses/milestone-class-responses.component.html + 87,90 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 68,72 + + + src/assets/wise5/classroomMonitor/student-grading/student-grading.component.html + 97,100 + + Sort by score on Step @@ -14254,6 +14117,36 @@ The branches will be removed but the steps will remain in the unit. 77,79 + + Not Completed + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details/milestone-details.component.html + 109,113 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts + 152 + + + + Show/hide team's work for this step + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.html + 11,13 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.html + 12,14 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.html + 12,14 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.html + 12,14 + + Step @@ -14265,6 +14158,63 @@ The branches will be removed but the steps will remain in the unit. 92,93 + + Not Assigned + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts + 139 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 132 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts + 99 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts + 91 + + + + Partially Completed + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts + 147 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 144 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts + 111 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts + 103 + + + + No Work + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-workgroup-item/milestone-workgroup-item.component.ts + 154 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 149 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts + 116 + + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/studentGrading/step-item/step-item.component.ts + 108 + + Assessment items to show @@ -14290,6 +14240,41 @@ The branches will be removed but the steps will remain in the unit. 31 + + Expand all teams + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 8,11 + + + + + Expand all + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 14,18 + + + + Collapse all teams + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 18,21 + + + + - Collapse all + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 24,28 + + + + Sorty by completion + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-class-responses/node-class-responses.component.html + 51,55 + + Step Completion @@ -14320,6 +14305,10 @@ The branches will be removed but the steps will remain in the unit. Visited + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 139 + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts 106 @@ -14331,6 +14320,10 @@ The branches will be removed but the steps will remain in the unit. Not Visited + + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-workgroup-item/node-workgroup-item.component.ts + 151 + src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component.ts 118 @@ -14473,13 +14466,6 @@ The branches will be removed but the steps will remain in the unit. 34,35 - - Peer Groups - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/peer-group-button/peer-group-button.component.html - 5,9 - - Groupings for From 5fe932958ae82d8f3e523d7a2ffe127176db5827 Mon Sep 17 00:00:00 2001 From: Jonathan Lim-Breitbart Date: Wed, 28 May 2025 09:39:38 -0700 Subject: [PATCH 15/17] Update styles and terminology --- .../filter-components.component.html | 27 +++++++++---------- .../filter-components.component.scss | 10 +++++++ .../filter-components.component.ts | 1 + .../node-grading/node-grading.component.html | 4 +-- .../node-grading/node-grading.component.ts | 4 +++ 5 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.scss diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html index dabc17a1b06..723ede07dd7 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html @@ -1,9 +1,8 @@ -@if (components.length == 1) { - -} @else if (components.length > 1) { - + + @if (components.length == 1) { + + + } @else if (components.length > 1) { {{ selectedText }} - - @for (component of components; track component.id; let i = $index) { - - {{ i + 1 }}: {{ getComponentTypeLabel(component.type) }} - - } - + @for (component of components; track component.id; let i = $index) { + + {{ i + 1 }}: {{ getComponentTypeLabel(component.type) }} + + } - -} + } + diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.scss b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.scss new file mode 100644 index 00000000000..409d37e82a1 --- /dev/null +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.scss @@ -0,0 +1,10 @@ +@use '@angular/material' as mat; + +.component-select { + @include mat.form-field-overrides( + ( + container-vertical-padding: 8px, + container-height: 40px + ) + ); +} \ No newline at end of file diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts index 6dcfb089225..74cea9ce3dc 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts @@ -10,6 +10,7 @@ import { ComponentContent } from '../../../../common/ComponentContent'; @Component({ imports: [CommonModule, FormsModule, MatButtonModule, MatFormFieldModule, MatSelectModule], selector: 'filter-components', + styleUrls: ['./filter-components.component.scss'], templateUrl: './filter-components.component.html' }) export class FilterComponentsComponent { diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html index 3d28705aadd..b9f248ef0c2 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html @@ -24,8 +24,8 @@

-
- Question: +
+

Class Responses

Date: Wed, 28 May 2025 09:54:59 -0700 Subject: [PATCH 16/17] Fix tests --- .../filter-components.component.spec.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts index dc571cb0550..f2b9c28cf47 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.spec.ts @@ -36,12 +36,10 @@ function onlyOneComponent() { } as ComponentContent ]; fixture.detectChanges(); + select = await loader.getHarness(MatSelectHarness); }); - it('should show button when there is only 1 component', () => { - const button = fixture.nativeElement.querySelector('button'); - expect(button).toBeTruthy(); - expect(button.innerText).toBe('1 assessment item'); - expect(button.disabled).toBe(true); + it('should be disabled', async () => { + expect(await select.isDisabled()).toBe(true); }); }); } @@ -65,9 +63,6 @@ function moreThanOneComponent() { }); it('should show options', async () => { await select.open(); - const optionGroups = await select.getOptionGroups(); - expect(optionGroups.length).toBe(1); - expect(await optionGroups[0].getLabelText()).toBe('Assessment items to show'); const options = await select.getOptions(); expect(options.length).toBe(2); expect(await options[0].isSelected()).toBe(true); From 237a8a5a6b7b38d16c8ac7bbc0b5d7ec05e6f4d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 May 2025 17:00:01 +0000 Subject: [PATCH 17/17] Updated messages --- src/messages.xlf | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index 3482fed0f25..513303072d4 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -14215,29 +14215,11 @@ The branches will be removed but the steps will remain in the unit. 108 - - Assessment items to show - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html - 2,5 - - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html - 15,16 - - - - 1 assessment item - - src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.html - 3,6 - - Showing / items src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/filter-components/filter-components.component.ts - 31 + 32 @@ -14296,12 +14278,16 @@ The branches will be removed but the steps will remain in the unit. 22,23 - - Question: + + Class Responses src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/node-grading/node-grading.component.html 28,31 + + src/assets/wise5/directives/summary-display/summary-display.component.ts + 412 + Visited @@ -21533,13 +21519,6 @@ If this problem continues, let your teacher know and move on to the next activit 403 - - Class Responses - - src/assets/wise5/directives/summary-display/summary-display.component.ts - 412 - - Class Scores