From b47e0c13c0c0fa8207a2f149063294224e1cf485 Mon Sep 17 00:00:00 2001 From: entholzer Date: Thu, 24 Oct 2024 13:33:38 +0200 Subject: [PATCH 1/6] initial commit --- ...-editor-instructor-and-editor-container.component.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html index 473ffcef7626..1584f7947622 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html @@ -79,6 +79,14 @@ [style.background-color]="selectedRepository === REPOSITORY.TEST ? '#3e8acc' : 'transparent'" jhiTranslate="artemisApp.editor.repoSelect.testRepo" > + From 302158408a96977765f0abf0cd675f34886745d9 Mon Sep 17 00:00:00 2001 From: entholzer Date: Thu, 24 Oct 2024 19:20:08 +0200 Subject: [PATCH 2/6] fix css --- ...ructor-and-editor-container.component.html | 22 ++++++++++++------- ...structor-and-editor-container.component.ts | 1 + ...ditor-instructor-and-editor-container.scss | 3 +++ ...tor-instructor-base-container.component.ts | 7 ++++++ 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.scss diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html index 1584f7947622..aba0c523bb19 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html @@ -36,6 +36,7 @@ [solutionParticipation]="exercise?.solutionParticipation!" /> + {{ 'RED ' }}
@@ -79,14 +80,19 @@ [style.background-color]="selectedRepository === REPOSITORY.TEST ? '#3e8acc' : 'transparent'" jhiTranslate="artemisApp.editor.repoSelect.testRepo" > - + @for (auxiliaryRepository of exercise.auxiliaryRepositories; track exercise.auxiliaryRepositories; let i = $index) { + {{ auxiliaryRepository }} + @if (auxiliaryRepository.id) { + + } + }
diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.ts b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.ts index 435accfdab30..f7fd38dc5515 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.ts +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.ts @@ -17,6 +17,7 @@ import { IrisSettings } from 'app/entities/iris/settings/iris-settings.model'; @Component({ selector: 'jhi-code-editor-instructor', templateUrl: './code-editor-instructor-and-editor-container.component.html', + styleUrl: 'code-editor-instructor-and-editor-container.scss', }) export class CodeEditorInstructorAndEditorContainerComponent extends CodeEditorInstructorBaseContainerComponent { @ViewChild(UpdatingResultComponent, { static: false }) resultComp: UpdatingResultComponent; diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.scss b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.scss new file mode 100644 index 000000000000..d62ab3099024 --- /dev/null +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.scss @@ -0,0 +1,3 @@ +.btn-outline-primary:not(.list-group-item).dropdown-toggle.show { + color: var(--default-btn-font); +} diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts index e53bf800e1a9..333ed7b33d82 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts @@ -296,6 +296,13 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn this.router.navigate(['..', 'test'], { relativeTo: this.route }); } + /** + * Select the test repository and navigate to it + */ + selectAuxiliaryRepository(repositoryId: number) { + this.router.navigate(['..', 'auxiliary', repositoryId], { relativeTo: this.route }); + } + /** * Creates an assignment participation for this user for this exercise. */ From a18bae2247ee51ba57aedff42dc496b30c647586 Mon Sep 17 00:00:00 2001 From: entholzer Date: Thu, 24 Oct 2024 21:11:17 +0200 Subject: [PATCH 3/6] enable aux repo access --- .../ProgrammingExerciseRepository.java | 2 ++ ...ructor-and-editor-container.component.html | 10 +++--- ...tor-instructor-base-container.component.ts | 32 +++++++++++++++---- .../code-editor-management-routing.module.ts | 12 +++++++ 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java index 5f2bb062c2ec..40ccb3cf4c34 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java @@ -776,8 +776,10 @@ default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationLatestRe programmingExerciseId); ProgrammingExercise programmingExerciseWithSolution = getValueElseThrow(findWithSolutionParticipationLatestResultFeedbackTestCasesById(programmingExerciseId), programmingExerciseId); + ProgrammingExercise programmingExerciseWithAuxiliaryRepositories = findByIdWithAuxiliaryRepositoriesElseThrow(programmingExerciseId); programmingExerciseWithTemplate.setSolutionParticipation(programmingExerciseWithSolution.getSolutionParticipation()); + programmingExerciseWithTemplate.setAuxiliaryRepositories(programmingExerciseWithAuxiliaryRepositories.getAuxiliaryRepositories()); return programmingExerciseWithTemplate; } diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html index aba0c523bb19..5dca6415610d 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html @@ -36,9 +36,10 @@ [solutionParticipation]="exercise?.solutionParticipation!" /> - {{ 'RED ' }}
- +
@for (auxiliaryRepository of exercise.auxiliaryRepositories; track exercise.auxiliaryRepositories; let i = $index) { - {{ auxiliaryRepository }} @if (auxiliaryRepository.id) { diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts index 333ed7b33d82..2ffa2c66f614 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts @@ -28,6 +28,7 @@ export enum REPOSITORY { TEMPLATE = 'TEMPLATE', SOLUTION = 'SOLUTION', TEST = 'TEST', + AUXILIARY = 'AUXILIARY', } /** @@ -64,6 +65,8 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn // Stores which repository is selected atm. // Needs to be set additionally to selectedParticipation as the test repository does not have a participation selectedRepository: REPOSITORY; + selectedRepositoryId: number; + selectedAuxiliaryRepositoryName?: string; // Fires when the selected domain changes. // This can either be a participation (solution, template, assignment) or the test repository. @@ -95,6 +98,7 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn this.paramSub = this.route!.params.subscribe((params) => { const exerciseId = Number(params['exerciseId']); const participationId = Number(params['participationId']); + const repositoryId = Number(params['repositoryId']); this.loadingState = LOADING_STATE.INITIALIZING; this.loadExercise(exerciseId) .pipe( @@ -107,6 +111,12 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn tap(() => { if (this.router.url.endsWith('/test')) { this.saveChangesAndSelectDomain([DomainType.TEST_REPOSITORY, this.exercise]); + } else if (this.router.url.indexOf('auxiliary') >= 0) { + const auxiliaryRepo = this.exercise.auxiliaryRepositories?.find((repo) => repo.id === repositoryId); + if (auxiliaryRepo) { + this.selectedAuxiliaryRepositoryName = auxiliaryRepo.name; + this.saveChangesAndSelectDomain([DomainType.AUXILIARY_REPOSITORY, auxiliaryRepo]); + } } else { const nextAvailableParticipation = this.getNextAvailableParticipation(participationId); if (nextAvailableParticipation) { @@ -190,7 +200,10 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn if (this.codeEditorContainer != undefined) { this.codeEditorContainer.initializeProperties(); } - if (domainType === DomainType.PARTICIPATION) { + if (domainType === DomainType.AUXILIARY_REPOSITORY) { + this.selectedRepository = REPOSITORY.AUXILIARY; + this.selectedRepositoryId = domainValue.id; + } else if (domainType === DomainType.PARTICIPATION) { this.setSelectedParticipation(domainValue.id); } else { this.selectedParticipation = this.exercise.templateParticipation!; @@ -272,35 +285,42 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn * Select the template participation repository and navigate to it */ selectTemplateParticipation() { - this.router.navigate(['..', this.exercise.templateParticipation!.id], { relativeTo: this.route }); + this.router.navigate([this.up(), this.exercise.templateParticipation!.id], { relativeTo: this.route }); } /** * Select the solution participation repository and navigate to it */ selectSolutionParticipation() { - this.router.navigate(['..', this.exercise.solutionParticipation!.id], { relativeTo: this.route }); + this.router.navigate([this.up(), this.exercise.solutionParticipation!.id], { relativeTo: this.route }); } /** * Select the assignment participation repository and navigate to it */ selectAssignmentParticipation() { - this.router.navigate(['..', this.exercise.studentParticipations![0].id], { relativeTo: this.route }); + this.router.navigate([this.up(), this.exercise.studentParticipations![0].id], { relativeTo: this.route }); } /** * Select the test repository and navigate to it */ selectTestRepository() { - this.router.navigate(['..', 'test'], { relativeTo: this.route }); + this.router.navigate([this.up(), 'test'], { relativeTo: this.route }); } /** * Select the test repository and navigate to it */ selectAuxiliaryRepository(repositoryId: number) { - this.router.navigate(['..', 'auxiliary', repositoryId], { relativeTo: this.route }); + this.router.navigate([this.up(), 'auxiliary', repositoryId], { relativeTo: this.route }); + } + + /** + * Go two folders up if the current view is an auxiliary repository, and one otherwise + */ + up() { + return this.selectedRepository === REPOSITORY.AUXILIARY ? '../..' : '..'; } /** diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-management-routing.module.ts b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-management-routing.module.ts index 26f1f6e85ba3..0307f567a816 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-management-routing.module.ts +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-management-routing.module.ts @@ -54,6 +54,18 @@ const routes: Routes = [ }, canActivate: [UserRouteAccessService], }, + { + path: 'auxiliary/:repositoryId', + component: CodeEditorInstructorAndEditorContainerComponent, + data: { + authorities: [Authority.EDITOR, Authority.INSTRUCTOR, Authority.ADMIN], + pageTitle: 'artemisApp.editor.home.title', + flushRepositoryCacheAfter: 900000, // 15 min + participationCache: {}, + repositoryCache: {}, + }, + canActivate: [UserRouteAccessService], + }, ]; @NgModule({ From 42ad8a333ff2c50c51b9402a6953ead899dc9e35 Mon Sep 17 00:00:00 2001 From: Simon Entholzer <33342534+SimonEntholzer@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:45:58 +0200 Subject: [PATCH 4/6] Update src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../code-editor-instructor-base-container.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts index 2ffa2c66f614..0b6e1efd5d89 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-base-container.component.ts @@ -310,7 +310,7 @@ export abstract class CodeEditorInstructorBaseContainerComponent implements OnIn } /** - * Select the test repository and navigate to it + * Select the auxiliary repository and navigate to it */ selectAuxiliaryRepository(repositoryId: number) { this.router.navigate([this.up(), 'auxiliary', repositoryId], { relativeTo: this.route }); From a0ad0068db8926bb197055d554c514d0481c0a36 Mon Sep 17 00:00:00 2001 From: entholzer Date: Fri, 25 Oct 2024 18:08:21 +0200 Subject: [PATCH 5/6] refactored filename --- .../ProgrammingExerciseRepository.java | 3 ++- .../web/ProgrammingExerciseResource.java | 2 +- ...ProgrammingExerciseGitIntegrationTest.java | 4 ++-- ...ProgrammingExerciseGradingServiceTest.java | 24 ++++++++++++------- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java index 40ccb3cf4c34..30a78e0339a3 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java @@ -770,7 +770,8 @@ default ProgrammingExercise saveForCreation(ProgrammingExercise exercise) { * @throws EntityNotFoundException the programming exercise could not be found. */ @NotNull - default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(long programmingExerciseId) throws EntityNotFoundException { + default ProgrammingExercise findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(long programmingExerciseId) + throws EntityNotFoundException { // TODO: This is a dark hack. Move this into a service where we properly load only the solution participation in the second step ProgrammingExercise programmingExerciseWithTemplate = getValueElseThrow(findWithTemplateParticipationLatestResultFeedbackTestCasesById(programmingExerciseId), programmingExerciseId); diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java b/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java index 957f7435ce0d..dbc82173e534 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java @@ -506,7 +506,7 @@ public ResponseEntity getProgrammingExercise(@PathVariable public ResponseEntity getProgrammingExerciseWithSetupParticipations(@PathVariable long exerciseId) { log.debug("REST request to get ProgrammingExercise with setup participations : {}", exerciseId); User user = userRepository.getUserWithGroupsAndAuthorities(); - var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(exerciseId); + var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(exerciseId); authCheckService.checkHasAtLeastRoleForExerciseElseThrow(Role.EDITOR, programmingExercise, user); var assignmentParticipation = studentParticipationRepository.findByExerciseIdAndStudentIdAndTestRunWithLatestResult(programmingExercise.getId(), user.getId(), false); Set participations = new HashSet<>(); diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGitIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGitIntegrationTest.java index 5882a3517915..e743904e72f6 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGitIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGitIntegrationTest.java @@ -113,8 +113,8 @@ void testRepositoryMethods() { assertThatExceptionOfType(EntityNotFoundException.class) .isThrownBy(() -> programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationElseThrow(Long.MAX_VALUE)); - assertThatExceptionOfType(EntityNotFoundException.class) - .isThrownBy(() -> programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(Long.MAX_VALUE)); + assertThatExceptionOfType(EntityNotFoundException.class).isThrownBy( + () -> programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(Long.MAX_VALUE)); assertThatExceptionOfType(EntityNotFoundException.class) .isThrownBy(() -> programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationTeamAssignmentConfigCategoriesElseThrow(Long.MAX_VALUE)); diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGradingServiceTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGradingServiceTest.java index 2993b02caccb..6b4c43477276 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGradingServiceTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseGradingServiceTest.java @@ -551,7 +551,8 @@ void shouldReEvaluateScoreOfTheCorrectResults() throws Exception { programmingExercise = (ProgrammingExercise) exerciseUtilService.addMaxScoreAndBonusPointsToExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addTemplateParticipationForProgrammingExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addSolutionParticipationForProgrammingExercise(programmingExercise); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); var testCases = createTestCases(false); var testParticipations = createTestParticipations(); @@ -566,7 +567,8 @@ void shouldReEvaluateScoreOfTheCorrectResults() throws Exception { SecurityContextHolder.setContext(TestSecurityContextHolder.getContext()); // Tests - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); // template 0 % { @@ -610,7 +612,8 @@ void shouldNotIncludeTestsMarkedAsNeverVisibleInScoreCalculation(boolean isAfter programmingExercise = (ProgrammingExercise) exerciseUtilService.addMaxScoreAndBonusPointsToExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addTemplateParticipationForProgrammingExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addSolutionParticipationForProgrammingExercise(programmingExercise); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); final var testCases = createTestCases(true); final var testParticipations = createTestParticipations(); @@ -625,7 +628,8 @@ void shouldNotIncludeTestsMarkedAsNeverVisibleInScoreCalculation(boolean isAfter SecurityContextHolder.setContext(TestSecurityContextHolder.getContext()); // Tests - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); // the invisible test case should however be visible for the template and solution repos @@ -658,7 +662,8 @@ void shouldUpdateTheLatestResultOfASingleParticipation() { programmingExercise = (ProgrammingExercise) exerciseUtilService.addMaxScoreAndBonusPointsToExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addTemplateParticipationForProgrammingExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addSolutionParticipationForProgrammingExercise(programmingExercise); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); final var testCases = createTestCases(false); final var testParticipations = createTestParticipations(); @@ -679,7 +684,8 @@ void shouldUpdateOnlyResultsForParticipationsWithoutIndividualDueDate() { programmingExercise = (ProgrammingExercise) exerciseUtilService.addMaxScoreAndBonusPointsToExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addTemplateParticipationForProgrammingExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addSolutionParticipationForProgrammingExercise(programmingExercise); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); final var testCases = createTestCases(false); final var testParticipations = createTestParticipations(); @@ -690,7 +696,8 @@ void shouldUpdateOnlyResultsForParticipationsWithoutIndividualDueDate() { participationWithIndividualDueDate = studentParticipationRepository.save((StudentParticipation) participationWithIndividualDueDate); final Long participationWithIndividualDueDateId = participationWithIndividualDueDate.getId(); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); final var updated = programmingExerciseGradingService.updateResultsOnlyRegularDueDateParticipations(programmingExercise); // four student results + template + solution @@ -706,7 +713,8 @@ void testWeightSumZero() { programmingExercise = (ProgrammingExercise) exerciseUtilService.addMaxScoreAndBonusPointsToExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addTemplateParticipationForProgrammingExercise(programmingExercise); programmingExercise = programmingExerciseUtilService.addSolutionParticipationForProgrammingExercise(programmingExercise); - programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); + programmingExercise = programmingExerciseRepository + .findByIdWithTemplateAndSolutionParticipationAndAuxiliaryReposAndLatestResultFeedbackTestCasesElseThrow(programmingExercise.getId()); final var testCases = createTestCases(false); createTestParticipations(); From 365fe3facef7a1160eb865a3b1f1f54dbc6075d8 Mon Sep 17 00:00:00 2001 From: entholzer Date: Fri, 25 Oct 2024 18:15:18 +0200 Subject: [PATCH 6/6] replace hard coded colors --- ...-editor-instructor-and-editor-container.component.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html index 5dca6415610d..30ee80b5e22f 100644 --- a/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html +++ b/src/main/webapp/app/exercises/programming/manage/code-editor/code-editor-instructor-and-editor-container.component.html @@ -53,7 +53,7 @@ [disabled]="!exercise || !exercise.solutionParticipation || !exercise.solutionParticipation.id || !exercise.solutionParticipation.repositoryUri" (click)="selectSolutionParticipation()" ngbDropdownItem - [style.background-color]="selectedRepository === REPOSITORY.SOLUTION ? '#3e8acc' : 'transparent'" + [style.background-color]="selectedRepository === REPOSITORY.SOLUTION ? 'var(--link-color)' : 'transparent'" jhiTranslate="artemisApp.editor.repoSelect.solutionRepo" > @@ -69,7 +69,7 @@ " (click)="selectAssignmentParticipation()" ngbDropdownItem - [style.background-color]="selectedRepository === REPOSITORY.ASSIGNMENT ? '#3e8acc' : 'transparent'" + [style.background-color]="selectedRepository === REPOSITORY.ASSIGNMENT ? 'var(--link-color)' : 'transparent'" jhiTranslate="artemisApp.editor.repoSelect.assignmentRepo" > Assignment Participation @@ -78,7 +78,7 @@ [disabled]="!exercise" (click)="selectTestRepository()" ngbDropdownItem - [style.background-color]="selectedRepository === REPOSITORY.TEST ? '#3e8acc' : 'transparent'" + [style.background-color]="selectedRepository === REPOSITORY.TEST ? 'var(--link-color)' : 'transparent'" jhiTranslate="artemisApp.editor.repoSelect.testRepo" > @for (auxiliaryRepository of exercise.auxiliaryRepositories; track exercise.auxiliaryRepositories; let i = $index) { @@ -88,7 +88,7 @@ (click)="selectAuxiliaryRepository(auxiliaryRepository.id)" ngbDropdownItem [style.background-color]=" - selectedRepository === REPOSITORY.AUXILIARY && selectedRepositoryId === auxiliaryRepository.id ? '#3e8acc' : 'transparent' + selectedRepository === REPOSITORY.AUXILIARY && selectedRepositoryId === auxiliaryRepository.id ? 'var(--link-color)' : 'transparent' " > {{ auxiliaryRepository.name }}