From b3110c18640b220f1ae442afb17b12abe2fbcfb1 Mon Sep 17 00:00:00 2001 From: entholzer Date: Thu, 28 Nov 2024 20:12:24 +0100 Subject: [PATCH] made link to button --- ...-tutor-assessment-container.component.html | 34 ++++++++----------- ...or-tutor-assessment-container.component.ts | 9 +---- src/main/webapp/app/utils/navigation.utils.ts | 7 ++-- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.html b/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.html index 70b7de7e4866..9382ac324adf 100644 --- a/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.html +++ b/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.html @@ -98,31 +98,25 @@ + @if (isAtLeastEditor && localVCEnabled && !isTestRun) { + + + + + } - @if (isAtLeastEditor) { - @if (!localVCEnabled) { - - } @else { - - - - } + @if (isAtLeastEditor && !localVCEnabled) { + } @if (participation) { diff --git a/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.ts b/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.ts index 166815bf56f3..d4100c9b0ca4 100644 --- a/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.ts +++ b/src/main/webapp/app/exercises/programming/assess/code-editor-tutor-assessment-container.component.ts @@ -198,14 +198,7 @@ export class CodeEditorTutorAssessmentContainerComponent implements OnInit, OnDe const observable = this.repositoryFileService.getFilesWithContent(); // Set back to student participation this.domainService.setDomain([DomainType.PARTICIPATION, this.participation]); - this.localRepositoryLink = getLocalRepositoryLink( - this.courseId, - this.exerciseId, - this.participation.id!, - this.exerciseGroupId, - this.examId, - this.isTestRun, - ); + this.localRepositoryLink = getLocalRepositoryLink(this.courseId, this.exerciseId, this.participation.id!, this.exerciseGroupId, this.examId); return observable; }), tap((templateFilesObj) => { diff --git a/src/main/webapp/app/utils/navigation.utils.ts b/src/main/webapp/app/utils/navigation.utils.ts index fb04033be8dc..5dfe70b1f1da 100644 --- a/src/main/webapp/app/utils/navigation.utils.ts +++ b/src/main/webapp/app/utils/navigation.utils.ts @@ -152,13 +152,10 @@ export const getExerciseDashboardLink = (courseId: number, exerciseId: number, e : ['/course-management', courseId.toString(), 'assessment-dashboard', exerciseId.toString()]; }; -export const getLocalRepositoryLink = (courseId: number, exerciseId: number, participationId: number, exerciseGroupId: number = 0, examId = 0, isTestRun = false): string[] => { - if (isTestRun) { - return ['/course-management', courseId.toString(), 'exams', examId.toString(), 'test-runs', 'assess']; - } +export const getLocalRepositoryLink = (courseId: number, exerciseId: number, participationId: number, exerciseGroupId: number = 0, examId = 0): string[] => { const suffix = ['programming-exercises', exerciseId.toString(), 'participations', participationId.toString(), 'repository']; - return examId > 0 + return examId < 0 ? ['/course-management', courseId.toString(), 'exams', examId.toString(), 'exercise-groups', exerciseGroupId.toString(), ...suffix] : ['/course-management', courseId.toString(), ...suffix]; };