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 65d00c9e538..99befdd7142 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 @@ -90,6 +90,17 @@ }

} + @if (project.metadata.resources?.length > 0) { +

+ Resources:  + @for (resource of project.metadata.resources; track resource.name; let last = $last) { + {{ + resource.name + }} + {{ last ? '' : ' | ' }} + } +

+ } @if (project.metadata.discourseCategoryURL) { @@ -148,14 +159,21 @@
- @if (isTeacher && !isRunProject && project.wiseVersion !== 4) { + @if ( + isTeacher && + !isRunProject && + project.wiseVersion !== 4 && + project.metadata.unitType === 'Platform' + ) { } - + @if (project.metadata.unitType === 'Platform') { + + }
diff --git a/src/app/modules/library/library-project-details/library-project-details.component.spec.ts b/src/app/modules/library/library-project-details/library-project-details.component.spec.ts index f1a16c0e3e8..d26737c1f73 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.spec.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.spec.ts @@ -6,14 +6,16 @@ import { Project } from '../../../domain/project'; import { NGSSStandards } from '../ngssStandards'; import { ConfigService } from '../../../services/config.service'; import { ParentProject } from '../../../domain/parentProject'; -import { MockProviders } from 'ng-mocks'; +import { MockComponent, MockProviders } from 'ng-mocks'; +import { By } from '@angular/platform-browser'; +import { LibraryProjectMenuComponent } from '../library-project-menu/library-project-menu.component'; +let component: LibraryProjectDetailsComponent; +let fixture: ComponentFixture; describe('LibraryProjectDetailsComponent', () => { - let component: LibraryProjectDetailsComponent; - let fixture: ComponentFixture; - beforeEach(() => { TestBed.configureTestingModule({ + declarations: [MockComponent(LibraryProjectMenuComponent)], imports: [LibraryProjectDetailsComponent], providers: [ MockProviders(ConfigService, MatDialog, MatDialogRef, UserService), @@ -30,11 +32,13 @@ describe('LibraryProjectDetailsComponent', () => { grades: ['7'], title: 'Photosynthesis & Cellular Respiration', summary: 'A really great unit.', + unitType: 'Platform', totalTime: '6-7 hours', authors: [ { id: 10, firstName: 'Spaceman', lastName: 'Spiff', username: 'SpacemanSpiff' }, { id: 12, firstName: 'Captain', lastName: 'Napalm', username: 'CaptainNapalm' } - ] + ], + resources: [{ name: 'Resource 1', uri: 'http://example.com/resource1' }] }; const ngssObject: any = { disciplines: [ @@ -90,6 +94,11 @@ describe('LibraryProjectDetailsComponent', () => { expect(compiled.textContent).toContain('by Spaceman Spiff, Captain Napalm'); }); + it('should show project resources', () => { + const compiled = fixture.debugElement.nativeElement; + expect(compiled.textContent).toContain('Resource 1'); + }); + it('should show copied project info', () => { component['project'].metadata.authors = []; component['parentProject'] = new ParentProject({ @@ -103,4 +112,33 @@ describe('LibraryProjectDetailsComponent', () => { const compiled = fixture.debugElement.nativeElement; expect(compiled.textContent).toContain('is a copy of Photosynthesis'); }); + + it('should show use with class and preview buttons', () => { + component['isTeacher'] = true; + fixture.detectChanges(); + expect(getButtonWithText('Use with Class')).toBeTruthy(); + expect(getButtonWithText('Preview')).toBeTruthy(); + }); + + isResourceUnitType_HideButtons(); }); + +function isResourceUnitType_HideButtons() { + describe('is not Resource unit type', () => { + beforeEach(() => { + component['project'].metadata.unitType = 'Resource'; + fixture.detectChanges(); + }); + + it('should hide buttons when unit type is Resource', () => { + expect(getButtonWithText('Use with Class')).toBeFalsy(); + expect(getButtonWithText('Preview')).toBeFalsy(); + }); + }); +} + +function getButtonWithText(text: string) { + return fixture.debugElement + .queryAll(By.css('button')) + .find((el) => el.nativeElement.textContent.includes(text)); +} diff --git a/src/app/teacher/authoring-tool.module.ts b/src/app/teacher/authoring-tool.module.ts index 8b4f180fe20..32f1f2ba86f 100644 --- a/src/app/teacher/authoring-tool.module.ts +++ b/src/app/teacher/authoring-tool.module.ts @@ -61,6 +61,8 @@ import { AddComponentComponent } from '../../assets/wise5/authoringTool/node/add 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'; @NgModule({ declarations: [ @@ -106,6 +108,8 @@ import { ChooseImportComponentComponent } from '../../assets/wise5/authoringTool CreateBranchComponent, EditBranchComponent, EditNodeTitleComponent, + EditUnitResourcesComponent, + EditUnitTypeComponent, MatBadgeModule, MatChipsModule, MatExpansionModule, diff --git a/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.html b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.html new file mode 100644 index 00000000000..c6a7ba7ce69 --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.html @@ -0,0 +1,70 @@ + + + +
+
+ Resources + + +
+
    + @for ( + resource of resources; + track $index; + let resourceIndex = $index, first = $first, last = $last + ) { +
  • + +
    +
    + {{ resourceIndex + 1 }} +
    +
    + + Resource Name + + + + Resource URL + + +
    +
    + +
    +
    +
    +
  • + } +
+
+ +
+
diff --git a/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.scss b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.scss new file mode 100644 index 00000000000..faea007bb8c --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.scss @@ -0,0 +1,37 @@ +@import 'style/abstracts/variables'; + +.resource-descriptions { + padding: 16px; + border-radius: $card-border-radius; +} + +h5 { + margin-top: 0; +} + +ul { + margin: 16px 0 0 0; + padding: 0 0 16px; +} + +li { + list-style-type: none; +} + +.resource { + position: relative; +} + +.resource-content { + width: 100%; + padding: 8px; + margin-bottom: 8px; +} + +.resource-input { + width: 100%; +} + +.mat-subtitle-1 { + margin: 0; +} diff --git a/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.spec.ts b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.spec.ts new file mode 100644 index 00000000000..3072b8b76f2 --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.spec.ts @@ -0,0 +1,67 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { EditUnitResourcesComponent } from './edit-unit-resources.component'; +import { MockProvider } from 'ng-mocks'; +import { TeacherProjectService } from '../../services/teacherProjectService'; +import { By } from '@angular/platform-browser'; + +let component: EditUnitResourcesComponent; +let fixture: ComponentFixture; +describe('EditUnitResourcesComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [EditUnitResourcesComponent], + providers: [MockProvider(TeacherProjectService)] + }).compileComponents(); + + fixture = TestBed.createComponent(EditUnitResourcesComponent); + component = fixture.componentInstance; + component.resources = [ + { name: 'Resource 1', url: 'http://example.com/resource1' }, + { name: 'Resource 2', url: 'http://example.com/resource2' } + ]; + fixture.detectChanges(); + }); + + it('should show the correct number of resources', () => { + const resourceElements = fixture.debugElement.queryAll(By.css('input')); + expect(resourceElements.length).toBe(2); + expect(resourceElements[0].nativeElement.value).toContain('Resource 1'); + expect(resourceElements[1].nativeElement.value).toContain('Resource 2'); + }); + + clickTopAddButton_addNewResourceAtTheBeginning(); + clickBottomTopButton_addNewResourceAtTheEnd(); +}); + +function clickTopAddButton_addNewResourceAtTheBeginning() { + describe('Clicking on the top Add Resource button', () => { + let initialLength = 0; + beforeEach(() => { + initialLength = component.resources.length; + fixture.debugElement.queryAll(By.css('button'))[0].nativeElement.click(); + fixture.detectChanges(); + }); + it('should add a new resource to the beginning of the list', () => { + expect(component.resources.length).toBe(initialLength + 1); + expect(component.resources[0].name).toEqual(''); + expect(component.resources[0].url).toEqual(''); + }); + }); +} + +function clickBottomTopButton_addNewResourceAtTheEnd() { + describe('Clicking on the bottom Add Resource button', () => { + let initialLength = 0; + beforeEach(() => { + initialLength = component.resources.length; + const allButtons = fixture.debugElement.queryAll(By.css('button')); + allButtons[allButtons.length - 1].nativeElement.click(); + fixture.detectChanges(); + }); + it('should add a new resource to the end of the list', () => { + expect(component.resources.length).toBe(initialLength + 1); + expect(component.resources.at(-1).name).toEqual(''); + expect(component.resources.at(-1).url).toEqual(''); + }); + }); +} diff --git a/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.ts b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.ts new file mode 100644 index 00000000000..6858ac0cc5c --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-resources/edit-unit-resources.component.ts @@ -0,0 +1,84 @@ +import { CdkTextareaAutosize } from '@angular/cdk/text-field'; +import { CommonModule } from '@angular/common'; +import { Component, Input } from '@angular/core'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TeacherProjectService } from '../../services/teacherProjectService'; +import { debounceTime, distinctUntilChanged, Subject, Subscription } from 'rxjs'; + +class UnitResource { + name: string; + url: string; + constructor(name: string, url: string) { + this.name = name; + this.url = url; + } +} + +@Component({ + imports: [ + CommonModule, + CdkTextareaAutosize, + FlexLayoutModule, + FormsModule, + MatCardModule, + MatInputModule, + MatFormFieldModule, + MatButtonModule, + MatIconModule, + MatTooltipModule + ], + selector: 'edit-unit-resources', + styleUrl: './edit-unit-resources.component.scss', + templateUrl: './edit-unit-resources.component.html' +}) +export class EditUnitResourcesComponent { + protected inputChanged: Subject = new Subject(); + @Input() resources: UnitResource[] = []; + private subscriptions: Subscription = new Subscription(); + + constructor(private projectService: TeacherProjectService) {} + + ngOnInit(): void { + this.subscriptions.add( + this.inputChanged + .pipe(debounceTime(1000), distinctUntilChanged()) + .subscribe(() => this.projectService.saveProject()) + ); + } + + ngOnDestroy(): void { + this.subscriptions.unsubscribe(); + } + + protected addNewResource(addToTop: boolean): void { + const location = addToTop ? 0 : this.resources.length; + this.resources.splice(location, 0, new UnitResource('', '')); + this.projectService.saveProject(); + if (!addToTop) { + this.scrollToBottomOfList(); + } + } + + private scrollToBottomOfList(): void { + setTimeout(() => { + const button = document.getElementById('add-new-resource-bottom-button'); + if (button) { + button.scrollIntoView(); + } + }, 0); + } + + protected deleteResource(resourceIndex: number): void { + if (confirm($localize`Are you sure you want to delete this resource?`)) { + this.resources.splice(resourceIndex, 1); + this.projectService.saveProject(); + } + } +} diff --git a/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.html b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.html new file mode 100644 index 00000000000..45f67ad4947 --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.html @@ -0,0 +1,10 @@ +
Unit Type
+ + WISE Platform (Uses features on this platform to collect student data) + Other Platform (Contains activities and resources for teachers and does not collect student + data) + diff --git a/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.spec.ts b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.spec.ts new file mode 100644 index 00000000000..131e89aaa89 --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.spec.ts @@ -0,0 +1,48 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { EditUnitTypeComponent } from './edit-unit-type.component'; +import { HarnessLoader } from '@angular/cdk/testing'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/radio/testing'; +import { MockProvider } from 'ng-mocks'; +import { TeacherProjectService } from '../../services/teacherProjectService'; + +describe('EditUnitTypeComponent', () => { + let component: EditUnitTypeComponent; + let fixture: ComponentFixture; + let loader: HarnessLoader; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [EditUnitTypeComponent], + providers: [MockProvider(TeacherProjectService)] + }).compileComponents(); + + fixture = TestBed.createComponent(EditUnitTypeComponent); + component = fixture.componentInstance; + component.metadata = { unitType: 'Platform' }; + fixture.detectChanges(); + loader = TestbedHarnessEnvironment.loader(fixture); + }); + + it('should show options and select unit type', async () => { + const groups = await loader.getAllHarnesses(MatRadioGroupHarness); + expect(groups.length).toBe(1); + expect(await groups[0].getName()).toBe('unitTypes'); + const [firstRadio, secondRadio] = await loader.getAllHarnesses(MatRadioButtonHarness); + expect(await firstRadio.getLabelText()).toContain('Platform'); + expect(await secondRadio.getLabelText()).toContain('Other Platform'); + expect(await firstRadio.isChecked()).toBeTrue(); + }); + + it('should check radio button and trigger a save', async () => { + const buttons = await loader.getAllHarnesses(MatRadioButtonHarness); + const spy = spyOn(TestBed.inject(TeacherProjectService), 'saveProject').and.callFake( + () => new Promise((resolve) => resolve(true)) + ); + await buttons[1].check(); + expect(await buttons[1].isChecked()).toBeTrue(); + expect(await buttons[0].isChecked()).toBeFalse(); + await fixture.whenStable(); + expect(spy).toHaveBeenCalled(); + }); +}); diff --git a/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.ts b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.ts new file mode 100644 index 00000000000..e37586b592b --- /dev/null +++ b/src/assets/wise5/authoringTool/edit-unit-type/edit-unit-type.component.ts @@ -0,0 +1,19 @@ +import { Component, Input } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatRadioModule } from '@angular/material/radio'; +import { TeacherProjectService } from '../../services/teacherProjectService'; + +@Component({ + imports: [FormsModule, MatRadioModule], + selector: 'edit-unit-type', + templateUrl: './edit-unit-type.component.html' +}) +export class EditUnitTypeComponent { + @Input() metadata: any; + + constructor(private projectService: TeacherProjectService) {} + + protected saveProject(): void { + this.projectService.saveProject(); + } +} diff --git a/src/assets/wise5/authoringTool/new-project-template.ts b/src/assets/wise5/authoringTool/new-project-template.ts index 46ddd10071b..ca539786fc4 100644 --- a/src/assets/wise5/authoringTool/new-project-template.ts +++ b/src/assets/wise5/authoringTool/new-project-template.ts @@ -46,7 +46,9 @@ export const newProjectTemplate = { template: 'starmap|leftNav|rightNav' }, metadata: { - title: '' + title: '', + resources: [], + unitType: 'Platform' }, notebook: { enabled: false, diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html index f49ce39b7ff..8142226e355 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html @@ -85,3 +85,5 @@ + + diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts index 9ff473921e5..82d8d58cb80 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts @@ -1,11 +1,12 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ProjectInfoAuthoringComponent } from './project-info-authoring.component'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { MatDialogModule } from '@angular/material/dialog'; import { TeacherProjectService } from '../../services/teacherProjectService'; import { StudentTeacherCommonServicesModule } from '../../../../app/student-teacher-common-services.module'; import { ConfigService } from '../../services/configService'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { EditUnitResourcesComponent } from '../edit-unit-resources/edit-unit-resources.component'; +import { EditUnitTypeComponent } from '../edit-unit-type/edit-unit-type.component'; describe('ProjectInfoAuthoringComponent', () => { let component: ProjectInfoAuthoringComponent; @@ -13,10 +14,18 @@ describe('ProjectInfoAuthoringComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ProjectInfoAuthoringComponent], - imports: [MatDialogModule, StudentTeacherCommonServicesModule], - providers: [TeacherProjectService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()] -}).compileComponents(); + declarations: [ProjectInfoAuthoringComponent], + imports: [ + EditUnitResourcesComponent, + EditUnitTypeComponent, + StudentTeacherCommonServicesModule + ], + providers: [ + TeacherProjectService, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting() + ] + }).compileComponents(); spyOn(TestBed.inject(TeacherProjectService), 'getProjectMetadata').and.returnValue({}); spyOn(TestBed.inject(ConfigService), 'getConfigParam').and.returnValue('{ "fields": [] }'); fixture = TestBed.createComponent(ProjectInfoAuthoringComponent); diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts index 7025c50608a..1f2e49091da 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts @@ -6,10 +6,10 @@ import { Subject, debounceTime } from 'rxjs'; import { AssetChooser } from '../project-asset-authoring/asset-chooser'; @Component({ - selector: 'project-info-authoring', - templateUrl: './project-info-authoring.component.html', - styleUrls: ['./project-info-authoring.component.scss'], - standalone: false + selector: 'project-info-authoring', + templateUrl: './project-info-authoring.component.html', + styleUrls: ['./project-info-authoring.component.scss'], + standalone: false }) export class ProjectInfoAuthoringComponent { isEditingProjectIcon: boolean = false; @@ -30,6 +30,12 @@ export class ProjectInfoAuthoringComponent { ngOnInit(): void { this.metadata = this.projectService.getProjectMetadata(); + if (this.metadata.resources == null) { + this.metadata.resources = []; + } + if (this.metadata.unitType == null) { + this.metadata.unitType = 'Platform'; + } this.metadataAuthoring = JSON.parse( this.configService.getConfigParam('projectMetadataSettings') ); diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.html index 906d9eac220..5f200e63117 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.html @@ -34,6 +34,7 @@

} @if (component.hasResponsesSummary && component.type === 'MultipleChoice') { } @if (component.hasScoresSummary && component.hasScoreAnnotation) { [doRender]="true" /> } + @if (component.hasResponsesSummary && component.type === 'DialogGuidance') { + + } } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.scss b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.scss index 983bc02da49..26d22af08da 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.scss +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.scss @@ -38,3 +38,8 @@ width: auto; } } + +.summary-display { + display: block; + margin: 16px 0; +} diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.ts index 2abf08445e9..8ea03190e0c 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.ts @@ -1,34 +1,36 @@ -import { Component, Input } from '@angular/core'; -import { SummaryService } from '../../../../components/summary/summaryService'; import { AnnotationService } from '../../../../services/annotationService'; +import { CommonModule } from '@angular/common'; +import { Component, Input } from '@angular/core'; +import { ComponentFactory } from '../../../../common/ComponentFactory'; import { ComponentServiceLookupService } from '../../../../services/componentServiceLookupService'; import { ComponentTypeService } from '../../../../services/componentTypeService'; -import { TeacherDataService } from '../../../../services/teacherDataService'; -import { TeacherProjectService } from '../../../../services/teacherProjectService'; -import { ComponentFactory } from '../../../../common/ComponentFactory'; +import { DialogGuidanceTeacherSummaryDisplayComponent } from '../../../../directives/teacher-summary-display/dialog-guidance-teacher-summary-display.component'; +import { FlexLayoutModule } from '@angular/flex-layout'; import { isMatchingPeriods } from '../../../../common/period/period'; -import { Node } from '../../../../common/Node'; import { MatCardModule } from '@angular/material/card'; -import { MatIconModule } from '@angular/material/icon'; import { MatDividerModule } from '@angular/material/divider'; -import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatIconModule } from '@angular/material/icon'; +import { Node } from '../../../../common/Node'; import { PreviewComponentComponent } from '../../../../authoringTool/components/preview-component/preview-component.component'; +import { SummaryService } from '../../../../components/summary/summaryService'; +import { TeacherDataService } from '../../../../services/teacherDataService'; +import { TeacherProjectService } from '../../../../services/teacherProjectService'; import { TeacherSummaryDisplayComponent } from '../../../../directives/teacher-summary-display/teacher-summary-display.component'; -import { CommonModule } from '@angular/common'; @Component({ - imports: [ - CommonModule, - MatCardModule, - MatIconModule, - MatDividerModule, - FlexLayoutModule, - PreviewComponentComponent, - TeacherSummaryDisplayComponent - ], - selector: 'node-info', - styleUrl: 'node-info.component.scss', - templateUrl: 'node-info.component.html' + imports: [ + DialogGuidanceTeacherSummaryDisplayComponent, + CommonModule, + MatCardModule, + MatIconModule, + MatDividerModule, + FlexLayoutModule, + PreviewComponentComponent, + TeacherSummaryDisplayComponent + ], + selector: 'node-info', + styleUrl: 'node-info.component.scss', + templateUrl: 'node-info.component.html' }) export class NodeInfoComponent { protected node: Node; diff --git a/src/assets/wise5/components/common/cRater/CRaterIdea.ts b/src/assets/wise5/components/common/cRater/CRaterIdea.ts index a170da13909..4470bb9409c 100644 --- a/src/assets/wise5/components/common/cRater/CRaterIdea.ts +++ b/src/assets/wise5/components/common/cRater/CRaterIdea.ts @@ -1,11 +1,13 @@ export class CRaterIdea { name: string; - detected: boolean; + detected?: boolean; characterOffsets: any[]; text?: string; - constructor(name: string, detected: boolean) { + constructor(name: string, detected?: boolean) { this.name = name; - this.detected = detected; + if (detected) { + this.detected = detected; + } } } diff --git a/src/assets/wise5/components/common/cRater/CRaterRubric.ts b/src/assets/wise5/components/common/cRater/CRaterRubric.ts index 59b118a166e..a93eea422b8 100644 --- a/src/assets/wise5/components/common/cRater/CRaterRubric.ts +++ b/src/assets/wise5/components/common/cRater/CRaterRubric.ts @@ -10,6 +10,10 @@ export class CRaterRubric { getIdea(ideaId: string): CRaterIdea { return this.ideas.find((idea) => idea.name === ideaId); } + + getIdeas(): CRaterIdea[] { + return this.ideas; + } } export function getUniqueIdeas(responses: any[], rubric: CRaterRubric): CRaterIdea[] { diff --git a/src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html b/src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html index d2144dc60b7..593579fee57 100644 --- a/src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html +++ b/src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html @@ -1,10 +1,10 @@
- Idea Names + Idea Descriptions