diff --git a/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-detail.component.ts b/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-detail.component.ts
index 2cdbc0786876..abb0c24df3ba 100644
--- a/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-detail.component.ts
+++ b/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-detail.component.ts
@@ -97,7 +97,7 @@ export class FileUploadExerciseDetailComponent implements OnInit, OnDestroy {
const exercise = this.fileUploadExercise;
const generalSection = getExerciseGeneralDetailsSection(exercise);
const modeSection = getExerciseModeDetailSection(exercise);
- const problemSection = getExerciseProblemDetailSection(this.formattedProblemStatement);
+ const problemSection = getExerciseProblemDetailSection(this.formattedProblemStatement, this.fileUploadExercise);
const solutionSection = getExerciseMarkdownSolution(exercise, this.formattedExampleSolution);
const defaultGradingDetails = getExerciseGradingDefaultDetails(exercise);
const gradingInstructionsCriteriaDetails = getExerciseGradingInstructionsCriteriaDetails(exercise, this.formattedGradingInstructions);
diff --git a/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-update.component.html b/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-update.component.html
index 33e3911e0712..bcf54cf082ac 100644
--- a/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-update.component.html
+++ b/src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-update.component.html
@@ -49,6 +49,17 @@
+ @if (!isExamMode) {
+
+
+
+ }
Example Solution
@@ -207,17 +218,6 @@
- @if (!isExamMode) {
-
-
-
- }
diff --git a/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-detail.component.ts b/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-detail.component.ts
index 9ddf5c7f67ac..487d9213e763 100644
--- a/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-detail.component.ts
+++ b/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-detail.component.ts
@@ -102,7 +102,7 @@ export class ModelingExerciseDetailComponent implements OnInit, OnDestroy {
const exercise = this.modelingExercise;
const generalSection = getExerciseGeneralDetailsSection(exercise);
const modeSection = getExerciseModeDetailSection(exercise);
- const problemSection = getExerciseProblemDetailSection(this.problemStatement);
+ const problemSection = getExerciseProblemDetailSection(this.problemStatement, this.modelingExercise);
const defaultGradingDetails = getExerciseGradingDefaultDetails(exercise);
const gradingInstructionsCriteriaDetails = getExerciseGradingInstructionsCriteriaDetails(exercise, this.gradingInstructions);
return [
diff --git a/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.html b/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.html
index 77556b6aec9b..df1740509398 100644
--- a/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.html
+++ b/src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.html
@@ -43,6 +43,17 @@
+ @if (!isExamMode) {
+
+
+
+ }
Example Solution
@@ -259,17 +270,6 @@
Assessment Instructions
- @if (!isExamMode) {
-
-
-
- }
diff --git a/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts b/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts
index 3f1b28856ee0..1aed5ba37902 100644
--- a/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts
+++ b/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts
@@ -60,6 +60,7 @@ import { DetailOverviewSection, DetailType } from 'app/detail-overview-list/deta
import { IrisSettingsService } from 'app/iris/settings/shared/iris-settings.service';
import { IrisSubSettingsType } from 'app/entities/iris/settings/iris-sub-settings.model';
import { Detail } from 'app/detail-overview-list/detail.model';
+import { Competency } from 'app/entities/competency.model';
@Component({
selector: 'jhi-programming-exercise-detail',
@@ -79,6 +80,7 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
readonly documentationType: DocumentationType = 'Programming';
programmingExercise: ProgrammingExercise;
+ competencies: Competency[];
isExamExercise: boolean;
supportsAuxiliaryRepositories: boolean;
baseResource: string;
@@ -157,6 +159,7 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
this.activatedRoute.data.subscribe(({ programmingExercise }) => {
this.programmingExercise = programmingExercise;
+ this.competencies = programmingExercise.competencies;
const exerciseId = this.programmingExercise.id!;
this.isExamExercise = !!this.programmingExercise.exerciseGroup;
this.courseId = this.isExamExercise ? this.programmingExercise.exerciseGroup!.exam!.course!.id! : this.programmingExercise.course!.id!;
@@ -446,14 +449,26 @@ export class ProgrammingExerciseDetailComponent implements OnInit, OnDestroy {
}
getExerciseDetailsProblemSection(exercise: ProgrammingExercise): DetailOverviewSection {
+ const hasCompetencies = !!this.competencies?.length;
+ const details: Detail[] = [
+ {
+ title: hasCompetencies ? 'artemisApp.programmingExercise.wizardMode.detailedSteps.problemStepTitle' : undefined,
+ type: DetailType.ProgrammingProblemStatement,
+ data: { exercise: exercise },
+ },
+ ];
+
+ if (hasCompetencies) {
+ details.push({
+ title: 'artemisApp.competency.link.title',
+ type: DetailType.Text,
+ data: { text: this.competencies?.map((competency) => competency.title).join(', ') },
+ });
+ }
+
return {
headline: 'artemisApp.programmingExercise.wizardMode.detailedSteps.problemStepTitle',
- details: [
- {
- type: DetailType.ProgrammingProblemStatement,
- data: { exercise: exercise },
- },
- ],
+ details: details,
};
}
diff --git a/src/main/webapp/app/exercises/quiz/manage/quiz-exercise-detail.component.ts b/src/main/webapp/app/exercises/quiz/manage/quiz-exercise-detail.component.ts
index 98cdece8b2ff..207d394ce4a1 100644
--- a/src/main/webapp/app/exercises/quiz/manage/quiz-exercise-detail.component.ts
+++ b/src/main/webapp/app/exercises/quiz/manage/quiz-exercise-detail.component.ts
@@ -77,6 +77,14 @@ export class QuizExerciseDetailComponent implements OnInit {
const generalSection = getExerciseGeneralDetailsSection(exercise);
const modeSection = getExerciseModeDetailSection(exercise);
const defaultGradingDetails = getExerciseGradingDefaultDetails(exercise);
+
+ if (exercise.competencies?.length) {
+ modeSection.details.push({
+ title: 'artemisApp.competency.link.title',
+ type: DetailType.Text,
+ data: { text: exercise.competencies?.map((competency) => competency.title).join(', ') },
+ });
+ }
return [
generalSection,
{
diff --git a/src/main/webapp/app/exercises/shared/utils.ts b/src/main/webapp/app/exercises/shared/utils.ts
index 5ce3e37acee1..97afb199066a 100644
--- a/src/main/webapp/app/exercises/shared/utils.ts
+++ b/src/main/webapp/app/exercises/shared/utils.ts
@@ -62,15 +62,26 @@ export function getExerciseModeDetailSection(exercise: Exercise): DetailOverview
};
}
-export function getExerciseProblemDetailSection(formattedProblemStatement: SafeHtml | null): DetailOverviewSection {
+export function getExerciseProblemDetailSection(formattedProblemStatement: SafeHtml | null, exercise: Exercise): DetailOverviewSection {
+ const hasCompetencies = !!exercise.competencies?.length;
+ const details: Detail[] = [
+ {
+ title: hasCompetencies ? 'artemisApp.exercise.sections.problem' : undefined,
+ type: DetailType.Markdown,
+ data: { innerHtml: formattedProblemStatement },
+ },
+ ];
+
+ if (hasCompetencies) {
+ details.push({
+ title: 'artemisApp.competency.link.title',
+ type: DetailType.Text,
+ data: { text: exercise.competencies?.map((competency) => competency.title).join(', ') },
+ });
+ }
return {
headline: 'artemisApp.exercise.sections.problem',
- details: [
- {
- type: DetailType.Markdown,
- data: { innerHtml: formattedProblemStatement },
- },
- ],
+ details: details,
};
}
diff --git a/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-detail.component.ts b/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-detail.component.ts
index 202038593ce9..8114d0fd8e20 100644
--- a/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-detail.component.ts
+++ b/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-detail.component.ts
@@ -92,7 +92,7 @@ export class TextExerciseDetailComponent implements OnInit, OnDestroy {
const exercise = this.textExercise;
const generalSection = getExerciseGeneralDetailsSection(exercise);
const modeSection = getExerciseModeDetailSection(exercise);
- const problemSection = getExerciseProblemDetailSection(this.formattedProblemStatement);
+ const problemSection = getExerciseProblemDetailSection(this.formattedProblemStatement, this.textExercise);
const solutionSection = getExerciseMarkdownSolution(exercise, this.formattedExampleSolution);
const defaultGradingDetails = getExerciseGradingDefaultDetails(exercise);
const gradingInstructionsCriteriaDetails = getExerciseGradingInstructionsCriteriaDetails(exercise, this.formattedGradingInstructions);
diff --git a/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-update.component.html b/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-update.component.html
index 78a026f47db9..3608574f43eb 100644
--- a/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-update.component.html
+++ b/src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-update.component.html
@@ -44,6 +44,17 @@
+ @if (!isExamMode) {
+
+
+
+ }
Example Solution