Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h5 i18n>Choose the step(s) that you want to import, then select Submit.</h5>
<h5 i18n>Choose the step(s) that you want to import, then select Next.</h5>
<p fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="8px">
<strong i18n>Selected unit: {{ project?.metadata.title }}</strong>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
}
</div>
</ng-template>
@if (importType === 'step') {
<h5 i18n>Choose a unit from which to import step(s).</h5>
} @else {
<h5 i18n>Choose a unit from which to import component(s).</h5>
}
<h5 i18n>Choose a unit from which to import step(s).</h5>
<mat-tab-group mat-stretch-tabs="false">
<mat-tab label="My Units" i18n-label>
@if (myProjects) {
<ng-container
[ngTemplateOutlet]="projects"
[ngTemplateOutletContext]="{ projects: myProjects }"
/>
>
</ng-container>
}
</mat-tab>
<mat-tab label="Library Units" i18n-label>
@if (libraryProjects) {
<ng-container
[ngTemplateOutlet]="projects"
[ngTemplateOutletContext]="{ projects: libraryProjects }"
/>
>
</ng-container>
}
</mat-tab>
</mat-tab-group>
<div class="nav-controls">
<mat-divider />
<div fxLayout="row" fxLayoutGap="16px" fxLayoutAlign="end center">
<button mat-button color="primary" (click)="goBack()" i18n>Back</button>
<button mat-button color="primary" routerLink="../../choose-template" [state]="target" i18n>
Back
</button>
<span fxFlex></span>
<button mat-button color="primary" (click)="cancel()" i18n>Cancel</button>
<button mat-button color="primary" routerLink="../../.." i18n>Cancel</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { FlexLayoutModule } from '@angular/flex-layout';
templateUrl: './choose-import-unit.component.html'
})
export class ChooseImportUnitComponent {
protected importType: 'step' | 'component';
protected libraryProjects: any[];
protected myProjects: any[];
private subscriptions: Subscription = new Subscription();
Expand All @@ -39,13 +38,12 @@ export class ChooseImportUnitComponent {
) {}

ngOnInit(): void {
this.importType = history.state.importType;
this.target = history.state;
this.myProjects = this.configService.getAuthorableProjects();
this.subscriptions.add(
this.projectLibraryService
.getLibraryProjects()
.subscribe((libraryProjects) => (this.libraryProjects = libraryProjects))
this.projectLibraryService.getLibraryProjects().subscribe((libraryProjects) => {
this.libraryProjects = libraryProjects;
})
);
}

Expand All @@ -55,19 +53,7 @@ export class ChooseImportUnitComponent {

protected chooseProject(project: any): void {
this.target.importProjectId = project.id;
this.navigate('../choose-component', '../choose-step');
}

protected goBack(): void {
this.navigate('../..', '../../choose-template');
}

protected cancel(): void {
this.navigate('../..', '../../..');
}

private navigate(componentUrl: string, stepUrl: string): void {
this.router.navigate([this.importType === 'component' ? componentUrl : stepUrl], {
this.router.navigate(['../choose-step'], {
relativeTo: this.route,
state: this.target
});
Expand Down
40 changes: 3 additions & 37 deletions src/app/services/cRaterService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,23 @@ import { CRaterIdea } from '../../assets/wise5/components/common/cRater/CRaterId
import { CRaterScore } from '../../assets/wise5/components/common/cRater/CRaterScore';
import { RawCRaterResponse } from '../../assets/wise5/components/common/cRater/RawCRaterResponse';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { ProjectService } from '../../assets/wise5/services/projectService';
import { ComponentContent } from '../../assets/wise5/common/ComponentContent';
let service: CRaterService;
let configService: ConfigService;
let http: HttpTestingController;
class MockProjectService {
getComponent(): ComponentContent {
return {} as ComponentContent;
}
}

describe('CRaterService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
ConfigService,
CRaterService,
{ provide: ProjectService, useClass: MockProjectService },
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting()
]
});
imports: [],
providers: [ConfigService, CRaterService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
});
http = TestBed.inject(HttpTestingController);
configService = TestBed.inject(ConfigService);
service = TestBed.inject(CRaterService);
});

makeCRaterScoringRequest();
getCRaterItemId();
getCRaterRubric();
isCRaterEnabled();
isCRaterScoreOnEvent();
getCRaterFeedbackTextByScore();
Expand Down Expand Up @@ -277,24 +264,3 @@ function getDataFromResponse() {
});
});
}

function getCRaterRubric() {
describe('getCRaterRubric', () => {
let projectService;
beforeEach(() => {
projectService = TestBed.inject(ProjectService);
});
it('should get CRater rubric when rubric exists on the component', () => {
spyOn(projectService, 'getComponent').and.returnValue({
cRaterRubric: { ideas: [{ name: '1', studentText: 'Idea 1' }] }
} as unknown as ComponentContent);
const cRaterRubric = service.getCRaterRubric('nodeId', 'componentId');
expect(cRaterRubric.getStudentTextForIdea('1')).toEqual('Idea 1');
});
it('should get an empty CRater rubric when rubric does not exists on the component', () => {
spyOn(projectService, 'getComponent').and.returnValue({} as unknown as ComponentContent);
const cRaterRubric = service.getCRaterRubric('nodeId', 'componentId');
expect(cRaterRubric.getStudentTextForIdea('1')).toEqual('1');
});
});
}
4 changes: 3 additions & 1 deletion src/app/student-teacher-common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { MatDividerModule } from '@angular/material/divider';
import { MatChipsModule } from '@angular/material/chips';
import { NotebookModule } from './notebook/notebook.module';
import { MatSliderModule } from '@angular/material/slider';
import { DialogResponseComponent } from '../assets/wise5/components/dialogGuidance/dialog-response/dialog-response.component';
import { DialogResponsesComponent } from '../assets/wise5/components/dialogGuidance/dialog-responses/dialog-responses.component';
import { HighchartsChartModule } from 'highcharts-angular';
import { EditNotebookItemDialogModule } from '../assets/wise5/themes/default/notebook/edit-notebook-item-dialog/edit-notebook-item-dialog.module';
Expand All @@ -39,9 +40,9 @@ import { MatMenuModule } from '@angular/material/menu';
import { ScrollingModule } from '@angular/cdk/scrolling';

@NgModule({
declarations: [DialogResponseComponent, DialogResponsesComponent],
imports: [
CommonModule,
DialogResponsesComponent,
DragDropModule,
EditNotebookItemDialogModule,
EditorModule,
Expand Down Expand Up @@ -80,6 +81,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
],
exports: [
CommonModule,
DialogResponseComponent,
DialogResponsesComponent,
DragDropModule,
EditorModule,
Expand Down
11 changes: 1 addition & 10 deletions src/app/teacher/authoring-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,7 @@ const routes: Routes = [
},
{
path: 'import-component',
children: [
{
path: 'choose-component',
component: ChooseImportComponentComponent
},
{
path: 'choose-unit',
component: ChooseImportUnitComponent
}
]
children: [{ path: 'choose-component', component: ChooseImportComponentComponent }]
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/teacher/authoring-tool.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { StudentTeacherCommonModule } from '../student-teacher-common.module';
import { RecoveryAuthoringComponent } from '../../assets/wise5/authoringTool/recovery-authoring/recovery-authoring.component';
import { AddLessonConfigureComponent } from '../../assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component';
import { ConcurrentAuthorsMessageComponent } from '../../assets/wise5/authoringTool/concurrent-authors-message/concurrent-authors-message.component';
import { ImportComponentModule } from '../../assets/wise5/authoringTool/importComponent/import-component-module';
import { NodeAdvancedAuthoringModule } from '../../assets/wise5/authoringTool/node/advanced/node-advanced-authoring.module';
import { NodeAuthoringComponent } from '../../assets/wise5/authoringTool/node/node-authoring/node-authoring.component';
import { TeacherNodeIconComponent } from '../../assets/wise5/authoringTool/teacher-node-icon/teacher-node-icon.component';
Expand Down Expand Up @@ -60,7 +61,6 @@ 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';

@NgModule({
declarations: [
Expand Down Expand Up @@ -93,7 +93,6 @@ import { ChooseImportComponentComponent } from '../../assets/wise5/authoringTool
AuthoringToolBarComponent,
ChooseAutomatedAssessmentComponent,
ChooseCopyNodeLocationComponent,
ChooseImportComponentComponent,
ChooseImportStepComponent,
ChooseImportUnitComponent,
ChooseNewNodeTemplateComponent,
Expand All @@ -109,6 +108,7 @@ import { ChooseImportComponentComponent } from '../../assets/wise5/authoringTool
MatBadgeModule,
MatChipsModule,
MatExpansionModule,
ImportComponentModule,
InsertNodeAfterButtonComponent,
InsertNodeInsideButtonComponent,
MainMenuComponent,
Expand Down
6 changes: 3 additions & 3 deletions src/app/teacher/component-authoring.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { GraphAuthoring } from '../../assets/wise5/components/graph/graph-author
import { EditHTMLAdvancedComponent } from '../../assets/wise5/components/html/edit-html-advanced/edit-html-advanced.component';
import { HtmlAuthoring } from '../../assets/wise5/components/html/html-authoring/html-authoring.component';
import { LabelAuthoring } from '../../assets/wise5/components/label/label-authoring/label-authoring.component';
import { MatchAuthoringComponent } from '../../assets/wise5/components/match/match-authoring/match-authoring.component';
import { MatchAuthoring } from '../../assets/wise5/components/match/match-authoring/match-authoring.component';
import { MultipleChoiceAuthoring } from '../../assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component';
import { OpenResponseAuthoringComponent } from '../../assets/wise5/components/openResponse/open-response-authoring/open-response-authoring.component';
import { EditOutsideUrlAdvancedComponent } from '../../assets/wise5/components/outsideURL/edit-outside-url-advanced/edit-outside-url-advanced.component';
Expand Down Expand Up @@ -158,6 +158,7 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no
GraphAuthoring,
HtmlAuthoring,
LabelAuthoring,
MatchAuthoring,
OutsideUrlAuthoring,
PeerChatAuthoringComponent,
ShowGroupWorkAuthoringComponent,
Expand All @@ -172,7 +173,6 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no
EditComponentConstraintsComponent,
EditComponentPrompt,
EditComponentWidthComponent,
MatchAuthoringComponent,
MultipleChoiceAuthoring,
OpenResponseAuthoringComponent,
PeerGroupingAuthoringModule,
Expand Down Expand Up @@ -244,7 +244,7 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no
GraphAuthoring,
HtmlAuthoring,
LabelAuthoring,
MatchAuthoringComponent,
MatchAuthoring,
MultipleChoiceAuthoring,
OpenResponseAuthoringComponent,
OutsideUrlAuthoring,
Expand Down
6 changes: 3 additions & 3 deletions src/app/teacher/component-show-work.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { AnimationShowWorkModule } from '../../assets/wise5/components/animation/animation-show-work/animation-show-work.module';
import { AudioOscillatorShowWorkModule } from '../../assets/wise5/components/audioOscillator/audio-oscillator-show-work/audio-oscillator-show-work.module';
import { ConceptMapShowWorkModule } from '../../assets/wise5/components/conceptMap/concept-map-show-work/concept-map-show-work.module';
import { DialogGuidanceShowWorkModule } from '../../assets/wise5/components/dialogGuidance/dialog-guidance-show-work/dialog-guidance-show-work.module';
import { DiscussionShowWorkModule } from '../../assets/wise5/components/discussion/discussion-show-work/discussion-show-work.module';
import { DrawShowWorkModule } from '../../assets/wise5/components/draw/draw-show-work/draw-show-work.module';
import { EmbeddedShowWorkModule } from '../../assets/wise5/components/embedded/embedded-show-work/embedded-show-work.module';
Expand All @@ -11,14 +12,13 @@ import { MatchShowWorkModule } from '../../assets/wise5/components/match/match-s
import { OpenResponseShowWorkModule } from '../../assets/wise5/components/openResponse/open-response-show-work/open-response-show-work.module';
import { TableShowWorkModule } from '../../assets/wise5/components/table/table-show-work/table-show-work.module';
import { MultipleChoiceShowWorkComponent } from '../../assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component';
import { DialogGuidanceShowWorkComponent } from '../../assets/wise5/components/dialogGuidance/dialog-guidance-show-work/dialog-guidance-show-work.component';

@NgModule({
imports: [
AnimationShowWorkModule,
AudioOscillatorShowWorkModule,
ConceptMapShowWorkModule,
DialogGuidanceShowWorkComponent,
DialogGuidanceShowWorkModule,
DiscussionShowWorkModule,
DrawShowWorkModule,
EmbeddedShowWorkModule,
Expand All @@ -33,7 +33,7 @@ import { DialogGuidanceShowWorkComponent } from '../../assets/wise5/components/d
AnimationShowWorkModule,
AudioOscillatorShowWorkModule,
ConceptMapShowWorkModule,
DialogGuidanceShowWorkComponent,
DialogGuidanceShowWorkModule,
DiscussionShowWorkModule,
DrawShowWorkModule,
EmbeddedShowWorkModule,
Expand Down
Loading