Skip to content

Commit

Permalink
Merge branch 'develop' into feature/programming-exercises/go-template
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp authored Dec 19, 2024
2 parents a7585f7 + 0d0a9e9 commit 64141f9
Show file tree
Hide file tree
Showing 37 changed files with 565 additions and 315 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/testserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ jobs:
folder: /opt/artemis
host_keys: |
#- environment: artemis-test7.artemis.cit.tum.de
# label-identifier: artemis-test7
# url: https://artemis-test7.artemis.cit.tum.de
# user: deployment
# hosts: artemis-test7.artemis.cit.tum.de
# folder: /opt/artemis
- environment: artemis-test7.artemis.cit.tum.de
label-identifier: artemis-test7
url: https://artemis-test7.artemis.cit.tum.de
user: deployment
hosts: artemis-test7.artemis.cit.tum.de
folder: /opt/artemis
host_keys: |
#- environment: artemis-test8.artemis.cit.tum.de
# label-identifier: artemis-test8
Expand Down
15 changes: 11 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
id "idea"
id "jacoco"
id "org.springframework.boot" version "${spring_boot_version}"
id "io.spring.dependency-management" version "1.1.6"
id "io.spring.dependency-management" version "1.1.7"
id "com.google.cloud.tools.jib" version "3.4.4"
id "com.github.node-gradle.node" version "${gradle_node_plugin_version}"
id "com.diffplug.spotless" version "6.25.0"
Expand Down Expand Up @@ -385,6 +385,13 @@ dependencies {
exclude module: "spring-boot-starter-undertow"
}
implementation "org.springframework.boot:spring-boot-starter-tomcat:${spring_boot_version}"

// Avoid security issues in Tomcat 10.1.33
implementation "org.apache.tomcat.embed:tomcat-embed-core:${tomcat_version}"
implementation "org.apache.tomcat.embed:tomcat-embed-el:${tomcat_version}"
implementation "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcat_version}"
implementation "org.apache.tomcat:tomcat-annotations-api:${tomcat_version}"

implementation "org.springframework.boot:spring-boot-starter-websocket:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server:${spring_boot_version}"
Expand All @@ -401,7 +408,7 @@ dependencies {
implementation "org.springframework.cloud:spring-cloud-starter-config:${spring_cloud_version}"
implementation "org.springframework.cloud:spring-cloud-commons:${spring_cloud_version}"

implementation "io.netty:netty-all:4.1.115.Final"
implementation "io.netty:netty-all:4.1.116.Final"
implementation "io.projectreactor.netty:reactor-netty:1.2.1"
implementation "org.springframework:spring-messaging:${spring_framework_version}"
implementation "org.springframework.retry:spring-retry:2.0.11"
Expand Down Expand Up @@ -452,7 +459,7 @@ dependencies {
implementation "org.apfloat:apfloat:1.14.0"

// use newest version of guava to avoid security issues through outdated dependencies
implementation "com.google.guava:guava:33.3.1-jre"
implementation "com.google.guava:guava:33.4.0-jre"
implementation "com.sun.activation:jakarta.activation:2.0.1"

// use newest version of gson to avoid security issues through outdated dependencies
Expand Down Expand Up @@ -608,7 +615,7 @@ tasks.withType(Test).configureEach {
}

wrapper {
gradleVersion = "8.12-rc-1"
gradleVersion = "8.12-rc-2"
}

tasks.register("stage") {
Expand Down
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jhipster_dependencies_version=8.7.2
spring_boot_version=3.4.0
spring_framework_version=6.2.1
spring_cloud_version=4.2.0
spring_security_version=6.4.1
spring_security_version=6.4.2
# TODO: upgrading to 6.6.x currently leads to issues due to internal changes in Hibernate and potentially wrong use in Artemis server code
hibernate_version=6.4.10.Final
# TODO: can we update to 5.x?
Expand All @@ -19,7 +19,8 @@ jwt_version=0.12.6
jaxb_runtime_version=4.0.5
hazelcast_version=5.5.0
fasterxml_version=2.18.2
jgit_version=7.1.0.202411261347-r
# TODO: 7.1.0 includes bugs related to git diffs, therefore we cannot update
jgit_version=7.0.0.202409031743-r
sshd_version=2.14.0
checkstyle_version=10.21.0
jplag_version=5.1.0
Expand All @@ -32,13 +33,14 @@ liquibase_version=4.30.0
docker_java_version=3.4.1
logback_version=1.5.12
java_parser_version=3.26.2
byte_buddy_version=1.15.10
byte_buddy_version=1.15.11
netty_version=4.1.115.Final
tomcat_version=10.1.34

# testing
# make sure both versions are compatible
junit_version=5.11.3
junit_platform_version=1.11.3
junit_platform_version=1.11.4
mockito_version=5.14.2
testcontainer_version=1.20.4

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-rc-2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ <h3>
<jhi-documentation-button [type]="documentationType" />
</div>
<div class="col text-end align-self-center">
@if (showBackToWizardModeButton) {
<button type="button" id="back-to-wizard" class="btn btn-secondary" (click)="goBackToWizardMode()">
<fa-icon [icon]="faHandshakeAngle" />&nbsp;{{ 'artemisApp.lecture.wizardMode.backToWizard' | artemisTranslate }}
</button>
}
<button id="toggleSearchButton" class="btn btn-primary" type="button" (click)="toggleSearch()">
{{ 'artemisApp.course.exercise.search.toggleButton.' + showSearch | artemisTranslate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Component, ContentChild, OnInit, TemplateRef } from '@angular/core';
import { Component, ContentChild, OnInit, TemplateRef, inject } from '@angular/core';
import { Course } from 'app/entities/course.model';
import { CourseManagementService } from './course-management.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { ExerciseFilter } from 'app/entities/exercise-filter.model';
import { DocumentationType } from 'app/shared/components/documentation-button/documentation-button.component';
import { faHandshakeAngle } from '@fortawesome/free-solid-svg-icons';
import { ExerciseType } from 'app/entities/exercise.model';

@Component({
Expand All @@ -28,22 +26,13 @@ export class CourseManagementExercisesComponent implements OnInit {
filteredModelingExercisesCount = 0;
filteredFileUploadExercisesCount = 0;
exerciseFilter: ExerciseFilter;
showBackToWizardModeButton = false;
lectureIdForGoingBack: number;
lectureWizardStepForGoingBack: number;

faHandshakeAngle = faHandshakeAngle;

// extension points, see shared/extension-point
@ContentChild('overrideGenerateAndImportButton') overrideGenerateAndImportButton: TemplateRef<any>;
@ContentChild('overrideProgrammingExerciseCard') overrideProgrammingExerciseCard: TemplateRef<any>;
@ContentChild('overrideNonProgrammingExerciseCard') overrideNonProgrammingExerciseCard: TemplateRef<any>;

constructor(
private courseService: CourseManagementService,
private router: Router,
private route: ActivatedRoute,
) {}
private readonly route = inject(ActivatedRoute);

/**
* initializes course
Expand All @@ -55,12 +44,6 @@ export class CourseManagementExercisesComponent implements OnInit {
}
});

this.route.queryParams.subscribe((params) => {
this.showBackToWizardModeButton = params.shouldHaveBackButtonToWizard;
this.lectureIdForGoingBack = params.lectureId;
this.lectureWizardStepForGoingBack = params.step;
});

this.exerciseFilter = new ExerciseFilter('');
}

Expand Down Expand Up @@ -104,11 +87,4 @@ export class CourseManagementExercisesComponent implements OnInit {
shouldHideExerciseCard(type: string): boolean {
return !['all', type].includes(this.exerciseFilter.exerciseTypeSearch);
}

goBackToWizardMode() {
this.router.navigate(['/course-management', this.course.id, 'lectures', this.lectureIdForGoingBack, 'edit'], {
queryParams: { shouldBeInWizardMode: 'true', shouldOpenCreateExercise: 'true', step: this.lectureWizardStepForGoingBack },
queryParamsHandling: '',
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { FormulaAction } from 'app/shared/monaco-editor/model/actions/formula.ac
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileUploadExerciseUpdateComponent implements AfterViewInit, OnDestroy, OnInit {
protected readonly faQuestionCircle = faQuestionCircle;

readonly IncludedInOverallScore = IncludedInOverallScore;
readonly documentationType: DocumentationType = 'FileUpload';

Expand All @@ -50,7 +52,6 @@ export class FileUploadExerciseUpdateComponent implements AfterViewInit, OnDestr
fileUploadExercise: FileUploadExercise;
backupExercise: FileUploadExercise;
isSaving: boolean;
goBackAfterSaving = false;
exerciseCategories: ExerciseCategory[];
existingCategories: ExerciseCategory[];
notificationText?: string;
Expand All @@ -59,19 +60,14 @@ export class FileUploadExerciseUpdateComponent implements AfterViewInit, OnDestr
isImport: boolean;
examCourseId?: number;

saveCommand: SaveExerciseCommand<FileUploadExercise>;

formStatusSections: FormSectionStatus[];

// Subcriptions
// Subscriptions
titleChannelNameComponentSubscription?: Subscription;
pointsSubscription?: Subscription;
bonusPointsSubscription?: Subscription;
teamSubscription?: Subscription;

// Icons
faQuestionCircle = faQuestionCircle;

constructor(
private fileUploadExerciseService: FileUploadExerciseService,
private modalService: NgbModal,
Expand Down Expand Up @@ -104,11 +100,6 @@ export class FileUploadExerciseUpdateComponent implements AfterViewInit, OnDestr
this.examCourseId = getCourseId(fileUploadExercise);
});

this.activatedRoute.queryParams.subscribe((params) => {
if (params.shouldHaveBackButtonToWizard) {
this.goBackAfterSaving = true;
}
});
this.activatedRoute.url
.pipe(
tap(
Expand Down Expand Up @@ -264,12 +255,6 @@ export class FileUploadExerciseUpdateComponent implements AfterViewInit, OnDestr
private onSaveSuccess(exercise: Exercise) {
this.isSaving = false;

if (this.goBackAfterSaving) {
this.navigationUtilService.navigateBack();

return;
}

this.navigationUtilService.navigateForwardFromExerciseUpdateOrCreation(exercise);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
import { ModelingExercise } from 'app/entities/modeling-exercise.model';
import { ModelingExerciseService } from './modeling-exercise.service';
Expand Down Expand Up @@ -70,7 +70,6 @@ export class ModelingExerciseUpdateComponent implements AfterViewInit, OnDestroy
isImport: boolean;
isExamMode: boolean;
semiAutomaticAssessmentAvailable = true;
goBackAfterSaving = false;

formSectionStatus: FormSectionStatus[];

Expand All @@ -91,7 +90,6 @@ export class ModelingExerciseUpdateComponent implements AfterViewInit, OnDestroy
private exerciseGroupService: ExerciseGroupService,
private eventManager: EventManager,
private activatedRoute: ActivatedRoute,
private router: Router,
private navigationUtilService: ArtemisNavigationUtilService,
private changeDetectorRef: ChangeDetectorRef,
) {}
Expand Down Expand Up @@ -186,12 +184,6 @@ export class ModelingExerciseUpdateComponent implements AfterViewInit, OnDestroy
)
.subscribe();

this.activatedRoute.queryParams.subscribe((params) => {
if (params.shouldHaveBackButtonToWizard) {
this.goBackAfterSaving = true;
}
});

this.isSaving = false;
this.notificationText = undefined;
}
Expand Down Expand Up @@ -292,12 +284,6 @@ export class ModelingExerciseUpdateComponent implements AfterViewInit, OnDestroy
this.eventManager.broadcast({ name: 'modelingExerciseListModification', content: 'OK' });
this.isSaving = false;

if (this.goBackAfterSaving) {
this.navigationUtilService.navigateBack();

return;
}

this.navigationUtilService.navigateForwardFromExerciseUpdateOrCreation(exercise);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class QuizExerciseUpdateComponent extends QuizExerciseValidationDirective
notificationText?: string;

isImport = false;
goBackAfterSaving = false;

/** Constants for 'Add existing questions' and 'Import file' features **/
showExistingQuestions = false;
Expand Down Expand Up @@ -149,12 +148,6 @@ export class QuizExerciseUpdateComponent extends QuizExerciseValidationDirective
this.isImport = true;
}

this.route.queryParams.subscribe((params) => {
if (params.shouldHaveBackButtonToWizard) {
this.goBackAfterSaving = true;
}
});

/** Query the courseService for the participationId given by the params */
if (this.courseId) {
this.courseService.find(this.courseId).subscribe((response: HttpResponse<Course>) => {
Expand Down Expand Up @@ -520,12 +513,6 @@ export class QuizExerciseUpdateComponent extends QuizExerciseValidationDirective
this.savedEntity = cloneDeep(quizExercise);
this.changeDetector.detectChanges();

if (this.goBackAfterSaving) {
this.navigationUtilService.navigateBack();

return;
}

// Navigate back only if it's an import
// If we edit the exercise, a user might just want to save the current state of the added quiz questions without going back
if (this.isImport) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild, effect, inject, input, signal } from '@angular/core';
import { Component, Input, OnChanges, SimpleChanges, ViewChild, effect, inject, input, output, signal } from '@angular/core';
import { Course, isCommunicationEnabled } from 'app/entities/course.model';
import { Exercise } from 'app/entities/exercise.model';
import { TitleChannelNameComponent } from 'app/shared/form/title-channel-name/title-channel-name.component';
Expand All @@ -22,8 +22,8 @@ export class ExerciseTitleChannelNameComponent implements OnChanges {

@ViewChild(TitleChannelNameComponent) titleChannelNameComponent: TitleChannelNameComponent;

@Output() onTitleChange = new EventEmitter<string>();
@Output() onChannelNameChange = new EventEmitter<string>();
onTitleChange = output<string>();
onChannelNameChange = output<string>();

private readonly exerciseService: ExerciseService = inject(ExerciseService);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class TextExerciseUpdateComponent implements OnInit, OnDestroy, AfterView
examCourseId?: number;
isExamMode: boolean;
isImport = false;
goBackAfterSaving = false;
AssessmentType = AssessmentType;
isAthenaEnabled$: Observable<boolean> | undefined;

Expand Down Expand Up @@ -170,12 +169,6 @@ export class TextExerciseUpdateComponent implements OnInit, OnDestroy, AfterView
)
.subscribe();

this.activatedRoute.queryParams.subscribe((params) => {
if (params.shouldHaveBackButtonToWizard) {
this.goBackAfterSaving = true;
}
});

this.isAthenaEnabled$ = this.athenaService.isEnabled();

this.isSaving = false;
Expand Down Expand Up @@ -278,12 +271,6 @@ export class TextExerciseUpdateComponent implements OnInit, OnDestroy, AfterView
this.eventManager.broadcast({ name: 'textExerciseListModification', content: 'OK' });
this.isSaving = false;

if (this.goBackAfterSaving) {
this.navigationUtilService.navigateBack();

return;
}

this.navigationUtilService.navigateForwardFromExerciseUpdateOrCreation(exercise);
}

Expand Down
Loading

0 comments on commit 64141f9

Please sign in to comment.