Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive learning: Fix import all competencies with relations #9713

Merged
merged 4 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Expand Up @@ -22,6 +22,7 @@ import { ArtemisMarkdownModule } from 'app/shared/markdown.module';
export class CompetencyManagementTableComponent implements OnInit, OnDestroy {
@Input() courseId: number;
@Input() courseCompetencies: CourseCompetency[];
@Input() allCompetencies: CourseCompetency[];
@Input() competencyType: CourseCompetencyType;
@Input() standardizedCompetenciesEnabled: boolean;

Expand Down Expand Up @@ -95,6 +96,7 @@ export class CompetencyManagementTableComponent implements OnInit, OnDestroy {
updateDataAfterImportAll(res: Array<CompetencyWithTailRelationDTO>) {
const importedCompetencies = res.map((dto) => dto.competency).filter((element): element is CourseCompetency => !!element);
this.courseCompetencies.push(...importedCompetencies);
this.allCompetencies.push(...importedCompetencies);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ <h2 class="m-0" jhiTranslate="artemisApp.competency.manage.title"></h2>
[courseId]="courseId"
[courseCompetencies]="competencies"
[competencyType]="CourseCompetencyType.COMPETENCY"
[allCompetencies]="courseCompetencies"
[standardizedCompetenciesEnabled]="standardizedCompetenciesEnabled"
(competencyDeleted)="onRemoveCompetency($event)"
/>
<jhi-competency-management-table
[courseId]="courseId"
[courseCompetencies]="prerequisites"
[competencyType]="CourseCompetencyType.PREREQUISITE"
[allCompetencies]="courseCompetencies"
[standardizedCompetenciesEnabled]="standardizedCompetenciesEnabled"
(competencyDeleted)="onRemoveCompetency($event)"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class CompetencyService extends CourseCompetencyService {

importAll(courseId: number, sourceCourseId: number, importRelations: boolean) {
return this.httpClient.post<Array<CompetencyWithTailRelationDTO>>(
`${this.resourceURL}/courses/${courseId}/competencies/import-all/${sourceCourseId}`,
`${this.resourceURL}/courses/${courseId}/competencies/import-all`,
{
importExercises: false,
importRelations: importRelations,
Expand Down
Loading