diff --git a/src/app/possible-score/possible-score.component.ts b/src/app/possible-score/possible-score.component.ts index b6548d5db6b..40b6fc5e319 100644 --- a/src/app/possible-score/possible-score.component.ts +++ b/src/app/possible-score/possible-score.component.ts @@ -1,21 +1,20 @@ import { Component, Input } from '@angular/core'; import { ProjectService } from '../../assets/wise5/services/projectService'; +import { CommonModule } from '@angular/common'; @Component({ + imports: [CommonModule], selector: 'possible-score', + standalone: true, templateUrl: 'possible-score.component.html' }) export class PossibleScoreComponent { - @Input() - maxScore: any; - - themeSettings: any; - hidePossibleScores: any; + protected hidePossibleScores: boolean; + @Input() maxScore: number; constructor(private projectService: ProjectService) {} - ngOnInit() { - this.themeSettings = this.projectService.getThemeSettings(); - this.hidePossibleScores = this.themeSettings.hidePossibleScores; + ngOnInit(): void { + this.hidePossibleScores = this.projectService.getThemeSettings().hidePossibleScores; } } diff --git a/src/app/student/student.component.module.ts b/src/app/student/student.component.module.ts index 0b6a5843117..661fce87efc 100644 --- a/src/app/student/student.component.module.ts +++ b/src/app/student/student.component.module.ts @@ -16,17 +16,15 @@ import { StudentTeacherCommonModule } from '../student-teacher-common.module'; ComponentHeader, ComponentSaveSubmitButtons, DynamicPromptComponent, - PossibleScoreComponent, PromptComponent ], - imports: [StudentTeacherCommonModule, ComponentStateInfoModule], + imports: [ComponentStateInfoModule, PossibleScoreComponent, StudentTeacherCommonModule], exports: [ AddToNotebookButton, ComponentAnnotationsComponent, ComponentHeader, ComponentSaveSubmitButtons, DynamicPromptComponent, - PossibleScoreComponent, PromptComponent ] }) diff --git a/src/assets/wise5/components/aiChat/ai-chat-student/ai-chat-student.component.spec.ts b/src/assets/wise5/components/aiChat/ai-chat-student/ai-chat-student.component.spec.ts index 26a64e9c1ea..63f0498a36b 100644 --- a/src/assets/wise5/components/aiChat/ai-chat-student/ai-chat-student.component.spec.ts +++ b/src/assets/wise5/components/aiChat/ai-chat-student/ai-chat-student.component.spec.ts @@ -9,7 +9,6 @@ import { ComponentHeader } from '../../../directives/component-header/component- import { AiChatModule } from '../ai-chat.module'; import { MatFormFieldModule } from '@angular/material/form-field'; import { PromptComponent } from '../../../directives/prompt/prompt.component'; -import { PossibleScoreComponent } from '../../../../../app/possible-score/possible-score.component'; import { AiChatComponent } from '../AiChatComponent'; import { FormsModule } from '@angular/forms'; import { MatInputModule } from '@angular/material/input'; @@ -17,6 +16,7 @@ import { ProjectService } from '../../../services/projectService'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { ChatInputComponent } from '../../../common/chat-input/chat-input.component'; +import { PossibleScoreComponent } from '../../../../../app/possible-score/possible-score.component'; describe('AiChatStudentComponent', () => { let component: AiChatStudentComponent; @@ -24,12 +24,7 @@ describe('AiChatStudentComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ - AiChatStudentComponent, - ComponentHeader, - PossibleScoreComponent, - PromptComponent - ], + declarations: [AiChatStudentComponent, ComponentHeader, PromptComponent], imports: [ AiChatModule, BrowserAnimationsModule, @@ -41,6 +36,7 @@ describe('AiChatStudentComponent', () => { MatFormFieldModule, MatInputModule, MatSnackBarModule, + PossibleScoreComponent, StudentTeacherCommonServicesModule ], providers: [AiChatService] diff --git a/src/assets/wise5/components/audioOscillator/audio-oscillator-student/audio-oscillator-student.component.spec.ts b/src/assets/wise5/components/audioOscillator/audio-oscillator-student/audio-oscillator-student.component.spec.ts index a9b55bc462e..ffa9370f844 100644 --- a/src/assets/wise5/components/audioOscillator/audio-oscillator-student/audio-oscillator-student.component.spec.ts +++ b/src/assets/wise5/components/audioOscillator/audio-oscillator-student/audio-oscillator-student.component.spec.ts @@ -41,10 +41,11 @@ describe('AudioOscillatorStudent', () => { MatInputModule, MatSelectModule, MatTooltipModule, + PossibleScoreComponent, ReactiveFormsModule, StudentTeacherCommonServicesModule ], - declarations: [AudioOscillatorStudent, ComponentHeader, PossibleScoreComponent], + declarations: [AudioOscillatorStudent, ComponentHeader], schemas: [NO_ERRORS_SCHEMA] }); fixture = TestBed.createComponent(AudioOscillatorStudent); diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.spec.ts b/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.spec.ts index 058ef27a986..f146b77d81e 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.spec.ts +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.spec.ts @@ -7,7 +7,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { PossibleScoreComponent } from '../../../../../app/possible-score/possible-score.component'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { ComputerAvatar } from '../../../common/computer-avatar/ComputerAvatar'; import { ComponentHeader } from '../../../directives/component-header/component-header.component'; @@ -27,6 +26,7 @@ import { DialogGuidanceComponent } from '../DialogGuidanceComponent'; import { RawCRaterResponse } from '../../common/cRater/RawCRaterResponse'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ChatInputComponent } from '../../../common/chat-input/chat-input.component'; +import { PossibleScoreComponent } from '../../../../../app/possible-score/possible-score.component'; let component: DialogGuidanceStudentComponent; let fixture: ComponentFixture; @@ -50,12 +50,7 @@ function createDialogGuidanceComponent(isComputerAvatarEnabled: boolean): Dialog describe('DialogGuidanceStudentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ - ComponentHeader, - DialogGuidanceStudentComponent, - DialogResponsesComponent, - PossibleScoreComponent - ], + declarations: [ComponentHeader, DialogGuidanceStudentComponent, DialogResponsesComponent], imports: [ BrowserAnimationsModule, ChatInputComponent, @@ -66,6 +61,7 @@ describe('DialogGuidanceStudentComponent', () => { MatFormFieldModule, MatIconModule, MatInputModule, + PossibleScoreComponent, StudentTeacherCommonServicesModule ], providers: [DialogGuidanceFeedbackService], diff --git a/src/assets/wise5/components/multipleChoice/multiple-choice-student/multiple-choice-student.component.spec.ts b/src/assets/wise5/components/multipleChoice/multiple-choice-student/multiple-choice-student.component.spec.ts index f56e89c235a..b869610f669 100644 --- a/src/assets/wise5/components/multipleChoice/multiple-choice-student/multiple-choice-student.component.spec.ts +++ b/src/assets/wise5/components/multipleChoice/multiple-choice-student/multiple-choice-student.component.spec.ts @@ -116,10 +116,11 @@ describe('MultipleChoiceStudentComponent', () => { MatCheckboxModule, MatDialogModule, MatRadioModule, + PossibleScoreComponent, ReactiveFormsModule, StudentTeacherCommonServicesModule ], - declarations: [ComponentHeader, MultipleChoiceStudent, PossibleScoreComponent], + declarations: [ComponentHeader, MultipleChoiceStudent], schemas: [NO_ERRORS_SCHEMA] }); fixture = TestBed.createComponent(MultipleChoiceStudent); diff --git a/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.spec.ts b/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.spec.ts index 411ef58af74..374fe02b7a5 100644 --- a/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.spec.ts +++ b/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.spec.ts @@ -40,6 +40,7 @@ describe('OpenResponseStudent', () => { HttpClientTestingModule, MatDialogModule, MatIconModule, + PossibleScoreComponent, ReactiveFormsModule, StudentTeacherCommonServicesModule ], @@ -47,8 +48,7 @@ describe('OpenResponseStudent', () => { ComponentHeader, ComponentSaveSubmitButtons, DialogWithoutCloseComponent, - OpenResponseStudent, - PossibleScoreComponent + OpenResponseStudent ], providers: [AudioRecorderService], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/assets/wise5/components/peerChat/peer-chat-student/peer-chat-student.component.spec.ts b/src/assets/wise5/components/peerChat/peer-chat-student/peer-chat-student.component.spec.ts index f003f43cc9f..b7c3c3e8c59 100644 --- a/src/assets/wise5/components/peerChat/peer-chat-student/peer-chat-student.component.spec.ts +++ b/src/assets/wise5/components/peerChat/peer-chat-student/peer-chat-student.component.spec.ts @@ -130,13 +130,13 @@ describe('PeerChatStudentComponent', () => { MatIconModule, MatInputModule, PeerChatModule, + PossibleScoreComponent, StudentTeacherCommonServicesModule ], declarations: [ ComponentHeader, DynamicPromptComponent, PeerChatStudentComponent, - PossibleScoreComponent, PromptComponent ], providers: [