From 1053ac228a55d47d78a1d90a6547221b9da52a30 Mon Sep 17 00:00:00 2001 From: Simon Entholzer <33342534+SimonEntholzer@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:58:48 +0100 Subject: [PATCH] Integrated code lifecycle: Open repository for editors and instructors during assessment (#9898) --- ...code-editor-tutor-assessment-container.component.html | 8 +++++++- .../code-editor-tutor-assessment-container.component.ts | 9 +++++++-- src/main/webapp/app/utils/navigation.utils.ts | 8 ++++++++ 3 files changed, 22 insertions(+), 3 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 2945fec0662b..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,12 +98,18 @@ + @if (isAtLeastEditor && localVCEnabled && !isTestRun) { + + + + + } - @if (!localVCEnabled) { + @if (isAtLeastEditor && !localVCEnabled) { { // Get all files with content from template repository @@ -194,6 +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); 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 e9b9d61f2697..5dfe70b1f1da 100644 --- a/src/main/webapp/app/utils/navigation.utils.ts +++ b/src/main/webapp/app/utils/navigation.utils.ts @@ -152,6 +152,14 @@ 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): string[] => { + const suffix = ['programming-exercises', exerciseId.toString(), 'participations', participationId.toString(), 'repository']; + + return examId < 0 + ? ['/course-management', courseId.toString(), 'exams', examId.toString(), 'exercise-groups', exerciseGroupId.toString(), ...suffix] + : ['/course-management', courseId.toString(), ...suffix]; +}; + /** * A generic method which navigates into a subpage of an exam exercise * @router the router th component uses to navigate into different webpages