From 31e332eaafe5baf0175e7a1668c820f8a454fe8c Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Mon, 21 Dec 2020 16:39:53 +0100
Subject: [PATCH 01/95] LoginHandler now returns UserDetails
---
.../kotlin/dev/dres/api/rest/handler/LoginHandler.kt | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/LoginHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/LoginHandler.kt
index c467f716e..d4e01a6dc 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/LoginHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/LoginHandler.kt
@@ -7,16 +7,18 @@ import dev.dres.api.rest.types.status.SuccessStatus
import dev.dres.data.dbo.DAO
import dev.dres.data.model.admin.PlainPassword
import dev.dres.data.model.admin.UserName
+import dev.dres.mgmt.admin.UserManager
import dev.dres.mgmt.admin.UserManager.getMatchingUser
import dev.dres.run.audit.AuditLogEntry
import dev.dres.run.audit.AuditLogger
import dev.dres.run.audit.LogEventSource
+import dev.dres.utilities.extensions.UID
import dev.dres.utilities.extensions.sessionId
import io.javalin.http.BadRequestResponse
import io.javalin.http.Context
import io.javalin.plugin.openapi.annotations.*
-class LoginHandler(private val audit: DAO) : RestHandler, PostRestHandler {
+class LoginHandler(private val audit: DAO) : RestHandler, PostRestHandler {
data class LoginRequest(var username: String, var password: String)
@@ -26,11 +28,11 @@ class LoginHandler(private val audit: DAO) : RestHandler, PostRes
tags = ["User"],
requestBody = OpenApiRequestBody([OpenApiContent(LoginRequest::class)]),
responses = [
- OpenApiResponse("200", [OpenApiContent(SuccessStatus::class)]),
+ OpenApiResponse("200", [OpenApiContent(UserDetails::class)]),
OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)]),
OpenApiResponse("401", [OpenApiContent(ErrorStatus::class)])
])
- override fun doPost(ctx: Context) : SuccessStatus{
+ override fun doPost(ctx: Context) : UserDetails{
val loginRequest = try {
ctx.bodyAsClass(LoginRequest::class.java)
@@ -46,7 +48,8 @@ class LoginHandler(private val audit: DAO) : RestHandler, PostRes
AccessManager.setUserForSession(ctx.sessionId(), user)
AuditLogger.login(loginRequest.username, ctx.sessionId(), LogEventSource.REST)
- return SuccessStatus("Login of '${user.username}' successful!")
+
+ return UserDetails.create(UserManager.get(username)!!, ctx)
}
From afd85522730e64a0aee4e8724709476683004bee Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Mon, 21 Dec 2020 16:46:48 +0100
Subject: [PATCH 02/95] Added session param to some endpoints relevant for the
client
---
.../src/main/kotlin/dev/dres/api/rest/handler/LogHandler.kt | 6 ++++++
.../main/kotlin/dev/dres/api/rest/handler/LogoutHandler.kt | 4 ++++
.../kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt | 3 ++-
.../main/kotlin/dev/dres/api/rest/handler/UserHandler.kt | 3 +++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/LogHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/LogHandler.kt
index 2b5b5b567..6a7208f25 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/LogHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/LogHandler.kt
@@ -48,6 +48,9 @@ class QueryLogHandler : LogHandler() {
method = HttpMethod.POST,
requestBody = OpenApiRequestBody([OpenApiContent(QueryEventLog::class)]),
tags = ["Log"],
+ queryParams = [
+ OpenApiParam("session", String::class, "Session Token", required = true, allowEmptyValue = false)
+ ],
responses = [
OpenApiResponse("200", [OpenApiContent(SuccessStatus::class)]),
OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)]),
@@ -82,6 +85,9 @@ class ResultLogHandler : LogHandler() {
method = HttpMethod.POST,
requestBody = OpenApiRequestBody([OpenApiContent(QueryResultLog::class)]),
tags = ["Log"],
+ queryParams = [
+ OpenApiParam("session", String::class, "Session Token", required = true, allowEmptyValue = false)
+ ],
responses = [
OpenApiResponse("200", [OpenApiContent(SuccessStatus::class)]),
OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)]),
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/LogoutHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/LogoutHandler.kt
index e715c703e..3bcbdf68d 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/LogoutHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/LogoutHandler.kt
@@ -11,12 +11,16 @@ import dev.dres.utilities.extensions.sessionId
import io.javalin.http.Context
import io.javalin.plugin.openapi.annotations.OpenApi
import io.javalin.plugin.openapi.annotations.OpenApiContent
+import io.javalin.plugin.openapi.annotations.OpenApiParam
import io.javalin.plugin.openapi.annotations.OpenApiResponse
class LogoutHandler(private val audit: DAO) : RestHandler, GetRestHandler {
@OpenApi(summary = "Clears all user roles of the current session.", path = "/api/logout",
tags = ["User"],
+ queryParams = [
+ OpenApiParam("session", String::class, "Session Token", required = true, allowEmptyValue = false)
+ ],
responses = [
OpenApiResponse("200", [OpenApiContent(SuccessStatus::class)]),
OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)])
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
index 79f21ac0a..724dc4881 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
@@ -115,7 +115,8 @@ class SubmissionHandler (val collections: DAO, private val item
OpenApiParam(PARAMETER_NAME_ITEM, String::class, "Identifier for the actual media object or media file."),
OpenApiParam(PARAMETER_NAME_FRAME, Int::class, "Frame number for media with temporal progression (e.g. video)."),
OpenApiParam(PARAMETER_NAME_SHOT, Int::class, "Shot number for media with temporal progression (e.g. video)."),
- OpenApiParam(PARAMETER_NAME_TIMECODE, String::class, "Timecode for media with temporal progression (e.g. video).")
+ OpenApiParam(PARAMETER_NAME_TIMECODE, String::class, "Timecode for media with temporal progression (e.g. video)."),
+ OpenApiParam("session", String::class, "Session Token", required = true, allowEmptyValue = false)
],
tags = ["Submission"],
responses = [
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/UserHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/UserHandler.kt
index 8323bbfa1..312b88277 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/UserHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/UserHandler.kt
@@ -224,6 +224,9 @@ class CurrentUsersSessionIdHandler : UserHandler(), GetRestHandler, A
summary = "Get current sessionId",
path = "/api/user/session",
tags = ["User"],
+ queryParams = [
+ OpenApiParam("session", String::class, "Session Token", required = true, allowEmptyValue = false)
+ ],
responses = [
OpenApiResponse("200", [OpenApiContent(SessionId::class)]),
OpenApiResponse("500", [OpenApiContent(ErrorStatus::class)])
From 1507b199a0c1c2e36c85b94658cf216f8440236e Mon Sep 17 00:00:00 2001
From: Loris Sauter
Date: Mon, 1 Feb 2021 08:59:17 +0100
Subject: [PATCH 03/95] #204 First preparation steps towards video player for
query hints
---
...etition-builder-task-dialog.component.html | 3 ++
...mpetition-builder-task-dialog.component.ts | 12 +++--
...ayer-segment-builder-dialog.component.html | 5 +++
...ayer-segment-builder-dialog.component.scss | 0
...player-segment-builder-dialog.component.ts | 44 +++++++++++++++++++
...ideo-player-segment-builder.component.html | 6 +--
.../video-player-segment-builder.component.ts | 16 ++++---
.../competition-builder.module.ts | 4 +-
8 files changed, 74 insertions(+), 16 deletions(-)
create mode 100644 frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder-dialog/video-player-segment-builder-dialog.component.html
create mode 100644 frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder-dialog/video-player-segment-builder-dialog.component.scss
create mode 100644 frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder-dialog/video-player-segment-builder-dialog.component.ts
diff --git a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
index bfbb6a4a6..b6496a47d 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
+++ b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
@@ -216,6 +216,9 @@ Target
+
Query description
-
- Cancel
- Save
- Export
-
+
diff --git a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
index 489482ddf..5dc6e9da9 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
+++ b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
@@ -1,4 +1,4 @@
-import {AfterViewInit, Component, ElementRef, Inject, OnDestroy, ViewChild} from '@angular/core';
+import {AfterViewInit, Component, ElementRef, Inject, Input, OnDestroy, ViewChild} from '@angular/core';
import {Observable, of, Subscription} from 'rxjs';
import {RestMediaItem, TemporalRange} from '../../../../../../openapi';
import {AppConfig} from '../../../../app.config';
@@ -19,6 +19,8 @@ export interface VideoPlayerSegmentBuilderData {
export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDestroy {
+ @Input() data: VideoPlayerSegmentBuilderData;
+
@ViewChild('videoPlayer', {static: false}) video: ElementRef;
videoUrl: Observable;
playtimeRelative: Observable;
@@ -38,9 +40,9 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
private requestSub: Subscription;
- constructor(public config: AppConfig,
+ constructor(public config: AppConfig/*,
public dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: VideoPlayerSegmentBuilderData) {
+ @Inject(MAT_DIALOG_DATA) public data: VideoPlayerSegmentBuilderData*/) {
}
@@ -132,14 +134,16 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
* Fetches the data from the form, returns it to the dialog openeer and cloeses this dialog
*/
save(): void {
- this.dialogRef.close(this.fetchData());
+ console.log("save");
+ // this.dialogRef.close(this.fetchData());
}
/**
* Closes this dialog without saving
*/
close(): void {
- this.dialogRef.close(null);
+ console.log("close");
+ // this.dialogRef.close(null);
}
/**
@@ -168,7 +172,7 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
this.recalcVideoTime(null);
}
- private fetchData() {
+ public fetchData() {
const out = {
start: {value: this.startInSeconds, unit: 'SECONDS'},
end: {value: this.endInSeconds, unit: 'SECONDS'}
diff --git a/frontend/src/app/competition/competition-builder/competition-builder.module.ts b/frontend/src/app/competition/competition-builder/competition-builder.module.ts
index 7776b48db..23606f211 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder.module.ts
+++ b/frontend/src/app/competition/competition-builder/competition-builder.module.ts
@@ -32,6 +32,7 @@ import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatGridListModule} from '@angular/material/grid-list';
import {AdvancedBuilderDialogComponent} from './competition-builder-task-dialog/advanced-builder-dialog/advanced-builder-dialog.component';
import {SharedModule} from '../../shared/shared.module';
+import { VideoPlayerSegmentBuilderDialogComponent } from './competition-builder-task-dialog/video-player-segment-builder-dialog/video-player-segment-builder-dialog.component';
@NgModule({
imports: [
@@ -71,7 +72,8 @@ import {SharedModule} from '../../shared/shared.module';
CompetitionBuilderTaskGroupDialogComponent,
CompetitionBuilderTaskTypeDialogComponent,
VideoPlayerSegmentBuilderComponent,
- AdvancedBuilderDialogComponent
+ AdvancedBuilderDialogComponent,
+ VideoPlayerSegmentBuilderDialogComponent
],
providers: []
})
From d6dd49933e7c917293c0cf58ccc39e3dcbbc306d Mon Sep 17 00:00:00 2001
From: Loris Sauter
Date: Mon, 1 Feb 2021 11:39:33 +0100
Subject: [PATCH 04/95] Closes #204 Added video player
---
...etition-builder-task-dialog.component.html | 7 +--
...mpetition-builder-task-dialog.component.ts | 45 +++++++++++--------
.../video-player-segment-builder.component.ts | 24 +++-------
3 files changed, 37 insertions(+), 39 deletions(-)
diff --git a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
index b6496a47d..340c1a468 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
+++ b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.html
@@ -205,6 +205,9 @@ Target
+
@@ -216,9 +219,7 @@
Target
-
+
Query description
,
+ public collectionService: CollectionService,
+ @Inject(MAT_DIALOG_DATA) public data: CompetitionBuilderTaskDialogData,
+ private dialog: MatDialog,
+ public config: AppConfig) {
+
+ this.builder = new CompetitionFormBuilder(this.data.taskGroup, this.data.taskType, this.collectionService, this.data.task);
+ this.form = this.builder.form;
+ this.mediaCollectionSource = this.collectionService.getApiCollectionList();
+ }
+
form: FormGroup;
units = ['FRAME_NUMBER', 'SECONDS', 'MILLISECONDS', 'TIMECODE'];
/** Data source for list of {@link MediaCollection}. Loaded upon construction of the dialog. */
@@ -67,28 +78,17 @@ export class CompetitionBuilderTaskDialogComponent {
videoSegmentData: VideoPlayerSegmentBuilderData;
private imagePreviewMap = new Set();
- constructor(public dialogRef: MatDialogRef,
- public collectionService: CollectionService,
- @Inject(MAT_DIALOG_DATA) public data: CompetitionBuilderTaskDialogData,
- private dialog: MatDialog,
- public config: AppConfig) {
-
- this.builder = new CompetitionFormBuilder(this.data.taskGroup, this.data.taskType, this.collectionService, this.data.task);
- this.form = this.builder.form;
- this.mediaCollectionSource = this.collectionService.getApiCollectionList();
+ private static randInt(min: number, max: number): number {
+ min = Math.floor(min);
+ max = Math.ceil(max);
+ return Math.round(Math.random() * (max - min + 1) + min);
}
uploaded = (taskData: string) => {
const task = JSON.parse(taskData) as RestTaskDescription;
this.builder = new CompetitionFormBuilder(this.data.taskGroup, this.data.taskType, this.collectionService, task);
this.form = this.builder.form;
- console.log("Loaded task: "+JSON.stringify(task));
- };
-
- private static randInt(min: number, max: number): number {
- min = Math.floor(min);
- max = Math.ceil(max);
- return Math.round(Math.random() * (max - min + 1) + min);
+ console.log('Loaded task: ' + JSON.stringify(task));
}
/**
@@ -203,9 +203,9 @@ export class CompetitionBuilderTaskDialogComponent {
if (endControl && endControl.value) {
end = Number.parseInt(endControl.value, 10);
}
- const config = {
- width: '800px', data: {mediaItem, segmentStart: start, segmentEnd: end}
- } as MatDialogConfig;
+ // const config = {
+ // width: '800px', data: {mediaItem, segmentStart: start, segmentEnd: end}
+ // } as MatDialogConfig;
// const dialogRef = this.dialog.open(VideoPlayerSegmentBuilderDialogComponent, config);
/*dialogRef.afterClosed().pipe(
filter(r => r != null))
@@ -219,6 +219,13 @@ export class CompetitionBuilderTaskDialogComponent {
this.showVideo = !this.showVideo;
}
+ onRangeChange( range: TemporalRange, startControl?: FormControl, endControl?: FormControl, unitControl?: FormControl){
+ startControl?.setValue(range.start.value);
+ endControl?.setValue(range.end.value);
+ unitControl?.setValue(TemporalPoint.UnitEnum.SECONDS);
+ console.log('Range updated');
+ }
+
isImageMediaItem(mi: RestMediaItem): boolean {
if (mi) {
return mi.type === 'IMAGE';
diff --git a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
index 5dc6e9da9..e92f683f3 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
+++ b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/video-player-segment-builder/video-player-segment-builder.component.ts
@@ -1,4 +1,4 @@
-import {AfterViewInit, Component, ElementRef, Inject, Input, OnDestroy, ViewChild} from '@angular/core';
+import {AfterViewInit, Component, ElementRef, EventEmitter, Inject, Input, OnDestroy, Output, ViewChild} from '@angular/core';
import {Observable, of, Subscription} from 'rxjs';
import {RestMediaItem, TemporalRange} from '../../../../../../openapi';
import {AppConfig} from '../../../../app.config';
@@ -20,6 +20,7 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
@Input() data: VideoPlayerSegmentBuilderData;
+ @Output() rangeChange = new EventEmitter();
@ViewChild('videoPlayer', {static: false}) video: ElementRef;
videoUrl: Observable;
@@ -130,29 +131,17 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
}
}
- /**
- * Fetches the data from the form, returns it to the dialog openeer and cloeses this dialog
- */
- save(): void {
- console.log("save");
- // this.dialogRef.close(this.fetchData());
- }
-
- /**
- * Closes this dialog without saving
- */
- close(): void {
- console.log("close");
- // this.dialogRef.close(null);
- }
-
/**
* Currently only logs the formdata as json
+ * @deprecated
*/
export(): void {
console.log(this.asJson());
}
+ /**
+ * @deprecated
+ */
asJson(): string {
return JSON.stringify(this.fetchData());
}
@@ -160,6 +149,7 @@ export class VideoPlayerSegmentBuilderComponent implements AfterViewInit, OnDest
recalcVideoTime($event: Event) {
console.log(`Change: ${this.startInSeconds} - ${this.endInSeconds}`);
this.video.nativeElement.currentTime = this.startInSeconds;
+ this.rangeChange.emit(this.fetchData());
}
setStart(){
From 1c226395008f610e0fc05b3e952dd5b689896b2c Mon Sep 17 00:00:00 2001
From: Loris Sauter
Date: Mon, 1 Feb 2021 12:27:31 +0100
Subject: [PATCH 05/95] #224 Preparation step: client openapi bindings gen via
gradle. Affects also #179
---
backend/build.gradle | 41 ++++++++
frontend/openapi/.openapi-generator/FILES | 94 +++++++++++++++++++
frontend/openapi/.openapi-generator/VERSION | 2 +-
frontend/openapi/README.md | 6 +-
frontend/openapi/api.module.ts | 1 -
frontend/openapi/api/audit.service.ts | 1 -
frontend/openapi/api/collection.service.ts | 1 -
frontend/openapi/api/competition.service.ts | 1 -
.../openapi/api/competitionRun.service.ts | 1 -
.../api/competitionRunAdmin.service.ts | 1 -
.../api/competitionRunScores.service.ts | 1 -
frontend/openapi/api/default.service.ts | 1 -
frontend/openapi/api/judgement.service.ts | 46 ++++++++-
frontend/openapi/api/log.service.ts | 1 -
frontend/openapi/api/status.service.ts | 1 -
frontend/openapi/api/submission.service.ts | 1 -
frontend/openapi/api/user.service.ts | 1 -
frontend/openapi/configuration.ts | 37 ++++++++
frontend/openapi/encoder.ts | 1 -
.../openapi/model/competitionStartMessage.ts | 4 +-
.../openapi/model/configuredOptionOptions.ts | 4 +-
.../configuredOptionQueryComponentType.ts | 10 +-
.../model/configuredOptionScoringType.ts | 4 +-
.../configuredOptionSubmissionFilterType.ts | 12 +--
.../model/configuredOptionTargetType.ts | 8 +-
frontend/openapi/model/contentElement.ts | 8 +-
frontend/openapi/model/judgement.ts | 8 +-
frontend/openapi/model/restAuditLogEntry.ts | 20 ++--
.../model/restCompetitionEndAuditLogEntry.ts | 26 ++---
.../restCompetitionEndAuditLogEntryAllOf.ts | 6 +-
.../restCompetitionStartAuditLogEntry.ts | 26 ++---
.../model/restJudgementAuditLogEntry.ts | 34 +++----
.../model/restJudgementAuditLogEntryAllOf.ts | 14 +--
.../openapi/model/restLoginAuditLogEntry.ts | 26 ++---
.../model/restLoginAuditLogEntryAllOf.ts | 6 +-
.../openapi/model/restLogoutAuditLogEntry.ts | 26 ++---
.../model/restLogoutAuditLogEntryAllOf.ts | 6 +-
frontend/openapi/model/restMediaItem.ts | 4 +-
.../restPrepareJudgementAuditLogEntry.ts | 20 ++--
.../model/restSubmissionAuditLogEntry.ts | 26 ++---
.../model/restSubmissionAuditLogEntryAllOf.ts | 6 +-
.../model/restTaskDescriptionComponent.ts | 10 +-
.../model/restTaskDescriptionTarget.ts | 8 +-
.../openapi/model/restTaskEndAuditLogEntry.ts | 26 ++---
.../model/restTaskEndAuditLogEntryAllOf.ts | 6 +-
.../model/restTaskModifiedAuditLogEntry.ts | 26 ++---
.../restTaskModifiedAuditLogEntryAllOf.ts | 6 +-
.../model/restTaskStartAuditLogEntry.ts | 26 ++---
frontend/openapi/model/runState.ts | 12 +--
frontend/openapi/model/submissionInfo.ts | 8 +-
frontend/openapi/model/temporalPoint.ts | 6 +-
frontend/openapi/model/userDetails.ts | 8 +-
frontend/openapi/model/userRequest.ts | 8 +-
frontend/openapi/package.json | 6 +-
54 files changed, 448 insertions(+), 251 deletions(-)
create mode 100644 frontend/openapi/.openapi-generator/FILES
diff --git a/backend/build.gradle b/backend/build.gradle
index 62e896520..03d44e255 100644
--- a/backend/build.gradle
+++ b/backend/build.gradle
@@ -13,9 +13,14 @@ buildscript {
}
}
plugins {
+ /// Frontend compilation & deployment
id 'com.github.node-gradle.node' version '2.2.0'
+ /// Download task for FFMPEG binaries download
id 'de.undercouch.download' version '4.0.4'
+ /// OpenAPI Generator for Frontend internal api generation
+ id 'org.openapi.generator' version '5.0.0'
}
+
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'kotlin'
@@ -26,6 +31,34 @@ mainClassName = 'dev.dres.DRES'
sourceCompatibility = 1.8
+/// Default OpenAPI Specifications of dres
+def fullOAS = "http://localhost:8080/swagger-docs"
+/// Provide ability to override with gradle command line input
+/// call gradle with -Poas="" to specify non-default OAS location
+if(project.hasProperty('oas')){
+ fullOAS = oas
+}
+
+/// Generates the openapi frontend bindings
+openApiGenerate {
+ /// Source command:
+ /// openapi-generator generate -g typescript-angular -i http://localhost:8080/swagger-docs -o openapi --skip-validate-spec --additional-properties npmName=@dres-openapi/api,snapshot=true,ngVersion=9.1.0
+ generateApiTests = false // No tests please
+ generateModelTests = false // No tests please
+ validateSpec = false // No validation please (as in command above)
+
+ generatorName = 'typescript-angular'
+ inputSpec = "$buildDir/oas.json"
+ outputDir = file("${project.projectDir}/../frontend/openapi").toString()
+ configOptions = [
+ npmName: '@dres-openapi/api',
+ ngVersion: '9.1.0',
+ snapshot: 'true' /// I suggest to remove this, as soon as we automate this
+ ]
+}
+
+
+
repositories {
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
@@ -166,6 +199,12 @@ task deployFrontend(type: Copy) {
into('src/main/resources/html')
}
+task downloadOAS(type: Download) {
+ def f = new File("$buildDir/oas.json")
+ src "$fullOAS"
+ dest f
+}
+
/** Custom tasks: FFmpeg Download and deployment. */
task downloadFFmpeg(type: Download) {
@@ -241,3 +280,5 @@ distZip.dependsOn jar
distZip.dependsOn setupFFMpeg
distTar.dependsOn jar
distTar.dependsOn setupFFMpeg
+
+tasks.openApiGenerate.dependsOn downloadOAS
\ No newline at end of file
diff --git a/frontend/openapi/.openapi-generator/FILES b/frontend/openapi/.openapi-generator/FILES
new file mode 100644
index 000000000..e2e19e787
--- /dev/null
+++ b/frontend/openapi/.openapi-generator/FILES
@@ -0,0 +1,94 @@
+.gitignore
+README.md
+api.module.ts
+api/api.ts
+api/audit.service.ts
+api/collection.service.ts
+api/competition.service.ts
+api/competitionRun.service.ts
+api/competitionRunAdmin.service.ts
+api/competitionRunScores.service.ts
+api/default.service.ts
+api/judgement.service.ts
+api/log.service.ts
+api/status.service.ts
+api/submission.service.ts
+api/user.service.ts
+configuration.ts
+encoder.ts
+git_push.sh
+index.ts
+model/auditLogInfo.ts
+model/competitionCreate.ts
+model/competitionOverview.ts
+model/competitionStartMessage.ts
+model/configuredOptionOptions.ts
+model/configuredOptionQueryComponentType.ts
+model/configuredOptionScoringType.ts
+model/configuredOptionSubmissionFilterType.ts
+model/configuredOptionTargetType.ts
+model/contentElement.ts
+model/currentTime.ts
+model/errorStatus.ts
+model/judgement.ts
+model/judgementRequest.ts
+model/judgementValidatorStatus.ts
+model/loginRequest.ts
+model/models.ts
+model/queryEvent.ts
+model/queryEventLog.ts
+model/queryResult.ts
+model/queryResultLog.ts
+model/restAuditLogEntry.ts
+model/restCompetitionDescription.ts
+model/restCompetitionEndAuditLogEntry.ts
+model/restCompetitionEndAuditLogEntryAllOf.ts
+model/restCompetitionStartAuditLogEntry.ts
+model/restDetailedTeam.ts
+model/restFullMediaCollection.ts
+model/restJudgementAuditLogEntry.ts
+model/restJudgementAuditLogEntryAllOf.ts
+model/restLoginAuditLogEntry.ts
+model/restLoginAuditLogEntryAllOf.ts
+model/restLogoutAuditLogEntry.ts
+model/restLogoutAuditLogEntryAllOf.ts
+model/restMediaCollection.ts
+model/restMediaItem.ts
+model/restPrepareJudgementAuditLogEntry.ts
+model/restPrepareJudgementAuditLogEntryAllOf.ts
+model/restSubmissionAuditLogEntry.ts
+model/restSubmissionAuditLogEntryAllOf.ts
+model/restTaskDescription.ts
+model/restTaskDescriptionComponent.ts
+model/restTaskDescriptionTarget.ts
+model/restTaskDescriptionTargetItem.ts
+model/restTaskEndAuditLogEntry.ts
+model/restTaskEndAuditLogEntryAllOf.ts
+model/restTaskModifiedAuditLogEntry.ts
+model/restTaskModifiedAuditLogEntryAllOf.ts
+model/restTaskStartAuditLogEntry.ts
+model/restTeam.ts
+model/runInfo.ts
+model/runState.ts
+model/score.ts
+model/scoreOverview.ts
+model/scoreSeries.ts
+model/scoreSeriesPoint.ts
+model/sessionId.ts
+model/submissionInfo.ts
+model/successStatus.ts
+model/taskGroup.ts
+model/taskHint.ts
+model/taskInfo.ts
+model/taskTarget.ts
+model/taskType.ts
+model/teamInfo.ts
+model/temporalPoint.ts
+model/temporalRange.ts
+model/userDetails.ts
+model/userRequest.ts
+model/viewerInfo.ts
+ng-package.json
+package.json
+tsconfig.json
+variables.ts
diff --git a/frontend/openapi/.openapi-generator/VERSION b/frontend/openapi/.openapi-generator/VERSION
index ecedc98d1..28cbf7c0a 100644
--- a/frontend/openapi/.openapi-generator/VERSION
+++ b/frontend/openapi/.openapi-generator/VERSION
@@ -1 +1 @@
-4.3.1
\ No newline at end of file
+5.0.0
\ No newline at end of file
diff --git a/frontend/openapi/README.md b/frontend/openapi/README.md
index d2870981e..c40a8ad20 100644
--- a/frontend/openapi/README.md
+++ b/frontend/openapi/README.md
@@ -1,4 +1,4 @@
-## @dres-openapi/api@1.0-SNAPSHOT.202101211944
+## @dres-openapi/api@1.0-SNAPSHOT.202102011224
### Building
@@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands.
_published:_
```
-npm install @dres-openapi/api@1.0-SNAPSHOT.202101211944 --save
+npm install @dres-openapi/api@1.0-SNAPSHOT.202102011224 --save
```
_without publishing (not recommended):_
@@ -57,7 +57,6 @@ In your Angular project:
import { ApiModule } from '@dres-openapi/api';
import { HttpClientModule } from '@angular/common/http';
-
@NgModule({
imports: [
ApiModule,
@@ -137,7 +136,6 @@ import { ApiModule } from 'my-api-path';
import { ApiModule as OtherApiModule } from 'my-other-api-path';
import { HttpClientModule } from '@angular/common/http';
-
@NgModule({
imports: [
ApiModule,
diff --git a/frontend/openapi/api.module.ts b/frontend/openapi/api.module.ts
index 66474c6cc..25cbc6321 100644
--- a/frontend/openapi/api.module.ts
+++ b/frontend/openapi/api.module.ts
@@ -2,7 +2,6 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core
import { Configuration } from './configuration';
import { HttpClient } from '@angular/common/http';
-
import { AuditService } from './api/audit.service';
import { CollectionService } from './api/collection.service';
import { CompetitionService } from './api/competition.service';
diff --git a/frontend/openapi/api/audit.service.ts b/frontend/openapi/api/audit.service.ts
index 6d9ac972d..d51019169 100644
--- a/frontend/openapi/api/audit.service.ts
+++ b/frontend/openapi/api/audit.service.ts
@@ -50,7 +50,6 @@ export class AuditService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/collection.service.ts b/frontend/openapi/api/collection.service.ts
index 199e8f525..fd062ea47 100644
--- a/frontend/openapi/api/collection.service.ts
+++ b/frontend/openapi/api/collection.service.ts
@@ -52,7 +52,6 @@ export class CollectionService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/competition.service.ts b/frontend/openapi/api/competition.service.ts
index 03875ca7e..2d100124c 100644
--- a/frontend/openapi/api/competition.service.ts
+++ b/frontend/openapi/api/competition.service.ts
@@ -55,7 +55,6 @@ export class CompetitionService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/competitionRun.service.ts b/frontend/openapi/api/competitionRun.service.ts
index edcef0875..a23e97515 100644
--- a/frontend/openapi/api/competitionRun.service.ts
+++ b/frontend/openapi/api/competitionRun.service.ts
@@ -54,7 +54,6 @@ export class CompetitionRunService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/competitionRunAdmin.service.ts b/frontend/openapi/api/competitionRunAdmin.service.ts
index 31b0147a7..2ee133e5e 100644
--- a/frontend/openapi/api/competitionRunAdmin.service.ts
+++ b/frontend/openapi/api/competitionRunAdmin.service.ts
@@ -52,7 +52,6 @@ export class CompetitionRunAdminService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/competitionRunScores.service.ts b/frontend/openapi/api/competitionRunScores.service.ts
index d0cb0d97a..07bfaf060 100644
--- a/frontend/openapi/api/competitionRunScores.service.ts
+++ b/frontend/openapi/api/competitionRunScores.service.ts
@@ -50,7 +50,6 @@ export class CompetitionRunScoresService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/default.service.ts b/frontend/openapi/api/default.service.ts
index bbc5c7142..bb02ecb4a 100644
--- a/frontend/openapi/api/default.service.ts
+++ b/frontend/openapi/api/default.service.ts
@@ -47,7 +47,6 @@ export class DefaultService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/judgement.service.ts b/frontend/openapi/api/judgement.service.ts
index 036d3bd1c..90ced9c71 100644
--- a/frontend/openapi/api/judgement.service.ts
+++ b/frontend/openapi/api/judgement.service.ts
@@ -52,7 +52,6 @@ export class JudgementService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
@@ -179,6 +178,51 @@ export class JudgementService {
);
}
+ /**
+ * Gets the next open Submission to voted on.
+ * @param runId Run ID
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getApiRunWithRunidVoteNext(runId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public getApiRunWithRunidVoteNext(runId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiRunWithRunidVoteNext(runId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiRunWithRunidVoteNext(runId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (runId === null || runId === undefined) {
+ throw new Error('Required parameter runId was null or undefined when calling getApiRunWithRunidVoteNext.');
+ }
+
+ let headers = this.defaultHeaders;
+
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
+ if (httpHeaderAcceptSelected === undefined) {
+ // to determine the Accept header
+ const httpHeaderAccepts: string[] = [
+ 'application/json'
+ ];
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
+ }
+ if (httpHeaderAcceptSelected !== undefined) {
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
+ }
+
+
+ let responseType: 'text' | 'json' = 'json';
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
+ responseType = 'text';
+ }
+
+ return this.httpClient.get(`${this.configuration.basePath}/api/run/${encodeURIComponent(String(runId))}/vote/next`,
+ {
+ responseType: responseType,
+ withCredentials: this.configuration.withCredentials,
+ headers: headers,
+ observe: observe,
+ reportProgress: reportProgress
+ }
+ );
+ }
+
/**
* Returns a Judgement.
* @param runId Run ID
diff --git a/frontend/openapi/api/log.service.ts b/frontend/openapi/api/log.service.ts
index 500a5686f..b0acf6379 100644
--- a/frontend/openapi/api/log.service.ts
+++ b/frontend/openapi/api/log.service.ts
@@ -51,7 +51,6 @@ export class LogService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/status.service.ts b/frontend/openapi/api/status.service.ts
index 9ce89b4ad..e3c877150 100644
--- a/frontend/openapi/api/status.service.ts
+++ b/frontend/openapi/api/status.service.ts
@@ -48,7 +48,6 @@ export class StatusService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/submission.service.ts b/frontend/openapi/api/submission.service.ts
index e6635c150..0377ef467 100644
--- a/frontend/openapi/api/submission.service.ts
+++ b/frontend/openapi/api/submission.service.ts
@@ -49,7 +49,6 @@ export class SubmissionService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/api/user.service.ts b/frontend/openapi/api/user.service.ts
index 242c7fa1e..a94d37bff 100644
--- a/frontend/openapi/api/user.service.ts
+++ b/frontend/openapi/api/user.service.ts
@@ -53,7 +53,6 @@ export class UserService {
}
-
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
diff --git a/frontend/openapi/configuration.ts b/frontend/openapi/configuration.ts
index c038bbc94..4ca354692 100644
--- a/frontend/openapi/configuration.ts
+++ b/frontend/openapi/configuration.ts
@@ -1,23 +1,47 @@
import { HttpParameterCodec } from '@angular/common/http';
export interface ConfigurationParameters {
+ /**
+ * @deprecated Since 5.0. Use credentials instead
+ */
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
+ /**
+ * @deprecated Since 5.0. Use credentials instead
+ */
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
encoder?: HttpParameterCodec;
+ /**
+ * The keys are the names in the securitySchemes section of the OpenAPI
+ * document. They should map to the value used for authentication
+ * minus any standard prefixes such as 'Basic' or 'Bearer'.
+ */
+ credentials?: {[ key: string ]: string | (() => string | undefined)};
}
export class Configuration {
+ /**
+ * @deprecated Since 5.0. Use credentials instead
+ */
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
+ /**
+ * @deprecated Since 5.0. Use credentials instead
+ */
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
encoder?: HttpParameterCodec;
+ /**
+ * The keys are the names in the securitySchemes section of the OpenAPI
+ * document. They should map to the value used for authentication
+ * minus any standard prefixes such as 'Basic' or 'Bearer'.
+ */
+ credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
@@ -27,6 +51,12 @@ export class Configuration {
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
+ if (configurationParameters.credentials) {
+ this.credentials = configurationParameters.credentials;
+ }
+ else {
+ this.credentials = {};
+ }
}
/**
@@ -81,4 +111,11 @@ export class Configuration {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}
+
+ public lookupCredential(key: string): string | undefined {
+ const value = this.credentials[key];
+ return typeof value === 'function'
+ ? value()
+ : value;
+ }
}
diff --git a/frontend/openapi/encoder.ts b/frontend/openapi/encoder.ts
index cbefb4a6d..138c4d5cf 100644
--- a/frontend/openapi/encoder.ts
+++ b/frontend/openapi/encoder.ts
@@ -18,4 +18,3 @@ export class CustomHttpParameterCodec implements HttpParameterCodec {
return decodeURIComponent(v);
}
}
-
diff --git a/frontend/openapi/model/competitionStartMessage.ts b/frontend/openapi/model/competitionStartMessage.ts
index fd54694bd..947000431 100644
--- a/frontend/openapi/model/competitionStartMessage.ts
+++ b/frontend/openapi/model/competitionStartMessage.ts
@@ -20,8 +20,8 @@ export interface CompetitionStartMessage {
export namespace CompetitionStartMessage {
export type TypeEnum = 'SYNCHRONOUS' | 'ASYNCHRONOUS';
export const TypeEnum = {
- SYNCHRONOUS: 'SYNCHRONOUS' as TypeEnum,
- ASYNCHRONOUS: 'ASYNCHRONOUS' as TypeEnum
+ Synchronous: 'SYNCHRONOUS' as TypeEnum,
+ Asynchronous: 'ASYNCHRONOUS' as TypeEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionOptions.ts b/frontend/openapi/model/configuredOptionOptions.ts
index 22a58e273..78a281bae 100644
--- a/frontend/openapi/model/configuredOptionOptions.ts
+++ b/frontend/openapi/model/configuredOptionOptions.ts
@@ -18,8 +18,8 @@ export interface ConfiguredOptionOptions {
export namespace ConfiguredOptionOptions {
export type OptionEnum = 'HIDDEN_RESULTS' | 'MAP_TO_SEGMENT';
export const OptionEnum = {
- HIDDENRESULTS: 'HIDDEN_RESULTS' as OptionEnum,
- MAPTOSEGMENT: 'MAP_TO_SEGMENT' as OptionEnum
+ HiddenResults: 'HIDDEN_RESULTS' as OptionEnum,
+ MapToSegment: 'MAP_TO_SEGMENT' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionQueryComponentType.ts b/frontend/openapi/model/configuredOptionQueryComponentType.ts
index c78827016..85b27302c 100644
--- a/frontend/openapi/model/configuredOptionQueryComponentType.ts
+++ b/frontend/openapi/model/configuredOptionQueryComponentType.ts
@@ -18,11 +18,11 @@ export interface ConfiguredOptionQueryComponentType {
export namespace ConfiguredOptionQueryComponentType {
export type OptionEnum = 'IMAGE_ITEM' | 'VIDEO_ITEM_SEGMENT' | 'TEXT' | 'EXTERNAL_IMAGE' | 'EXTERNAL_VIDEO';
export const OptionEnum = {
- IMAGEITEM: 'IMAGE_ITEM' as OptionEnum,
- VIDEOITEMSEGMENT: 'VIDEO_ITEM_SEGMENT' as OptionEnum,
- TEXT: 'TEXT' as OptionEnum,
- EXTERNALIMAGE: 'EXTERNAL_IMAGE' as OptionEnum,
- EXTERNALVIDEO: 'EXTERNAL_VIDEO' as OptionEnum
+ ImageItem: 'IMAGE_ITEM' as OptionEnum,
+ VideoItemSegment: 'VIDEO_ITEM_SEGMENT' as OptionEnum,
+ Text: 'TEXT' as OptionEnum,
+ ExternalImage: 'EXTERNAL_IMAGE' as OptionEnum,
+ ExternalVideo: 'EXTERNAL_VIDEO' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionScoringType.ts b/frontend/openapi/model/configuredOptionScoringType.ts
index 09495507d..bd6c146f4 100644
--- a/frontend/openapi/model/configuredOptionScoringType.ts
+++ b/frontend/openapi/model/configuredOptionScoringType.ts
@@ -18,8 +18,8 @@ export interface ConfiguredOptionScoringType {
export namespace ConfiguredOptionScoringType {
export type OptionEnum = 'KIS' | 'AVS';
export const OptionEnum = {
- KIS: 'KIS' as OptionEnum,
- AVS: 'AVS' as OptionEnum
+ Kis: 'KIS' as OptionEnum,
+ Avs: 'AVS' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionSubmissionFilterType.ts b/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
index e13a1b01d..c49c64c8e 100644
--- a/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
+++ b/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
@@ -18,12 +18,12 @@ export interface ConfiguredOptionSubmissionFilterType {
export namespace ConfiguredOptionSubmissionFilterType {
export type OptionEnum = 'NO_DUPLICATES' | 'LIMIT_CORRECT_PER_TEAM' | 'LIMIT_WRONG_PER_TEAM' | 'LIMIT_TOTAL_PER_TEAM' | 'LIMIT_CORRECT_PER_MEMBER' | 'TEMPORAL_SUBMISSION';
export const OptionEnum = {
- NODUPLICATES: 'NO_DUPLICATES' as OptionEnum,
- LIMITCORRECTPERTEAM: 'LIMIT_CORRECT_PER_TEAM' as OptionEnum,
- LIMITWRONGPERTEAM: 'LIMIT_WRONG_PER_TEAM' as OptionEnum,
- LIMITTOTALPERTEAM: 'LIMIT_TOTAL_PER_TEAM' as OptionEnum,
- LIMITCORRECTPERMEMBER: 'LIMIT_CORRECT_PER_MEMBER' as OptionEnum,
- TEMPORALSUBMISSION: 'TEMPORAL_SUBMISSION' as OptionEnum
+ NoDuplicates: 'NO_DUPLICATES' as OptionEnum,
+ LimitCorrectPerTeam: 'LIMIT_CORRECT_PER_TEAM' as OptionEnum,
+ LimitWrongPerTeam: 'LIMIT_WRONG_PER_TEAM' as OptionEnum,
+ LimitTotalPerTeam: 'LIMIT_TOTAL_PER_TEAM' as OptionEnum,
+ LimitCorrectPerMember: 'LIMIT_CORRECT_PER_MEMBER' as OptionEnum,
+ TemporalSubmission: 'TEMPORAL_SUBMISSION' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionTargetType.ts b/frontend/openapi/model/configuredOptionTargetType.ts
index 636de0a69..70a77884d 100644
--- a/frontend/openapi/model/configuredOptionTargetType.ts
+++ b/frontend/openapi/model/configuredOptionTargetType.ts
@@ -18,10 +18,10 @@ export interface ConfiguredOptionTargetType {
export namespace ConfiguredOptionTargetType {
export type OptionEnum = 'SINGLE_MEDIA_ITEM' | 'SINGLE_MEDIA_SEGMENT' | 'MULTIPLE_MEDIA_ITEMS' | 'JUDGEMENT';
export const OptionEnum = {
- SINGLEMEDIAITEM: 'SINGLE_MEDIA_ITEM' as OptionEnum,
- SINGLEMEDIASEGMENT: 'SINGLE_MEDIA_SEGMENT' as OptionEnum,
- MULTIPLEMEDIAITEMS: 'MULTIPLE_MEDIA_ITEMS' as OptionEnum,
- JUDGEMENT: 'JUDGEMENT' as OptionEnum
+ SingleMediaItem: 'SINGLE_MEDIA_ITEM' as OptionEnum,
+ SingleMediaSegment: 'SINGLE_MEDIA_SEGMENT' as OptionEnum,
+ MultipleMediaItems: 'MULTIPLE_MEDIA_ITEMS' as OptionEnum,
+ Judgement: 'JUDGEMENT' as OptionEnum
};
}
diff --git a/frontend/openapi/model/contentElement.ts b/frontend/openapi/model/contentElement.ts
index e43966e69..dc5e5063c 100644
--- a/frontend/openapi/model/contentElement.ts
+++ b/frontend/openapi/model/contentElement.ts
@@ -19,10 +19,10 @@ export interface ContentElement {
export namespace ContentElement {
export type ContentTypeEnum = 'EMPTY' | 'TEXT' | 'VIDEO' | 'IMAGE';
export const ContentTypeEnum = {
- EMPTY: 'EMPTY' as ContentTypeEnum,
- TEXT: 'TEXT' as ContentTypeEnum,
- VIDEO: 'VIDEO' as ContentTypeEnum,
- IMAGE: 'IMAGE' as ContentTypeEnum
+ Empty: 'EMPTY' as ContentTypeEnum,
+ Text: 'TEXT' as ContentTypeEnum,
+ Video: 'VIDEO' as ContentTypeEnum,
+ Image: 'IMAGE' as ContentTypeEnum
};
}
diff --git a/frontend/openapi/model/judgement.ts b/frontend/openapi/model/judgement.ts
index 094e20574..15264c2c8 100644
--- a/frontend/openapi/model/judgement.ts
+++ b/frontend/openapi/model/judgement.ts
@@ -19,10 +19,10 @@ export interface Judgement {
export namespace Judgement {
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- CORRECT: 'CORRECT' as VerdictEnum,
- WRONG: 'WRONG' as VerdictEnum,
- INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
- UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
+ Correct: 'CORRECT' as VerdictEnum,
+ Wrong: 'WRONG' as VerdictEnum,
+ Indeterminate: 'INDETERMINATE' as VerdictEnum,
+ Undecidable: 'UNDECIDABLE' as VerdictEnum
};
}
diff --git a/frontend/openapi/model/restAuditLogEntry.ts b/frontend/openapi/model/restAuditLogEntry.ts
index e1422e6ff..4401c0e99 100644
--- a/frontend/openapi/model/restAuditLogEntry.ts
+++ b/frontend/openapi/model/restAuditLogEntry.ts
@@ -19,16 +19,16 @@ export interface RestAuditLogEntry {
export namespace RestAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts b/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
index 94c66e270..1cd10ec10 100644
--- a/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
+++ b/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestCompetitionEndAuditLogEntry {
export namespace RestCompetitionEndAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts b/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
index a9d60b481..4d0c24daa 100644
--- a/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
@@ -19,9 +19,9 @@ export interface RestCompetitionEndAuditLogEntryAllOf {
export namespace RestCompetitionEndAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts b/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
index 492749683..7767d3a97 100644
--- a/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
+++ b/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestCompetitionStartAuditLogEntry {
export namespace RestCompetitionStartAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restJudgementAuditLogEntry.ts b/frontend/openapi/model/restJudgementAuditLogEntry.ts
index cbcac04bf..b05b34417 100644
--- a/frontend/openapi/model/restJudgementAuditLogEntry.ts
+++ b/frontend/openapi/model/restJudgementAuditLogEntry.ts
@@ -27,29 +27,29 @@ export interface RestJudgementAuditLogEntry {
export namespace RestJudgementAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- CORRECT: 'CORRECT' as VerdictEnum,
- WRONG: 'WRONG' as VerdictEnum,
- INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
- UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
+ Correct: 'CORRECT' as VerdictEnum,
+ Wrong: 'WRONG' as VerdictEnum,
+ Indeterminate: 'INDETERMINATE' as VerdictEnum,
+ Undecidable: 'UNDECIDABLE' as VerdictEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts b/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
index 8c1a629ec..eb673fe1d 100644
--- a/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
@@ -22,16 +22,16 @@ export interface RestJudgementAuditLogEntryAllOf {
export namespace RestJudgementAuditLogEntryAllOf {
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- CORRECT: 'CORRECT' as VerdictEnum,
- WRONG: 'WRONG' as VerdictEnum,
- INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
- UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
+ Correct: 'CORRECT' as VerdictEnum,
+ Wrong: 'WRONG' as VerdictEnum,
+ Indeterminate: 'INDETERMINATE' as VerdictEnum,
+ Undecidable: 'UNDECIDABLE' as VerdictEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLoginAuditLogEntry.ts b/frontend/openapi/model/restLoginAuditLogEntry.ts
index 2a8038997..5e56fec3d 100644
--- a/frontend/openapi/model/restLoginAuditLogEntry.ts
+++ b/frontend/openapi/model/restLoginAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestLoginAuditLogEntry {
export namespace RestLoginAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts b/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
index 457c1f6cb..b538e02ea 100644
--- a/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
@@ -19,9 +19,9 @@ export interface RestLoginAuditLogEntryAllOf {
export namespace RestLoginAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLogoutAuditLogEntry.ts b/frontend/openapi/model/restLogoutAuditLogEntry.ts
index 7db701491..efda7b671 100644
--- a/frontend/openapi/model/restLogoutAuditLogEntry.ts
+++ b/frontend/openapi/model/restLogoutAuditLogEntry.ts
@@ -23,22 +23,22 @@ export interface RestLogoutAuditLogEntry {
export namespace RestLogoutAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts b/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
index 968d5c82a..4259dd854 100644
--- a/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
@@ -18,9 +18,9 @@ export interface RestLogoutAuditLogEntryAllOf {
export namespace RestLogoutAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restMediaItem.ts b/frontend/openapi/model/restMediaItem.ts
index 867b6b5b9..af0aaf10f 100644
--- a/frontend/openapi/model/restMediaItem.ts
+++ b/frontend/openapi/model/restMediaItem.ts
@@ -23,8 +23,8 @@ export interface RestMediaItem {
export namespace RestMediaItem {
export type TypeEnum = 'IMAGE' | 'VIDEO';
export const TypeEnum = {
- IMAGE: 'IMAGE' as TypeEnum,
- VIDEO: 'VIDEO' as TypeEnum
+ Image: 'IMAGE' as TypeEnum,
+ Video: 'VIDEO' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts b/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
index f17aae1aa..df4b98111 100644
--- a/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
+++ b/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
@@ -25,16 +25,16 @@ export interface RestPrepareJudgementAuditLogEntry {
export namespace RestPrepareJudgementAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restSubmissionAuditLogEntry.ts b/frontend/openapi/model/restSubmissionAuditLogEntry.ts
index 05d49db1e..cec5f0f7e 100644
--- a/frontend/openapi/model/restSubmissionAuditLogEntry.ts
+++ b/frontend/openapi/model/restSubmissionAuditLogEntry.ts
@@ -28,22 +28,22 @@ export interface RestSubmissionAuditLogEntry {
export namespace RestSubmissionAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts b/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
index c22872591..4f5cdec49 100644
--- a/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
@@ -23,9 +23,9 @@ export interface RestSubmissionAuditLogEntryAllOf {
export namespace RestSubmissionAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskDescriptionComponent.ts b/frontend/openapi/model/restTaskDescriptionComponent.ts
index 9431e0a6a..c89faf21d 100644
--- a/frontend/openapi/model/restTaskDescriptionComponent.ts
+++ b/frontend/openapi/model/restTaskDescriptionComponent.ts
@@ -25,11 +25,11 @@ export interface RestTaskDescriptionComponent {
export namespace RestTaskDescriptionComponent {
export type TypeEnum = 'IMAGE_ITEM' | 'VIDEO_ITEM_SEGMENT' | 'TEXT' | 'EXTERNAL_IMAGE' | 'EXTERNAL_VIDEO';
export const TypeEnum = {
- IMAGEITEM: 'IMAGE_ITEM' as TypeEnum,
- VIDEOITEMSEGMENT: 'VIDEO_ITEM_SEGMENT' as TypeEnum,
- TEXT: 'TEXT' as TypeEnum,
- EXTERNALIMAGE: 'EXTERNAL_IMAGE' as TypeEnum,
- EXTERNALVIDEO: 'EXTERNAL_VIDEO' as TypeEnum
+ ImageItem: 'IMAGE_ITEM' as TypeEnum,
+ VideoItemSegment: 'VIDEO_ITEM_SEGMENT' as TypeEnum,
+ Text: 'TEXT' as TypeEnum,
+ ExternalImage: 'EXTERNAL_IMAGE' as TypeEnum,
+ ExternalVideo: 'EXTERNAL_VIDEO' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restTaskDescriptionTarget.ts b/frontend/openapi/model/restTaskDescriptionTarget.ts
index 76bdde71c..6c446ae01 100644
--- a/frontend/openapi/model/restTaskDescriptionTarget.ts
+++ b/frontend/openapi/model/restTaskDescriptionTarget.ts
@@ -19,10 +19,10 @@ export interface RestTaskDescriptionTarget {
export namespace RestTaskDescriptionTarget {
export type TypeEnum = 'SINGLE_MEDIA_ITEM' | 'SINGLE_MEDIA_SEGMENT' | 'MULTIPLE_MEDIA_ITEMS' | 'JUDGEMENT';
export const TypeEnum = {
- SINGLEMEDIAITEM: 'SINGLE_MEDIA_ITEM' as TypeEnum,
- SINGLEMEDIASEGMENT: 'SINGLE_MEDIA_SEGMENT' as TypeEnum,
- MULTIPLEMEDIAITEMS: 'MULTIPLE_MEDIA_ITEMS' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum
+ SingleMediaItem: 'SINGLE_MEDIA_ITEM' as TypeEnum,
+ SingleMediaSegment: 'SINGLE_MEDIA_SEGMENT' as TypeEnum,
+ MultipleMediaItems: 'MULTIPLE_MEDIA_ITEMS' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restTaskEndAuditLogEntry.ts b/frontend/openapi/model/restTaskEndAuditLogEntry.ts
index fab8a8b36..469eb0b9e 100644
--- a/frontend/openapi/model/restTaskEndAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskEndAuditLogEntry.ts
@@ -25,22 +25,22 @@ export interface RestTaskEndAuditLogEntry {
export namespace RestTaskEndAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts b/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
index 5337e4152..b72154975 100644
--- a/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
@@ -20,9 +20,9 @@ export interface RestTaskEndAuditLogEntryAllOf {
export namespace RestTaskEndAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts b/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
index 45bf0983c..f7f3d46d0 100644
--- a/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
@@ -26,22 +26,22 @@ export interface RestTaskModifiedAuditLogEntry {
export namespace RestTaskModifiedAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts b/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
index 0f5087704..9a44d3d7d 100644
--- a/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
@@ -21,9 +21,9 @@ export interface RestTaskModifiedAuditLogEntryAllOf {
export namespace RestTaskModifiedAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskStartAuditLogEntry.ts b/frontend/openapi/model/restTaskStartAuditLogEntry.ts
index 3c6a0f45e..76acf8c66 100644
--- a/frontend/openapi/model/restTaskStartAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskStartAuditLogEntry.ts
@@ -25,22 +25,22 @@ export interface RestTaskStartAuditLogEntry {
export namespace RestTaskStartAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- COMPETITIONSTART: 'COMPETITION_START' as TypeEnum,
- COMPETITIONEND: 'COMPETITION_END' as TypeEnum,
- TASKSTART: 'TASK_START' as TypeEnum,
- TASKMODIFIED: 'TASK_MODIFIED' as TypeEnum,
- TASKEND: 'TASK_END' as TypeEnum,
- SUBMISSION: 'SUBMISSION' as TypeEnum,
- PREPAREJUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
- JUDGEMENT: 'JUDGEMENT' as TypeEnum,
- LOGIN: 'LOGIN' as TypeEnum,
- LOGOUT: 'LOGOUT' as TypeEnum
+ CompetitionStart: 'COMPETITION_START' as TypeEnum,
+ CompetitionEnd: 'COMPETITION_END' as TypeEnum,
+ TaskStart: 'TASK_START' as TypeEnum,
+ TaskModified: 'TASK_MODIFIED' as TypeEnum,
+ TaskEnd: 'TASK_END' as TypeEnum,
+ Submission: 'SUBMISSION' as TypeEnum,
+ PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
+ Judgement: 'JUDGEMENT' as TypeEnum,
+ Login: 'LOGIN' as TypeEnum,
+ Logout: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- REST: 'REST' as ApiEnum,
- CLI: 'CLI' as ApiEnum,
- INTERNAL: 'INTERNAL' as ApiEnum
+ Rest: 'REST' as ApiEnum,
+ Cli: 'CLI' as ApiEnum,
+ Internal: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/runState.ts b/frontend/openapi/model/runState.ts
index b320fe00d..162a2ddc7 100644
--- a/frontend/openapi/model/runState.ts
+++ b/frontend/openapi/model/runState.ts
@@ -21,12 +21,12 @@ export interface RunState {
export namespace RunState {
export type StatusEnum = 'CREATED' | 'ACTIVE' | 'PREPARING_TASK' | 'RUNNING_TASK' | 'TASK_ENDED' | 'TERMINATED';
export const StatusEnum = {
- CREATED: 'CREATED' as StatusEnum,
- ACTIVE: 'ACTIVE' as StatusEnum,
- PREPARINGTASK: 'PREPARING_TASK' as StatusEnum,
- RUNNINGTASK: 'RUNNING_TASK' as StatusEnum,
- TASKENDED: 'TASK_ENDED' as StatusEnum,
- TERMINATED: 'TERMINATED' as StatusEnum
+ Created: 'CREATED' as StatusEnum,
+ Active: 'ACTIVE' as StatusEnum,
+ PreparingTask: 'PREPARING_TASK' as StatusEnum,
+ RunningTask: 'RUNNING_TASK' as StatusEnum,
+ TaskEnded: 'TASK_ENDED' as StatusEnum,
+ Terminated: 'TERMINATED' as StatusEnum
};
}
diff --git a/frontend/openapi/model/submissionInfo.ts b/frontend/openapi/model/submissionInfo.ts
index 384fb10a6..156f64f6a 100644
--- a/frontend/openapi/model/submissionInfo.ts
+++ b/frontend/openapi/model/submissionInfo.ts
@@ -25,10 +25,10 @@ export interface SubmissionInfo {
export namespace SubmissionInfo {
export type StatusEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const StatusEnum = {
- CORRECT: 'CORRECT' as StatusEnum,
- WRONG: 'WRONG' as StatusEnum,
- INDETERMINATE: 'INDETERMINATE' as StatusEnum,
- UNDECIDABLE: 'UNDECIDABLE' as StatusEnum
+ Correct: 'CORRECT' as StatusEnum,
+ Wrong: 'WRONG' as StatusEnum,
+ Indeterminate: 'INDETERMINATE' as StatusEnum,
+ Undecidable: 'UNDECIDABLE' as StatusEnum
};
}
diff --git a/frontend/openapi/model/temporalPoint.ts b/frontend/openapi/model/temporalPoint.ts
index 4ebc9c08d..0a2d6c8ae 100644
--- a/frontend/openapi/model/temporalPoint.ts
+++ b/frontend/openapi/model/temporalPoint.ts
@@ -18,9 +18,9 @@ export interface TemporalPoint {
export namespace TemporalPoint {
export type UnitEnum = 'FRAME_NUMBER' | 'SECONDS' | 'MILLISECONDS';
export const UnitEnum = {
- FRAMENUMBER: 'FRAME_NUMBER' as UnitEnum,
- SECONDS: 'SECONDS' as UnitEnum,
- MILLISECONDS: 'MILLISECONDS' as UnitEnum
+ FrameNumber: 'FRAME_NUMBER' as UnitEnum,
+ Seconds: 'SECONDS' as UnitEnum,
+ Milliseconds: 'MILLISECONDS' as UnitEnum
};
}
diff --git a/frontend/openapi/model/userDetails.ts b/frontend/openapi/model/userDetails.ts
index a5a0d9b7e..ba1529701 100644
--- a/frontend/openapi/model/userDetails.ts
+++ b/frontend/openapi/model/userDetails.ts
@@ -20,10 +20,10 @@ export interface UserDetails {
export namespace UserDetails {
export type RoleEnum = 'ADMIN' | 'JUDGE' | 'VIEWER' | 'PARTICIPANT';
export const RoleEnum = {
- ADMIN: 'ADMIN' as RoleEnum,
- JUDGE: 'JUDGE' as RoleEnum,
- VIEWER: 'VIEWER' as RoleEnum,
- PARTICIPANT: 'PARTICIPANT' as RoleEnum
+ Admin: 'ADMIN' as RoleEnum,
+ Judge: 'JUDGE' as RoleEnum,
+ Viewer: 'VIEWER' as RoleEnum,
+ Participant: 'PARTICIPANT' as RoleEnum
};
}
diff --git a/frontend/openapi/model/userRequest.ts b/frontend/openapi/model/userRequest.ts
index 55b011274..4a5b50b20 100644
--- a/frontend/openapi/model/userRequest.ts
+++ b/frontend/openapi/model/userRequest.ts
@@ -19,10 +19,10 @@ export interface UserRequest {
export namespace UserRequest {
export type RoleEnum = 'ADMIN' | 'JUDGE' | 'VIEWER' | 'PARTICIPANT';
export const RoleEnum = {
- ADMIN: 'ADMIN' as RoleEnum,
- JUDGE: 'JUDGE' as RoleEnum,
- VIEWER: 'VIEWER' as RoleEnum,
- PARTICIPANT: 'PARTICIPANT' as RoleEnum
+ Admin: 'ADMIN' as RoleEnum,
+ Judge: 'JUDGE' as RoleEnum,
+ Viewer: 'VIEWER' as RoleEnum,
+ Participant: 'PARTICIPANT' as RoleEnum
};
}
diff --git a/frontend/openapi/package.json b/frontend/openapi/package.json
index 4b3473c81..bacea750e 100644
--- a/frontend/openapi/package.json
+++ b/frontend/openapi/package.json
@@ -1,6 +1,6 @@
{
"name": "@dres-openapi/api",
- "version": "1.0-SNAPSHOT.202101211944",
+ "version": "1.0-SNAPSHOT.202102011224",
"description": "OpenAPI client for @dres-openapi/api",
"author": "OpenAPI-Generator Contributors",
"keywords": [
@@ -13,10 +13,6 @@
},
"peerDependencies": {
"@angular/core": "^9.1.0",
- "@angular/common": "^9.1.0",
- "@angular/compiler": "^9.1.0",
- "core-js": "^2.4.0",
- "reflect-metadata": "^0.1.3",
"rxjs": "^6.5.3"
},
"devDependencies": {
From 40046c5ea405d6e629f76d8e36c13ddc088b11c3 Mon Sep 17 00:00:00 2001
From: Loris Sauter
Date: Mon, 1 Feb 2021 12:36:03 +0100
Subject: [PATCH 06/95] Fixed different naming scheme
---
frontend/openapi/README.md | 4 +--
.../openapi/model/competitionStartMessage.ts | 4 +--
.../openapi/model/configuredOptionOptions.ts | 4 +--
.../configuredOptionQueryComponentType.ts | 10 +++---
.../model/configuredOptionScoringType.ts | 4 +--
.../configuredOptionSubmissionFilterType.ts | 12 +++----
.../model/configuredOptionTargetType.ts | 8 ++---
frontend/openapi/model/contentElement.ts | 8 ++---
frontend/openapi/model/judgement.ts | 8 ++---
frontend/openapi/model/restAuditLogEntry.ts | 20 +++++------
.../model/restCompetitionEndAuditLogEntry.ts | 26 +++++++-------
.../restCompetitionEndAuditLogEntryAllOf.ts | 6 ++--
.../restCompetitionStartAuditLogEntry.ts | 26 +++++++-------
.../model/restJudgementAuditLogEntry.ts | 34 +++++++++---------
.../model/restJudgementAuditLogEntryAllOf.ts | 14 ++++----
.../openapi/model/restLoginAuditLogEntry.ts | 26 +++++++-------
.../model/restLoginAuditLogEntryAllOf.ts | 6 ++--
.../openapi/model/restLogoutAuditLogEntry.ts | 26 +++++++-------
.../model/restLogoutAuditLogEntryAllOf.ts | 6 ++--
frontend/openapi/model/restMediaItem.ts | 4 +--
.../restPrepareJudgementAuditLogEntry.ts | 20 +++++------
.../model/restSubmissionAuditLogEntry.ts | 26 +++++++-------
.../model/restSubmissionAuditLogEntryAllOf.ts | 6 ++--
.../model/restTaskDescriptionComponent.ts | 10 +++---
.../model/restTaskDescriptionTarget.ts | 8 ++---
.../openapi/model/restTaskEndAuditLogEntry.ts | 26 +++++++-------
.../model/restTaskEndAuditLogEntryAllOf.ts | 6 ++--
.../model/restTaskModifiedAuditLogEntry.ts | 26 +++++++-------
.../restTaskModifiedAuditLogEntryAllOf.ts | 6 ++--
.../model/restTaskStartAuditLogEntry.ts | 26 +++++++-------
frontend/openapi/model/runState.ts | 12 +++----
frontend/openapi/model/submissionInfo.ts | 8 ++---
frontend/openapi/model/temporalPoint.ts | 6 ++--
frontend/openapi/model/userDetails.ts | 8 ++---
frontend/openapi/model/userRequest.ts | 8 ++---
frontend/openapi/package.json | 2 +-
...mpetition-builder-task-dialog.component.ts | 2 +-
.../competition-builder.component.ts | 36 +++++++++----------
38 files changed, 249 insertions(+), 249 deletions(-)
diff --git a/frontend/openapi/README.md b/frontend/openapi/README.md
index c40a8ad20..8794d6fdb 100644
--- a/frontend/openapi/README.md
+++ b/frontend/openapi/README.md
@@ -1,4 +1,4 @@
-## @dres-openapi/api@1.0-SNAPSHOT.202102011224
+## @dres-openapi/api@1.0-SNAPSHOT.202102011229
### Building
@@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands.
_published:_
```
-npm install @dres-openapi/api@1.0-SNAPSHOT.202102011224 --save
+npm install @dres-openapi/api@1.0-SNAPSHOT.202102011229 --save
```
_without publishing (not recommended):_
diff --git a/frontend/openapi/model/competitionStartMessage.ts b/frontend/openapi/model/competitionStartMessage.ts
index 947000431..fd54694bd 100644
--- a/frontend/openapi/model/competitionStartMessage.ts
+++ b/frontend/openapi/model/competitionStartMessage.ts
@@ -20,8 +20,8 @@ export interface CompetitionStartMessage {
export namespace CompetitionStartMessage {
export type TypeEnum = 'SYNCHRONOUS' | 'ASYNCHRONOUS';
export const TypeEnum = {
- Synchronous: 'SYNCHRONOUS' as TypeEnum,
- Asynchronous: 'ASYNCHRONOUS' as TypeEnum
+ SYNCHRONOUS: 'SYNCHRONOUS' as TypeEnum,
+ ASYNCHRONOUS: 'ASYNCHRONOUS' as TypeEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionOptions.ts b/frontend/openapi/model/configuredOptionOptions.ts
index 78a281bae..d897c90b5 100644
--- a/frontend/openapi/model/configuredOptionOptions.ts
+++ b/frontend/openapi/model/configuredOptionOptions.ts
@@ -18,8 +18,8 @@ export interface ConfiguredOptionOptions {
export namespace ConfiguredOptionOptions {
export type OptionEnum = 'HIDDEN_RESULTS' | 'MAP_TO_SEGMENT';
export const OptionEnum = {
- HiddenResults: 'HIDDEN_RESULTS' as OptionEnum,
- MapToSegment: 'MAP_TO_SEGMENT' as OptionEnum
+ HIDDEN_RESULTS: 'HIDDEN_RESULTS' as OptionEnum,
+ MAP_TO_SEGMENT: 'MAP_TO_SEGMENT' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionQueryComponentType.ts b/frontend/openapi/model/configuredOptionQueryComponentType.ts
index 85b27302c..1375c4ca7 100644
--- a/frontend/openapi/model/configuredOptionQueryComponentType.ts
+++ b/frontend/openapi/model/configuredOptionQueryComponentType.ts
@@ -18,11 +18,11 @@ export interface ConfiguredOptionQueryComponentType {
export namespace ConfiguredOptionQueryComponentType {
export type OptionEnum = 'IMAGE_ITEM' | 'VIDEO_ITEM_SEGMENT' | 'TEXT' | 'EXTERNAL_IMAGE' | 'EXTERNAL_VIDEO';
export const OptionEnum = {
- ImageItem: 'IMAGE_ITEM' as OptionEnum,
- VideoItemSegment: 'VIDEO_ITEM_SEGMENT' as OptionEnum,
- Text: 'TEXT' as OptionEnum,
- ExternalImage: 'EXTERNAL_IMAGE' as OptionEnum,
- ExternalVideo: 'EXTERNAL_VIDEO' as OptionEnum
+ IMAGE_ITEM: 'IMAGE_ITEM' as OptionEnum,
+ VIDEO_ITEM_SEGMENT: 'VIDEO_ITEM_SEGMENT' as OptionEnum,
+ TEXT: 'TEXT' as OptionEnum,
+ EXTERNAL_IMAGE: 'EXTERNAL_IMAGE' as OptionEnum,
+ EXTERNAL_VIDEO: 'EXTERNAL_VIDEO' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionScoringType.ts b/frontend/openapi/model/configuredOptionScoringType.ts
index bd6c146f4..09495507d 100644
--- a/frontend/openapi/model/configuredOptionScoringType.ts
+++ b/frontend/openapi/model/configuredOptionScoringType.ts
@@ -18,8 +18,8 @@ export interface ConfiguredOptionScoringType {
export namespace ConfiguredOptionScoringType {
export type OptionEnum = 'KIS' | 'AVS';
export const OptionEnum = {
- Kis: 'KIS' as OptionEnum,
- Avs: 'AVS' as OptionEnum
+ KIS: 'KIS' as OptionEnum,
+ AVS: 'AVS' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionSubmissionFilterType.ts b/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
index c49c64c8e..0028bb7fa 100644
--- a/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
+++ b/frontend/openapi/model/configuredOptionSubmissionFilterType.ts
@@ -18,12 +18,12 @@ export interface ConfiguredOptionSubmissionFilterType {
export namespace ConfiguredOptionSubmissionFilterType {
export type OptionEnum = 'NO_DUPLICATES' | 'LIMIT_CORRECT_PER_TEAM' | 'LIMIT_WRONG_PER_TEAM' | 'LIMIT_TOTAL_PER_TEAM' | 'LIMIT_CORRECT_PER_MEMBER' | 'TEMPORAL_SUBMISSION';
export const OptionEnum = {
- NoDuplicates: 'NO_DUPLICATES' as OptionEnum,
- LimitCorrectPerTeam: 'LIMIT_CORRECT_PER_TEAM' as OptionEnum,
- LimitWrongPerTeam: 'LIMIT_WRONG_PER_TEAM' as OptionEnum,
- LimitTotalPerTeam: 'LIMIT_TOTAL_PER_TEAM' as OptionEnum,
- LimitCorrectPerMember: 'LIMIT_CORRECT_PER_MEMBER' as OptionEnum,
- TemporalSubmission: 'TEMPORAL_SUBMISSION' as OptionEnum
+ NO_DUPLICATES: 'NO_DUPLICATES' as OptionEnum,
+ LIMIT_CORRECT_PER_TEAM: 'LIMIT_CORRECT_PER_TEAM' as OptionEnum,
+ LIMIT_WRONG_PER_TEAM: 'LIMIT_WRONG_PER_TEAM' as OptionEnum,
+ LIMIT_TOTAL_PER_TEAM: 'LIMIT_TOTAL_PER_TEAM' as OptionEnum,
+ LIMIT_CORRECT_PER_MEMBER: 'LIMIT_CORRECT_PER_MEMBER' as OptionEnum,
+ TEMPORAL_SUBMISSION: 'TEMPORAL_SUBMISSION' as OptionEnum
};
}
diff --git a/frontend/openapi/model/configuredOptionTargetType.ts b/frontend/openapi/model/configuredOptionTargetType.ts
index 70a77884d..59ecb003d 100644
--- a/frontend/openapi/model/configuredOptionTargetType.ts
+++ b/frontend/openapi/model/configuredOptionTargetType.ts
@@ -18,10 +18,10 @@ export interface ConfiguredOptionTargetType {
export namespace ConfiguredOptionTargetType {
export type OptionEnum = 'SINGLE_MEDIA_ITEM' | 'SINGLE_MEDIA_SEGMENT' | 'MULTIPLE_MEDIA_ITEMS' | 'JUDGEMENT';
export const OptionEnum = {
- SingleMediaItem: 'SINGLE_MEDIA_ITEM' as OptionEnum,
- SingleMediaSegment: 'SINGLE_MEDIA_SEGMENT' as OptionEnum,
- MultipleMediaItems: 'MULTIPLE_MEDIA_ITEMS' as OptionEnum,
- Judgement: 'JUDGEMENT' as OptionEnum
+ SINGLE_MEDIA_ITEM: 'SINGLE_MEDIA_ITEM' as OptionEnum,
+ SINGLE_MEDIA_SEGMENT: 'SINGLE_MEDIA_SEGMENT' as OptionEnum,
+ MULTIPLE_MEDIA_ITEMS: 'MULTIPLE_MEDIA_ITEMS' as OptionEnum,
+ JUDGEMENT: 'JUDGEMENT' as OptionEnum
};
}
diff --git a/frontend/openapi/model/contentElement.ts b/frontend/openapi/model/contentElement.ts
index dc5e5063c..e43966e69 100644
--- a/frontend/openapi/model/contentElement.ts
+++ b/frontend/openapi/model/contentElement.ts
@@ -19,10 +19,10 @@ export interface ContentElement {
export namespace ContentElement {
export type ContentTypeEnum = 'EMPTY' | 'TEXT' | 'VIDEO' | 'IMAGE';
export const ContentTypeEnum = {
- Empty: 'EMPTY' as ContentTypeEnum,
- Text: 'TEXT' as ContentTypeEnum,
- Video: 'VIDEO' as ContentTypeEnum,
- Image: 'IMAGE' as ContentTypeEnum
+ EMPTY: 'EMPTY' as ContentTypeEnum,
+ TEXT: 'TEXT' as ContentTypeEnum,
+ VIDEO: 'VIDEO' as ContentTypeEnum,
+ IMAGE: 'IMAGE' as ContentTypeEnum
};
}
diff --git a/frontend/openapi/model/judgement.ts b/frontend/openapi/model/judgement.ts
index 15264c2c8..094e20574 100644
--- a/frontend/openapi/model/judgement.ts
+++ b/frontend/openapi/model/judgement.ts
@@ -19,10 +19,10 @@ export interface Judgement {
export namespace Judgement {
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- Correct: 'CORRECT' as VerdictEnum,
- Wrong: 'WRONG' as VerdictEnum,
- Indeterminate: 'INDETERMINATE' as VerdictEnum,
- Undecidable: 'UNDECIDABLE' as VerdictEnum
+ CORRECT: 'CORRECT' as VerdictEnum,
+ WRONG: 'WRONG' as VerdictEnum,
+ INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
+ UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
};
}
diff --git a/frontend/openapi/model/restAuditLogEntry.ts b/frontend/openapi/model/restAuditLogEntry.ts
index 4401c0e99..09bb27c98 100644
--- a/frontend/openapi/model/restAuditLogEntry.ts
+++ b/frontend/openapi/model/restAuditLogEntry.ts
@@ -19,16 +19,16 @@ export interface RestAuditLogEntry {
export namespace RestAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts b/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
index 1cd10ec10..428b695a0 100644
--- a/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
+++ b/frontend/openapi/model/restCompetitionEndAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestCompetitionEndAuditLogEntry {
export namespace RestCompetitionEndAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts b/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
index 4d0c24daa..a9d60b481 100644
--- a/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restCompetitionEndAuditLogEntryAllOf.ts
@@ -19,9 +19,9 @@ export interface RestCompetitionEndAuditLogEntryAllOf {
export namespace RestCompetitionEndAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts b/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
index 7767d3a97..daf17a831 100644
--- a/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
+++ b/frontend/openapi/model/restCompetitionStartAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestCompetitionStartAuditLogEntry {
export namespace RestCompetitionStartAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restJudgementAuditLogEntry.ts b/frontend/openapi/model/restJudgementAuditLogEntry.ts
index b05b34417..b5c5112a5 100644
--- a/frontend/openapi/model/restJudgementAuditLogEntry.ts
+++ b/frontend/openapi/model/restJudgementAuditLogEntry.ts
@@ -27,29 +27,29 @@ export interface RestJudgementAuditLogEntry {
export namespace RestJudgementAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- Correct: 'CORRECT' as VerdictEnum,
- Wrong: 'WRONG' as VerdictEnum,
- Indeterminate: 'INDETERMINATE' as VerdictEnum,
- Undecidable: 'UNDECIDABLE' as VerdictEnum
+ CORRECT: 'CORRECT' as VerdictEnum,
+ WRONG: 'WRONG' as VerdictEnum,
+ INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
+ UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts b/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
index eb673fe1d..8c1a629ec 100644
--- a/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restJudgementAuditLogEntryAllOf.ts
@@ -22,16 +22,16 @@ export interface RestJudgementAuditLogEntryAllOf {
export namespace RestJudgementAuditLogEntryAllOf {
export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const VerdictEnum = {
- Correct: 'CORRECT' as VerdictEnum,
- Wrong: 'WRONG' as VerdictEnum,
- Indeterminate: 'INDETERMINATE' as VerdictEnum,
- Undecidable: 'UNDECIDABLE' as VerdictEnum
+ CORRECT: 'CORRECT' as VerdictEnum,
+ WRONG: 'WRONG' as VerdictEnum,
+ INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
+ UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLoginAuditLogEntry.ts b/frontend/openapi/model/restLoginAuditLogEntry.ts
index 5e56fec3d..a61996842 100644
--- a/frontend/openapi/model/restLoginAuditLogEntry.ts
+++ b/frontend/openapi/model/restLoginAuditLogEntry.ts
@@ -24,22 +24,22 @@ export interface RestLoginAuditLogEntry {
export namespace RestLoginAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts b/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
index b538e02ea..457c1f6cb 100644
--- a/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restLoginAuditLogEntryAllOf.ts
@@ -19,9 +19,9 @@ export interface RestLoginAuditLogEntryAllOf {
export namespace RestLoginAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLogoutAuditLogEntry.ts b/frontend/openapi/model/restLogoutAuditLogEntry.ts
index efda7b671..656b40fd7 100644
--- a/frontend/openapi/model/restLogoutAuditLogEntry.ts
+++ b/frontend/openapi/model/restLogoutAuditLogEntry.ts
@@ -23,22 +23,22 @@ export interface RestLogoutAuditLogEntry {
export namespace RestLogoutAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts b/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
index 4259dd854..968d5c82a 100644
--- a/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restLogoutAuditLogEntryAllOf.ts
@@ -18,9 +18,9 @@ export interface RestLogoutAuditLogEntryAllOf {
export namespace RestLogoutAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restMediaItem.ts b/frontend/openapi/model/restMediaItem.ts
index af0aaf10f..867b6b5b9 100644
--- a/frontend/openapi/model/restMediaItem.ts
+++ b/frontend/openapi/model/restMediaItem.ts
@@ -23,8 +23,8 @@ export interface RestMediaItem {
export namespace RestMediaItem {
export type TypeEnum = 'IMAGE' | 'VIDEO';
export const TypeEnum = {
- Image: 'IMAGE' as TypeEnum,
- Video: 'VIDEO' as TypeEnum
+ IMAGE: 'IMAGE' as TypeEnum,
+ VIDEO: 'VIDEO' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts b/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
index df4b98111..dc7866aaa 100644
--- a/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
+++ b/frontend/openapi/model/restPrepareJudgementAuditLogEntry.ts
@@ -25,16 +25,16 @@ export interface RestPrepareJudgementAuditLogEntry {
export namespace RestPrepareJudgementAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restSubmissionAuditLogEntry.ts b/frontend/openapi/model/restSubmissionAuditLogEntry.ts
index cec5f0f7e..6b38a01df 100644
--- a/frontend/openapi/model/restSubmissionAuditLogEntry.ts
+++ b/frontend/openapi/model/restSubmissionAuditLogEntry.ts
@@ -28,22 +28,22 @@ export interface RestSubmissionAuditLogEntry {
export namespace RestSubmissionAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts b/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
index 4f5cdec49..c22872591 100644
--- a/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restSubmissionAuditLogEntryAllOf.ts
@@ -23,9 +23,9 @@ export interface RestSubmissionAuditLogEntryAllOf {
export namespace RestSubmissionAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskDescriptionComponent.ts b/frontend/openapi/model/restTaskDescriptionComponent.ts
index c89faf21d..4614ca9b9 100644
--- a/frontend/openapi/model/restTaskDescriptionComponent.ts
+++ b/frontend/openapi/model/restTaskDescriptionComponent.ts
@@ -25,11 +25,11 @@ export interface RestTaskDescriptionComponent {
export namespace RestTaskDescriptionComponent {
export type TypeEnum = 'IMAGE_ITEM' | 'VIDEO_ITEM_SEGMENT' | 'TEXT' | 'EXTERNAL_IMAGE' | 'EXTERNAL_VIDEO';
export const TypeEnum = {
- ImageItem: 'IMAGE_ITEM' as TypeEnum,
- VideoItemSegment: 'VIDEO_ITEM_SEGMENT' as TypeEnum,
- Text: 'TEXT' as TypeEnum,
- ExternalImage: 'EXTERNAL_IMAGE' as TypeEnum,
- ExternalVideo: 'EXTERNAL_VIDEO' as TypeEnum
+ IMAGE_ITEM: 'IMAGE_ITEM' as TypeEnum,
+ VIDEO_ITEM_SEGMENT: 'VIDEO_ITEM_SEGMENT' as TypeEnum,
+ TEXT: 'TEXT' as TypeEnum,
+ EXTERNAL_IMAGE: 'EXTERNAL_IMAGE' as TypeEnum,
+ EXTERNAL_VIDEO: 'EXTERNAL_VIDEO' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restTaskDescriptionTarget.ts b/frontend/openapi/model/restTaskDescriptionTarget.ts
index 6c446ae01..d014943e9 100644
--- a/frontend/openapi/model/restTaskDescriptionTarget.ts
+++ b/frontend/openapi/model/restTaskDescriptionTarget.ts
@@ -19,10 +19,10 @@ export interface RestTaskDescriptionTarget {
export namespace RestTaskDescriptionTarget {
export type TypeEnum = 'SINGLE_MEDIA_ITEM' | 'SINGLE_MEDIA_SEGMENT' | 'MULTIPLE_MEDIA_ITEMS' | 'JUDGEMENT';
export const TypeEnum = {
- SingleMediaItem: 'SINGLE_MEDIA_ITEM' as TypeEnum,
- SingleMediaSegment: 'SINGLE_MEDIA_SEGMENT' as TypeEnum,
- MultipleMediaItems: 'MULTIPLE_MEDIA_ITEMS' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum
+ SINGLE_MEDIA_ITEM: 'SINGLE_MEDIA_ITEM' as TypeEnum,
+ SINGLE_MEDIA_SEGMENT: 'SINGLE_MEDIA_SEGMENT' as TypeEnum,
+ MULTIPLE_MEDIA_ITEMS: 'MULTIPLE_MEDIA_ITEMS' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum
};
}
diff --git a/frontend/openapi/model/restTaskEndAuditLogEntry.ts b/frontend/openapi/model/restTaskEndAuditLogEntry.ts
index 469eb0b9e..c990080ba 100644
--- a/frontend/openapi/model/restTaskEndAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskEndAuditLogEntry.ts
@@ -25,22 +25,22 @@ export interface RestTaskEndAuditLogEntry {
export namespace RestTaskEndAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts b/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
index b72154975..5337e4152 100644
--- a/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restTaskEndAuditLogEntryAllOf.ts
@@ -20,9 +20,9 @@ export interface RestTaskEndAuditLogEntryAllOf {
export namespace RestTaskEndAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts b/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
index f7f3d46d0..d5e271e99 100644
--- a/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskModifiedAuditLogEntry.ts
@@ -26,22 +26,22 @@ export interface RestTaskModifiedAuditLogEntry {
export namespace RestTaskModifiedAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts b/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
index 9a44d3d7d..0f5087704 100644
--- a/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
+++ b/frontend/openapi/model/restTaskModifiedAuditLogEntryAllOf.ts
@@ -21,9 +21,9 @@ export interface RestTaskModifiedAuditLogEntryAllOf {
export namespace RestTaskModifiedAuditLogEntryAllOf {
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/restTaskStartAuditLogEntry.ts b/frontend/openapi/model/restTaskStartAuditLogEntry.ts
index 76acf8c66..904c7230e 100644
--- a/frontend/openapi/model/restTaskStartAuditLogEntry.ts
+++ b/frontend/openapi/model/restTaskStartAuditLogEntry.ts
@@ -25,22 +25,22 @@ export interface RestTaskStartAuditLogEntry {
export namespace RestTaskStartAuditLogEntry {
export type TypeEnum = 'COMPETITION_START' | 'COMPETITION_END' | 'TASK_START' | 'TASK_MODIFIED' | 'TASK_END' | 'SUBMISSION' | 'PREPARE_JUDGEMENT' | 'JUDGEMENT' | 'LOGIN' | 'LOGOUT';
export const TypeEnum = {
- CompetitionStart: 'COMPETITION_START' as TypeEnum,
- CompetitionEnd: 'COMPETITION_END' as TypeEnum,
- TaskStart: 'TASK_START' as TypeEnum,
- TaskModified: 'TASK_MODIFIED' as TypeEnum,
- TaskEnd: 'TASK_END' as TypeEnum,
- Submission: 'SUBMISSION' as TypeEnum,
- PrepareJudgement: 'PREPARE_JUDGEMENT' as TypeEnum,
- Judgement: 'JUDGEMENT' as TypeEnum,
- Login: 'LOGIN' as TypeEnum,
- Logout: 'LOGOUT' as TypeEnum
+ COMPETITION_START: 'COMPETITION_START' as TypeEnum,
+ COMPETITION_END: 'COMPETITION_END' as TypeEnum,
+ TASK_START: 'TASK_START' as TypeEnum,
+ TASK_MODIFIED: 'TASK_MODIFIED' as TypeEnum,
+ TASK_END: 'TASK_END' as TypeEnum,
+ SUBMISSION: 'SUBMISSION' as TypeEnum,
+ PREPARE_JUDGEMENT: 'PREPARE_JUDGEMENT' as TypeEnum,
+ JUDGEMENT: 'JUDGEMENT' as TypeEnum,
+ LOGIN: 'LOGIN' as TypeEnum,
+ LOGOUT: 'LOGOUT' as TypeEnum
};
export type ApiEnum = 'REST' | 'CLI' | 'INTERNAL';
export const ApiEnum = {
- Rest: 'REST' as ApiEnum,
- Cli: 'CLI' as ApiEnum,
- Internal: 'INTERNAL' as ApiEnum
+ REST: 'REST' as ApiEnum,
+ CLI: 'CLI' as ApiEnum,
+ INTERNAL: 'INTERNAL' as ApiEnum
};
}
diff --git a/frontend/openapi/model/runState.ts b/frontend/openapi/model/runState.ts
index 162a2ddc7..a2751e9ab 100644
--- a/frontend/openapi/model/runState.ts
+++ b/frontend/openapi/model/runState.ts
@@ -21,12 +21,12 @@ export interface RunState {
export namespace RunState {
export type StatusEnum = 'CREATED' | 'ACTIVE' | 'PREPARING_TASK' | 'RUNNING_TASK' | 'TASK_ENDED' | 'TERMINATED';
export const StatusEnum = {
- Created: 'CREATED' as StatusEnum,
- Active: 'ACTIVE' as StatusEnum,
- PreparingTask: 'PREPARING_TASK' as StatusEnum,
- RunningTask: 'RUNNING_TASK' as StatusEnum,
- TaskEnded: 'TASK_ENDED' as StatusEnum,
- Terminated: 'TERMINATED' as StatusEnum
+ CREATED: 'CREATED' as StatusEnum,
+ ACTIVE: 'ACTIVE' as StatusEnum,
+ PREPARING_TASK: 'PREPARING_TASK' as StatusEnum,
+ RUNNING_TASK: 'RUNNING_TASK' as StatusEnum,
+ TASK_ENDED: 'TASK_ENDED' as StatusEnum,
+ TERMINATED: 'TERMINATED' as StatusEnum
};
}
diff --git a/frontend/openapi/model/submissionInfo.ts b/frontend/openapi/model/submissionInfo.ts
index 156f64f6a..384fb10a6 100644
--- a/frontend/openapi/model/submissionInfo.ts
+++ b/frontend/openapi/model/submissionInfo.ts
@@ -25,10 +25,10 @@ export interface SubmissionInfo {
export namespace SubmissionInfo {
export type StatusEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
export const StatusEnum = {
- Correct: 'CORRECT' as StatusEnum,
- Wrong: 'WRONG' as StatusEnum,
- Indeterminate: 'INDETERMINATE' as StatusEnum,
- Undecidable: 'UNDECIDABLE' as StatusEnum
+ CORRECT: 'CORRECT' as StatusEnum,
+ WRONG: 'WRONG' as StatusEnum,
+ INDETERMINATE: 'INDETERMINATE' as StatusEnum,
+ UNDECIDABLE: 'UNDECIDABLE' as StatusEnum
};
}
diff --git a/frontend/openapi/model/temporalPoint.ts b/frontend/openapi/model/temporalPoint.ts
index 0a2d6c8ae..0d0d162ed 100644
--- a/frontend/openapi/model/temporalPoint.ts
+++ b/frontend/openapi/model/temporalPoint.ts
@@ -18,9 +18,9 @@ export interface TemporalPoint {
export namespace TemporalPoint {
export type UnitEnum = 'FRAME_NUMBER' | 'SECONDS' | 'MILLISECONDS';
export const UnitEnum = {
- FrameNumber: 'FRAME_NUMBER' as UnitEnum,
- Seconds: 'SECONDS' as UnitEnum,
- Milliseconds: 'MILLISECONDS' as UnitEnum
+ FRAME_NUMBER: 'FRAME_NUMBER' as UnitEnum,
+ SECONDS: 'SECONDS' as UnitEnum,
+ MILLISECONDS: 'MILLISECONDS' as UnitEnum
};
}
diff --git a/frontend/openapi/model/userDetails.ts b/frontend/openapi/model/userDetails.ts
index ba1529701..a5a0d9b7e 100644
--- a/frontend/openapi/model/userDetails.ts
+++ b/frontend/openapi/model/userDetails.ts
@@ -20,10 +20,10 @@ export interface UserDetails {
export namespace UserDetails {
export type RoleEnum = 'ADMIN' | 'JUDGE' | 'VIEWER' | 'PARTICIPANT';
export const RoleEnum = {
- Admin: 'ADMIN' as RoleEnum,
- Judge: 'JUDGE' as RoleEnum,
- Viewer: 'VIEWER' as RoleEnum,
- Participant: 'PARTICIPANT' as RoleEnum
+ ADMIN: 'ADMIN' as RoleEnum,
+ JUDGE: 'JUDGE' as RoleEnum,
+ VIEWER: 'VIEWER' as RoleEnum,
+ PARTICIPANT: 'PARTICIPANT' as RoleEnum
};
}
diff --git a/frontend/openapi/model/userRequest.ts b/frontend/openapi/model/userRequest.ts
index 4a5b50b20..55b011274 100644
--- a/frontend/openapi/model/userRequest.ts
+++ b/frontend/openapi/model/userRequest.ts
@@ -19,10 +19,10 @@ export interface UserRequest {
export namespace UserRequest {
export type RoleEnum = 'ADMIN' | 'JUDGE' | 'VIEWER' | 'PARTICIPANT';
export const RoleEnum = {
- Admin: 'ADMIN' as RoleEnum,
- Judge: 'JUDGE' as RoleEnum,
- Viewer: 'VIEWER' as RoleEnum,
- Participant: 'PARTICIPANT' as RoleEnum
+ ADMIN: 'ADMIN' as RoleEnum,
+ JUDGE: 'JUDGE' as RoleEnum,
+ VIEWER: 'VIEWER' as RoleEnum,
+ PARTICIPANT: 'PARTICIPANT' as RoleEnum
};
}
diff --git a/frontend/openapi/package.json b/frontend/openapi/package.json
index bacea750e..ac4468e9b 100644
--- a/frontend/openapi/package.json
+++ b/frontend/openapi/package.json
@@ -1,6 +1,6 @@
{
"name": "@dres-openapi/api",
- "version": "1.0-SNAPSHOT.202102011224",
+ "version": "1.0-SNAPSHOT.202102011229",
"description": "OpenAPI client for @dres-openapi/api",
"author": "OpenAPI-Generator Contributors",
"keywords": [
diff --git a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.ts b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.ts
index 832df9539..f602106a7 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.ts
+++ b/frontend/src/app/competition/competition-builder/competition-builder-task-dialog/competition-builder-task-dialog.component.ts
@@ -276,7 +276,7 @@ export class CompetitionBuilderTaskDialogComponent {
this.builder.removeTargetForm(0);
const mediaCollectionId = this.builder.form.get('mediaCollection').value;
r.forEach((name, idx) => {
- const form = this.builder.addTargetForm(ConfiguredOptionTargetType.OptionEnum.MULTIPLEMEDIAITEMS);
+ const form = this.builder.addTargetForm(ConfiguredOptionTargetType.OptionEnum.MULTIPLE_MEDIA_ITEMS);
console.log(`${mediaCollectionId} ? ${name}`);
const nameNoExt = name.substring(0, name.lastIndexOf('.'));
this.collectionService.getApiCollectionWithCollectionidWithStartswith(mediaCollectionId, nameNoExt)
diff --git a/frontend/src/app/competition/competition-builder/competition-builder.component.ts b/frontend/src/app/competition/competition-builder/competition-builder.component.ts
index 347887dc2..f5e4db55f 100644
--- a/frontend/src/app/competition/competition-builder/competition-builder.component.ts
+++ b/frontend/src/app/competition/competition-builder/competition-builder.component.ts
@@ -45,18 +45,18 @@ export class CompetitionBuilderComponent implements OnInit, OnDestroy, Deactivat
public static TKIS_TEMPLATE = {
name: 'Textual KIS',
taskDuration: 420,
- targetType: {option: ConfiguredOptionTargetType.OptionEnum.SINGLEMEDIASEGMENT, parameters: {}},
+ targetType: {option: ConfiguredOptionTargetType.OptionEnum.SINGLE_MEDIA_SEGMENT, parameters: {}},
score: {option: ConfiguredOptionScoringType.OptionEnum.KIS, parameters: {}},
components: [
{option: ConfiguredOptionQueryComponentType.OptionEnum.TEXT, parameters: {}}
],
filter: [
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NODUPLICATES, parameters: {}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMITCORRECTPERTEAM, parameters: {limit: 1}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORALSUBMISSION, parameters: {}}
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NO_DUPLICATES, parameters: {}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMIT_CORRECT_PER_TEAM, parameters: {limit: 1}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORAL_SUBMISSION, parameters: {}}
],
options: [
- {option: ConfiguredOptionOptions.OptionEnum.HIDDENRESULTS, parameters: {}},
+ {option: ConfiguredOptionOptions.OptionEnum.HIDDEN_RESULTS, parameters: {}},
]
} as TaskType;
@@ -66,15 +66,15 @@ export class CompetitionBuilderComponent implements OnInit, OnDestroy, Deactivat
public static VKIS_TEMPLATE = {
name: 'Visual KIS',
taskDuration: 300,
- targetType: {option: ConfiguredOptionTargetType.OptionEnum.SINGLEMEDIASEGMENT, parameters: {}},
+ targetType: {option: ConfiguredOptionTargetType.OptionEnum.SINGLE_MEDIA_SEGMENT, parameters: {}},
score: {option: ConfiguredOptionScoringType.OptionEnum.KIS, parameters: {}},
components: [
- {option: ConfiguredOptionQueryComponentType.OptionEnum.VIDEOITEMSEGMENT, parameters: {}}
+ {option: ConfiguredOptionQueryComponentType.OptionEnum.VIDEO_ITEM_SEGMENT, parameters: {}}
],
filter: [
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NODUPLICATES, parameters: {}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMITCORRECTPERTEAM, parameters: {limit: 1}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORALSUBMISSION, parameters: {}}
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NO_DUPLICATES, parameters: {}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMIT_CORRECT_PER_TEAM, parameters: {limit: 1}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORAL_SUBMISSION, parameters: {}}
],
options: []
} as TaskType;
@@ -91,11 +91,11 @@ export class CompetitionBuilderComponent implements OnInit, OnDestroy, Deactivat
{option: ConfiguredOptionQueryComponentType.OptionEnum.TEXT, parameters: {}}
],
filter: [
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NODUPLICATES, parameters: {limit: 1}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORALSUBMISSION, parameters: {}}
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NO_DUPLICATES, parameters: {limit: 1}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.TEMPORAL_SUBMISSION, parameters: {}}
],
options: [
- {option: ConfiguredOptionOptions.OptionEnum.MAPTOSEGMENT, parameters: {}}
+ {option: ConfiguredOptionOptions.OptionEnum.MAP_TO_SEGMENT, parameters: {}}
]
} as TaskType;
@@ -105,17 +105,17 @@ export class CompetitionBuilderComponent implements OnInit, OnDestroy, Deactivat
public static LSC_TEMPLATE = {
name: 'LSC',
taskDuration: 300,
- targetType: {option: ConfiguredOptionTargetType.OptionEnum.MULTIPLEMEDIAITEMS, parameters: {}},
+ targetType: {option: ConfiguredOptionTargetType.OptionEnum.MULTIPLE_MEDIA_ITEMS, parameters: {}},
score: {option: ConfiguredOptionScoringType.OptionEnum.KIS, parameters: {}},
components: [
{option: ConfiguredOptionQueryComponentType.OptionEnum.TEXT, parameters: {}}
],
filter: [
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NODUPLICATES, parameters: {}},
- {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMITCORRECTPERTEAM, parameters: {}}
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.NO_DUPLICATES, parameters: {}},
+ {option: ConfiguredOptionSubmissionFilterType.OptionEnum.LIMIT_CORRECT_PER_TEAM, parameters: {}}
],
options: [
- {option: ConfiguredOptionOptions.OptionEnum.HIDDENRESULTS, parameters: {}}
+ {option: ConfiguredOptionOptions.OptionEnum.HIDDEN_RESULTS, parameters: {}}
]
} as TaskType;
@@ -309,7 +309,7 @@ export class CompetitionBuilderComponent implements OnInit, OnDestroy, Deactivat
data: {
taskGroup: this.competition.taskGroups.find(g => g.name === task.taskGroup),
taskType: this.competition.taskTypes.find(g => g.name === task.taskType),
- task: task
+ task
} as CompetitionBuilderTaskDialogData, width: `${width}px`
}
);
From 912fcc5ca403b2e129cc2cb0889a9d589bee88a3 Mon Sep 17 00:00:00 2001
From: Loris Sauter
Date: Mon, 1 Feb 2021 18:33:57 +0100
Subject: [PATCH 07/95] #224 Fixed broken client gen
---
backend/build.gradle | 6 +-
backend/src/main/kotlin/dev/dres/DRES.kt | 8 ++-
.../src/main/kotlin/dev/dres/api/cli/Cli.kt | 60 +++++++++++--------
.../kotlin/dev/dres/api/cli/OpenApiCommand.kt | 50 ++++++++++++++++
.../main/kotlin/dev/dres/api/rest/RestApi.kt | 6 ++
5 files changed, 103 insertions(+), 27 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/api/cli/OpenApiCommand.kt
diff --git a/backend/build.gradle b/backend/build.gradle
index 03d44e255..71d597873 100644
--- a/backend/build.gradle
+++ b/backend/build.gradle
@@ -53,7 +53,8 @@ openApiGenerate {
configOptions = [
npmName: '@dres-openapi/api',
ngVersion: '9.1.0',
- snapshot: 'true' /// I suggest to remove this, as soon as we automate this
+ snapshot: 'true', /// I suggest to remove this, as soon as we automate this,
+ enumPropertyNaming: 'original'
]
}
@@ -109,6 +110,9 @@ dependencies {
///// Picnic
compile group: 'com.jakewharton.picnic', name: 'picnic', version: '0.3.1'
+ ///// Fuel
+ compile group: 'com.github.kittinunf.fuel', name: 'fuel', version: '2.3.1'
+
////// CSV
compile group: 'com.github.doyaaaaaken', name: 'kotlin-csv-jvm', version: '0.7.3'
diff --git a/backend/src/main/kotlin/dev/dres/DRES.kt b/backend/src/main/kotlin/dev/dres/DRES.kt
index 445a32713..61edf184c 100644
--- a/backend/src/main/kotlin/dev/dres/DRES.kt
+++ b/backend/src/main/kotlin/dev/dres/DRES.kt
@@ -1,6 +1,7 @@
package dev.dres
import dev.dres.api.cli.Cli
+import dev.dres.api.cli.OpenApiCommand
import dev.dres.api.rest.RestApi
import dev.dres.data.dbo.DataAccessLayer
import dev.dres.data.model.Config
@@ -53,7 +54,12 @@ object DRES {
println("done")
- Cli.loop(dataAccessLayer, config) //blocks until quit command is given
+ if(args.first() == "openapi"){
+ OpenApiCommand().parse(args)
+ }else{
+ Cli.loop(dataAccessLayer, config) //blocks until quit command is given
+ }
+
RestApi.stop()
RunExecutor.stop()
EventStreamProcessor.stop()
diff --git a/backend/src/main/kotlin/dev/dres/api/cli/Cli.kt b/backend/src/main/kotlin/dev/dres/api/cli/Cli.kt
index 87f1c2419..7429b02d2 100644
--- a/backend/src/main/kotlin/dev/dres/api/cli/Cli.kt
+++ b/backend/src/main/kotlin/dev/dres/api/cli/Cli.kt
@@ -30,15 +30,18 @@ object Cli {
fun loop(dataAccessLayer: DataAccessLayer, config: Config) {
val clikt = DRESBaseCommand().subcommands(
- CompetitionCommand(dataAccessLayer.competitions, dataAccessLayer.collections, config),
- UserCommand(),
- MediaCollectionCommand(
- dataAccessLayer.collections,
- dataAccessLayer.mediaItems,
- dataAccessLayer.mediaItemPathIndex,
- dataAccessLayer.mediaItemCollectionIndex,
- dataAccessLayer.mediaSegments),
- CompetitionRunCommand(dataAccessLayer.runs))
+ CompetitionCommand(dataAccessLayer.competitions, dataAccessLayer.collections, config),
+ UserCommand(),
+ MediaCollectionCommand(
+ dataAccessLayer.collections,
+ dataAccessLayer.mediaItems,
+ dataAccessLayer.mediaItemPathIndex,
+ dataAccessLayer.mediaItemCollectionIndex,
+ dataAccessLayer.mediaSegments
+ ),
+ CompetitionRunCommand(dataAccessLayer.runs),
+ OpenApiCommand()
+ )
var terminal: Terminal? = null
try {
@@ -50,7 +53,8 @@ object Cli {
System.exit(-1)
}
- val completer = DelegateCompleter(AggregateCompleter(
+ val completer = DelegateCompleter(
+ AggregateCompleter(
StringsCompleter("quit", "exit", "help"),
// Based on https://github.com/jline/jline3/wiki/Completion
// However, this is not working as subcommands are not completed
@@ -67,16 +71,18 @@ object Cli {
),*/
// Pseudo-solution. Not ideal, as all subcommands are flattened
AggregateCompleter(
- StringsCompleter(clikt.registeredSubcommandNames()),
- StringsCompleter(clikt.registeredSubcommands().flatMap { it.registeredSubcommandNames() })
+ StringsCompleter(clikt.registeredSubcommandNames()),
+ StringsCompleter(
+ clikt.registeredSubcommands().flatMap { it.registeredSubcommandNames() })
),
Completers.FileNameCompleter()
- ))
+ )
+ )
val lineReader = LineReaderBuilder.builder()
- .terminal(terminal)
- .completer(completer)
- .build()
+ .terminal(terminal)
+ .completer(completer)
+ .build()
while (true) {
@@ -88,7 +94,7 @@ object Cli {
println(clikt.getFormattedHelp()) //TODO overwrite with something more useful in a cli context
continue
}
- if (line.isBlank()){
+ if (line.isBlank()) {
continue
}
@@ -135,10 +141,10 @@ object Cli {
return matchList
}
- class DRESBaseCommand : NoOpCliktCommand(name = "dres"){
+ class DRESBaseCommand : NoOpCliktCommand(name = "dres") {
init {
- context { helpFormatter = CliHelpFormatter()}
+ context { helpFormatter = CliHelpFormatter() }
}
}
@@ -147,18 +153,22 @@ object Cli {
* Delegate for [Completer] to dynamically exchange and / or adapt a completer.
* Delegates incoming completion requests to the delegate
*/
- class DelegateCompleter(var delegate: Completer):Completer{
- override fun complete(reader: LineReader?, line: ParsedLine?, candidates: MutableList?) {
+ class DelegateCompleter(var delegate: Completer) : Completer {
+ override fun complete(
+ reader: LineReader?,
+ line: ParsedLine?,
+ candidates: MutableList?
+ ) {
delegate.complete(reader, line, candidates)
}
}
class CliHelpFormatter : CliktHelpFormatter() {
override fun formatHelp(
- prolog: String,
- epilog: String,
- parameters: List,
- programName: String
+ prolog: String,
+ epilog: String,
+ parameters: List,
+ programName: String
) = buildString {
addOptions(parameters)
addArguments(parameters)
diff --git a/backend/src/main/kotlin/dev/dres/api/cli/OpenApiCommand.kt b/backend/src/main/kotlin/dev/dres/api/cli/OpenApiCommand.kt
new file mode 100644
index 000000000..05f083d4a
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/api/cli/OpenApiCommand.kt
@@ -0,0 +1,50 @@
+package dev.dres.api.cli
+
+import com.github.ajalt.clikt.core.CliktCommand
+import com.github.ajalt.clikt.parameters.options.default
+import com.github.ajalt.clikt.parameters.options.flag
+import com.github.ajalt.clikt.parameters.options.option
+import com.github.ajalt.clikt.parameters.types.file
+import com.github.kittinunf.fuel.Fuel
+import dev.dres.api.rest.OpenApiEndpointOptions
+import dev.dres.api.rest.RestApi
+import io.swagger.util.Json
+import java.io.File
+
+class OpenApiCommand : CliktCommand(name="openapi",help = "Generates and writes the OpenAPI Specifications") {
+
+ /** Defaults to only write internal OpenApi Specification (OAS) */
+ val internalOnly: Boolean by option("--dres", "--internal-only").flag("--all", default=true)
+
+ val verbose: Boolean by option("-v", "--verbose").flag("--quiet", "-q", default=false)
+
+ val output: File by option("-o", "--out").file().default(File("build/api"))
+
+ override fun run() {
+ // Do we download the client lib as well?
+ if(!internalOnly){
+ downloadOas(OpenApiEndpointOptions.dresSubmittingClientOptions, output)
+ }
+ downloadOas(OpenApiEndpointOptions.dresDefaultOptions, output)
+ }
+
+ private fun downloadOas(oas: OpenApiEndpointOptions, dir: File){
+ val src = "http://localhost:8080"+oas.oasPath
+ vprintln("Downloading from $src")
+ val fileName = oas.oasPath.substring(1)+".json" // Remove "/" from name and add ".json"
+ Fuel.download(src)
+ .fileDestination { response, request -> dir.resolve(fileName) }
+ .progress{readBytes, totalBytes ->
+ val progress = readBytes.toFloat() / totalBytes.toFloat() * 100
+ vprintln("Bytes downloaded $readBytes / $totalBytes ($progress %)")
+ }
+ vprintln("Finished from $src")
+ }
+
+ private fun vprintln(str:String){
+ if(verbose){
+ println(str)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/RestApi.kt b/backend/src/main/kotlin/dev/dres/api/rest/RestApi.kt
index fb9a46309..82ca56b3a 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/RestApi.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/RestApi.kt
@@ -29,9 +29,15 @@ object RestApi {
private var javalin: Javalin? = null
+ private lateinit var openApiPlugin: OpenApiPlugin
+
private val logMarker = MarkerFactory.getMarker("REST")
private val logger = LoggerFactory.getLogger(this.javaClass)
+ fun getOpenApiPlugin(): OpenApiPlugin {
+ return openApiPlugin
+ }
+
fun init(config: Config, dataAccessLayer: DataAccessLayer) {
val runExecutor = RunExecutor
From 6fe5d5bc0e4e910325ee74fb181a7f6f52305bca Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Mon, 1 Feb 2021 18:39:49 +0100
Subject: [PATCH 08/95] Added missing OpenApi annotation to handler
---
.gitignore | 2 +
backend/src/main/kotlin/dev/dres/DRES.kt | 2 +-
.../dres/api/rest/handler/JudgementHandler.kt | 13 ++
frontend/openapi/.openapi-generator/FILES | 188 +++++++++---------
frontend/openapi/README.md | 4 +-
frontend/openapi/api.module.ts | 1 -
frontend/openapi/api/api.ts | 4 +-
frontend/openapi/api/judgement.service.ts | 57 ++++++
frontend/openapi/api/log.service.ts | 38 +++-
frontend/openapi/api/submission.service.ts | 16 +-
frontend/openapi/api/user.service.ts | 46 +++--
frontend/openapi/model/judgementVote.ts | 27 +++
frontend/openapi/model/models.ts | 1 +
frontend/openapi/package.json | 2 +-
14 files changed, 275 insertions(+), 126 deletions(-)
create mode 100644 frontend/openapi/model/judgementVote.ts
diff --git a/.gitignore b/.gitignore
index 0b377016b..4775b55c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -265,3 +265,5 @@ nodejs
npm-*
backend/ext/ffmpeg
events/
+backend/data*
+backend/statistics
diff --git a/backend/src/main/kotlin/dev/dres/DRES.kt b/backend/src/main/kotlin/dev/dres/DRES.kt
index 61edf184c..8466fede3 100644
--- a/backend/src/main/kotlin/dev/dres/DRES.kt
+++ b/backend/src/main/kotlin/dev/dres/DRES.kt
@@ -54,7 +54,7 @@ object DRES {
println("done")
- if(args.first() == "openapi"){
+ if(args.isNotEmpty() && args.first() == "openapi"){
OpenApiCommand().parse(args)
}else{
Cli.loop(dataAccessLayer, config) //blocks until quit command is given
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/JudgementHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/JudgementHandler.kt
index cab64a434..6917e05e7 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/JudgementHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/JudgementHandler.kt
@@ -139,6 +139,19 @@ class JudgementVoteHandler : PostRestHandler {
override val route = "run/:runId/judge/vote"
+ @OpenApi(
+ summary = "Returns a Vote.",
+ path = "/api/run/:runId/judge/vote", method = HttpMethod.POST,
+ pathParams = [OpenApiParam("runId", dev.dres.data.model.UID::class, "Run ID")],
+ requestBody = OpenApiRequestBody([OpenApiContent(JudgementVote::class)]),
+ tags = ["Judgement"],
+ responses = [
+ OpenApiResponse("200", [OpenApiContent(SuccessStatus::class)]),
+ OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)]),
+ OpenApiResponse("401", [OpenApiContent(ErrorStatus::class)]),
+ OpenApiResponse("404", [OpenApiContent(ErrorStatus::class)])
+ ]
+ )
override fun doPost(ctx: Context): SuccessStatus {
val runId = try{
diff --git a/frontend/openapi/.openapi-generator/FILES b/frontend/openapi/.openapi-generator/FILES
index e2e19e787..21754f19f 100644
--- a/frontend/openapi/.openapi-generator/FILES
+++ b/frontend/openapi/.openapi-generator/FILES
@@ -1,94 +1,94 @@
-.gitignore
-README.md
-api.module.ts
-api/api.ts
-api/audit.service.ts
-api/collection.service.ts
-api/competition.service.ts
-api/competitionRun.service.ts
-api/competitionRunAdmin.service.ts
-api/competitionRunScores.service.ts
-api/default.service.ts
-api/judgement.service.ts
-api/log.service.ts
-api/status.service.ts
-api/submission.service.ts
-api/user.service.ts
-configuration.ts
-encoder.ts
-git_push.sh
-index.ts
-model/auditLogInfo.ts
-model/competitionCreate.ts
-model/competitionOverview.ts
-model/competitionStartMessage.ts
-model/configuredOptionOptions.ts
-model/configuredOptionQueryComponentType.ts
-model/configuredOptionScoringType.ts
-model/configuredOptionSubmissionFilterType.ts
-model/configuredOptionTargetType.ts
-model/contentElement.ts
-model/currentTime.ts
-model/errorStatus.ts
-model/judgement.ts
-model/judgementRequest.ts
-model/judgementValidatorStatus.ts
-model/loginRequest.ts
-model/models.ts
-model/queryEvent.ts
-model/queryEventLog.ts
-model/queryResult.ts
-model/queryResultLog.ts
-model/restAuditLogEntry.ts
-model/restCompetitionDescription.ts
-model/restCompetitionEndAuditLogEntry.ts
-model/restCompetitionEndAuditLogEntryAllOf.ts
-model/restCompetitionStartAuditLogEntry.ts
-model/restDetailedTeam.ts
-model/restFullMediaCollection.ts
-model/restJudgementAuditLogEntry.ts
-model/restJudgementAuditLogEntryAllOf.ts
-model/restLoginAuditLogEntry.ts
-model/restLoginAuditLogEntryAllOf.ts
-model/restLogoutAuditLogEntry.ts
-model/restLogoutAuditLogEntryAllOf.ts
-model/restMediaCollection.ts
-model/restMediaItem.ts
-model/restPrepareJudgementAuditLogEntry.ts
-model/restPrepareJudgementAuditLogEntryAllOf.ts
-model/restSubmissionAuditLogEntry.ts
-model/restSubmissionAuditLogEntryAllOf.ts
-model/restTaskDescription.ts
-model/restTaskDescriptionComponent.ts
-model/restTaskDescriptionTarget.ts
-model/restTaskDescriptionTargetItem.ts
-model/restTaskEndAuditLogEntry.ts
-model/restTaskEndAuditLogEntryAllOf.ts
-model/restTaskModifiedAuditLogEntry.ts
-model/restTaskModifiedAuditLogEntryAllOf.ts
-model/restTaskStartAuditLogEntry.ts
-model/restTeam.ts
-model/runInfo.ts
-model/runState.ts
-model/score.ts
-model/scoreOverview.ts
-model/scoreSeries.ts
-model/scoreSeriesPoint.ts
-model/sessionId.ts
-model/submissionInfo.ts
-model/successStatus.ts
-model/taskGroup.ts
-model/taskHint.ts
-model/taskInfo.ts
-model/taskTarget.ts
-model/taskType.ts
-model/teamInfo.ts
-model/temporalPoint.ts
-model/temporalRange.ts
-model/userDetails.ts
-model/userRequest.ts
-model/viewerInfo.ts
-ng-package.json
-package.json
-tsconfig.json
-variables.ts
+.gitignore
+README.md
+api.module.ts
+api/api.ts
+api/audit.service.ts
+api/collection.service.ts
+api/competition.service.ts
+api/competitionRun.service.ts
+api/competitionRunAdmin.service.ts
+api/competitionRunScores.service.ts
+api/judgement.service.ts
+api/log.service.ts
+api/status.service.ts
+api/submission.service.ts
+api/user.service.ts
+configuration.ts
+encoder.ts
+git_push.sh
+index.ts
+model/auditLogInfo.ts
+model/competitionCreate.ts
+model/competitionOverview.ts
+model/competitionStartMessage.ts
+model/configuredOptionOptions.ts
+model/configuredOptionQueryComponentType.ts
+model/configuredOptionScoringType.ts
+model/configuredOptionSubmissionFilterType.ts
+model/configuredOptionTargetType.ts
+model/contentElement.ts
+model/currentTime.ts
+model/errorStatus.ts
+model/judgement.ts
+model/judgementRequest.ts
+model/judgementValidatorStatus.ts
+model/judgementVote.ts
+model/loginRequest.ts
+model/models.ts
+model/queryEvent.ts
+model/queryEventLog.ts
+model/queryResult.ts
+model/queryResultLog.ts
+model/restAuditLogEntry.ts
+model/restCompetitionDescription.ts
+model/restCompetitionEndAuditLogEntry.ts
+model/restCompetitionEndAuditLogEntryAllOf.ts
+model/restCompetitionStartAuditLogEntry.ts
+model/restDetailedTeam.ts
+model/restFullMediaCollection.ts
+model/restJudgementAuditLogEntry.ts
+model/restJudgementAuditLogEntryAllOf.ts
+model/restLoginAuditLogEntry.ts
+model/restLoginAuditLogEntryAllOf.ts
+model/restLogoutAuditLogEntry.ts
+model/restLogoutAuditLogEntryAllOf.ts
+model/restMediaCollection.ts
+model/restMediaItem.ts
+model/restPrepareJudgementAuditLogEntry.ts
+model/restPrepareJudgementAuditLogEntryAllOf.ts
+model/restSubmissionAuditLogEntry.ts
+model/restSubmissionAuditLogEntryAllOf.ts
+model/restTaskDescription.ts
+model/restTaskDescriptionComponent.ts
+model/restTaskDescriptionTarget.ts
+model/restTaskDescriptionTargetItem.ts
+model/restTaskEndAuditLogEntry.ts
+model/restTaskEndAuditLogEntryAllOf.ts
+model/restTaskModifiedAuditLogEntry.ts
+model/restTaskModifiedAuditLogEntryAllOf.ts
+model/restTaskStartAuditLogEntry.ts
+model/restTeam.ts
+model/runInfo.ts
+model/runState.ts
+model/score.ts
+model/scoreOverview.ts
+model/scoreSeries.ts
+model/scoreSeriesPoint.ts
+model/sessionId.ts
+model/submissionInfo.ts
+model/successStatus.ts
+model/taskGroup.ts
+model/taskHint.ts
+model/taskInfo.ts
+model/taskTarget.ts
+model/taskType.ts
+model/teamInfo.ts
+model/temporalPoint.ts
+model/temporalRange.ts
+model/userDetails.ts
+model/userRequest.ts
+model/viewerInfo.ts
+ng-package.json
+package.json
+tsconfig.json
+variables.ts
diff --git a/frontend/openapi/README.md b/frontend/openapi/README.md
index 8794d6fdb..adb6e3a85 100644
--- a/frontend/openapi/README.md
+++ b/frontend/openapi/README.md
@@ -1,4 +1,4 @@
-## @dres-openapi/api@1.0-SNAPSHOT.202102011229
+## @dres-openapi/api@1.0-SNAPSHOT.202102011837
### Building
@@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands.
_published:_
```
-npm install @dres-openapi/api@1.0-SNAPSHOT.202102011229 --save
+npm install @dres-openapi/api@1.0-SNAPSHOT.202102011837 --save
```
_without publishing (not recommended):_
diff --git a/frontend/openapi/api.module.ts b/frontend/openapi/api.module.ts
index 25cbc6321..f3a9f000b 100644
--- a/frontend/openapi/api.module.ts
+++ b/frontend/openapi/api.module.ts
@@ -8,7 +8,6 @@ import { CompetitionService } from './api/competition.service';
import { CompetitionRunService } from './api/competitionRun.service';
import { CompetitionRunAdminService } from './api/competitionRunAdmin.service';
import { CompetitionRunScoresService } from './api/competitionRunScores.service';
-import { DefaultService } from './api/default.service';
import { JudgementService } from './api/judgement.service';
import { LogService } from './api/log.service';
import { StatusService } from './api/status.service';
diff --git a/frontend/openapi/api/api.ts b/frontend/openapi/api/api.ts
index fc76083da..8342f1c45 100644
--- a/frontend/openapi/api/api.ts
+++ b/frontend/openapi/api/api.ts
@@ -10,8 +10,6 @@ export * from './competitionRunAdmin.service';
import { CompetitionRunAdminService } from './competitionRunAdmin.service';
export * from './competitionRunScores.service';
import { CompetitionRunScoresService } from './competitionRunScores.service';
-export * from './default.service';
-import { DefaultService } from './default.service';
export * from './judgement.service';
import { JudgementService } from './judgement.service';
export * from './log.service';
@@ -22,4 +20,4 @@ export * from './submission.service';
import { SubmissionService } from './submission.service';
export * from './user.service';
import { UserService } from './user.service';
-export const APIS = [AuditService, CollectionService, CompetitionService, CompetitionRunService, CompetitionRunAdminService, CompetitionRunScoresService, DefaultService, JudgementService, LogService, StatusService, SubmissionService, UserService];
+export const APIS = [AuditService, CollectionService, CompetitionService, CompetitionRunService, CompetitionRunAdminService, CompetitionRunScoresService, JudgementService, LogService, StatusService, SubmissionService, UserService];
diff --git a/frontend/openapi/api/judgement.service.ts b/frontend/openapi/api/judgement.service.ts
index 90ced9c71..d7dc33956 100644
--- a/frontend/openapi/api/judgement.service.ts
+++ b/frontend/openapi/api/judgement.service.ts
@@ -21,6 +21,7 @@ import { ErrorStatus } from '../model/models';
import { Judgement } from '../model/models';
import { JudgementRequest } from '../model/models';
import { JudgementValidatorStatus } from '../model/models';
+import { JudgementVote } from '../model/models';
import { SuccessStatus } from '../model/models';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -279,4 +280,60 @@ export class JudgementService {
);
}
+ /**
+ * Returns a Vote.
+ * @param runId Run ID
+ * @param judgementVote
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public postApiRunWithRunidJudgeVote(runId: string, judgementVote?: JudgementVote, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public postApiRunWithRunidJudgeVote(runId: string, judgementVote?: JudgementVote, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postApiRunWithRunidJudgeVote(runId: string, judgementVote?: JudgementVote, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postApiRunWithRunidJudgeVote(runId: string, judgementVote?: JudgementVote, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (runId === null || runId === undefined) {
+ throw new Error('Required parameter runId was null or undefined when calling postApiRunWithRunidJudgeVote.');
+ }
+
+ let headers = this.defaultHeaders;
+
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
+ if (httpHeaderAcceptSelected === undefined) {
+ // to determine the Accept header
+ const httpHeaderAccepts: string[] = [
+ 'application/json'
+ ];
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
+ }
+ if (httpHeaderAcceptSelected !== undefined) {
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
+ }
+
+
+ // to determine the Content-Type header
+ const consumes: string[] = [
+ 'application/json'
+ ];
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
+ if (httpContentTypeSelected !== undefined) {
+ headers = headers.set('Content-Type', httpContentTypeSelected);
+ }
+
+ let responseType: 'text' | 'json' = 'json';
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
+ responseType = 'text';
+ }
+
+ return this.httpClient.post(`${this.configuration.basePath}/api/run/${encodeURIComponent(String(runId))}/judge/vote`,
+ judgementVote,
+ {
+ responseType: responseType,
+ withCredentials: this.configuration.withCredentials,
+ headers: headers,
+ observe: observe,
+ reportProgress: reportProgress
+ }
+ );
+ }
+
}
diff --git a/frontend/openapi/api/log.service.ts b/frontend/openapi/api/log.service.ts
index b0acf6379..5bd0fa7ae 100644
--- a/frontend/openapi/api/log.service.ts
+++ b/frontend/openapi/api/log.service.ts
@@ -89,14 +89,24 @@ export class LogService {
/**
* Accepts query logs from participants
+ * @param session Session Token
* @param queryEventLog
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public postLogQuery(queryEventLog?: QueryEventLog, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public postLogQuery(queryEventLog?: QueryEventLog, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public postLogQuery(queryEventLog?: QueryEventLog, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public postLogQuery(queryEventLog?: QueryEventLog, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ public postLogQuery(session: string, queryEventLog?: QueryEventLog, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public postLogQuery(session: string, queryEventLog?: QueryEventLog, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postLogQuery(session: string, queryEventLog?: QueryEventLog, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postLogQuery(session: string, queryEventLog?: QueryEventLog, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (session === null || session === undefined) {
+ throw new Error('Required parameter session was null or undefined when calling postLogQuery.');
+ }
+
+ let queryParameters = new HttpParams({encoder: this.encoder});
+ if (session !== undefined && session !== null) {
+ queryParameters = this.addToHttpParams(queryParameters,
+ session, 'session');
+ }
let headers = this.defaultHeaders;
@@ -130,6 +140,7 @@ export class LogService {
return this.httpClient.post(`${this.configuration.basePath}/log/query`,
queryEventLog,
{
+ params: queryParameters,
responseType: responseType,
withCredentials: this.configuration.withCredentials,
headers: headers,
@@ -141,14 +152,24 @@ export class LogService {
/**
* Accepts result logs from participants
+ * @param session Session Token
* @param queryResultLog
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public postLogResult(queryResultLog?: QueryResultLog, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public postLogResult(queryResultLog?: QueryResultLog, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public postLogResult(queryResultLog?: QueryResultLog, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public postLogResult(queryResultLog?: QueryResultLog, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ public postLogResult(session: string, queryResultLog?: QueryResultLog, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public postLogResult(session: string, queryResultLog?: QueryResultLog, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postLogResult(session: string, queryResultLog?: QueryResultLog, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postLogResult(session: string, queryResultLog?: QueryResultLog, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (session === null || session === undefined) {
+ throw new Error('Required parameter session was null or undefined when calling postLogResult.');
+ }
+
+ let queryParameters = new HttpParams({encoder: this.encoder});
+ if (session !== undefined && session !== null) {
+ queryParameters = this.addToHttpParams(queryParameters,
+ session, 'session');
+ }
let headers = this.defaultHeaders;
@@ -182,6 +203,7 @@ export class LogService {
return this.httpClient.post(`${this.configuration.basePath}/log/result`,
queryResultLog,
{
+ params: queryParameters,
responseType: responseType,
withCredentials: this.configuration.withCredentials,
headers: headers,
diff --git a/frontend/openapi/api/submission.service.ts b/frontend/openapi/api/submission.service.ts
index 0377ef467..d57b9e186 100644
--- a/frontend/openapi/api/submission.service.ts
+++ b/frontend/openapi/api/submission.service.ts
@@ -87,6 +87,7 @@ export class SubmissionService {
/**
* Endpoint to accept submissions
+ * @param session Session Token
* @param collection Collection identifier. Optional, in which case the default collection for the run will be considered.
* @param item Identifier for the actual media object or media file.
* @param frame Frame number for media with temporal progression (e.g. video).
@@ -95,10 +96,13 @@ export class SubmissionService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public getSubmit(collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public getSubmit(collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getSubmit(collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getSubmit(collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ public getSubmit(session: string, collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public getSubmit(session: string, collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getSubmit(session: string, collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getSubmit(session: string, collection?: string, item?: string, frame?: number, shot?: number, timecode?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (session === null || session === undefined) {
+ throw new Error('Required parameter session was null or undefined when calling getSubmit.');
+ }
let queryParameters = new HttpParams({encoder: this.encoder});
if (collection !== undefined && collection !== null) {
@@ -121,6 +125,10 @@ export class SubmissionService {
queryParameters = this.addToHttpParams(queryParameters,
timecode, 'timecode');
}
+ if (session !== undefined && session !== null) {
+ queryParameters = this.addToHttpParams(queryParameters,
+ session, 'session');
+ }
let headers = this.defaultHeaders;
diff --git a/frontend/openapi/api/user.service.ts b/frontend/openapi/api/user.service.ts
index a94d37bff..1bfb259f6 100644
--- a/frontend/openapi/api/user.service.ts
+++ b/frontend/openapi/api/user.service.ts
@@ -136,13 +136,23 @@ export class UserService {
/**
* Clears all user roles of the current session.
+ * @param session Session Token
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public getApiLogout(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public getApiLogout(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getApiLogout(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getApiLogout(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ public getApiLogout(session: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public getApiLogout(session: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiLogout(session: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiLogout(session: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (session === null || session === undefined) {
+ throw new Error('Required parameter session was null or undefined when calling getApiLogout.');
+ }
+
+ let queryParameters = new HttpParams({encoder: this.encoder});
+ if (session !== undefined && session !== null) {
+ queryParameters = this.addToHttpParams(queryParameters,
+ session, 'session');
+ }
let headers = this.defaultHeaders;
@@ -166,6 +176,7 @@ export class UserService {
return this.httpClient.get(`${this.configuration.basePath}/api/logout`,
{
+ params: queryParameters,
responseType: responseType,
withCredentials: this.configuration.withCredentials,
headers: headers,
@@ -259,13 +270,23 @@ export class UserService {
/**
* Get current sessionId
+ * @param session Session Token
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public getApiUserSession(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public getApiUserSession(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getApiUserSession(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public getApiUserSession(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ public getApiUserSession(session: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public getApiUserSession(session: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiUserSession(session: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public getApiUserSession(session: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
+ if (session === null || session === undefined) {
+ throw new Error('Required parameter session was null or undefined when calling getApiUserSession.');
+ }
+
+ let queryParameters = new HttpParams({encoder: this.encoder});
+ if (session !== undefined && session !== null) {
+ queryParameters = this.addToHttpParams(queryParameters,
+ session, 'session');
+ }
let headers = this.defaultHeaders;
@@ -289,6 +310,7 @@ export class UserService {
return this.httpClient.get(`${this.configuration.basePath}/api/user/session`,
{
+ params: queryParameters,
responseType: responseType,
withCredentials: this.configuration.withCredentials,
headers: headers,
@@ -446,9 +468,9 @@ export class UserService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
- public postApiLogin(loginRequest?: LoginRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
- public postApiLogin(loginRequest?: LoginRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
- public postApiLogin(loginRequest?: LoginRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postApiLogin(loginRequest?: LoginRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable;
+ public postApiLogin(loginRequest?: LoginRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
+ public postApiLogin(loginRequest?: LoginRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>;
public postApiLogin(loginRequest?: LoginRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable {
let headers = this.defaultHeaders;
@@ -480,7 +502,7 @@ export class UserService {
responseType = 'text';
}
- return this.httpClient.post(`${this.configuration.basePath}/api/login`,
+ return this.httpClient.post(`${this.configuration.basePath}/api/login`,
loginRequest,
{
responseType: responseType,
diff --git a/frontend/openapi/model/judgementVote.ts b/frontend/openapi/model/judgementVote.ts
new file mode 100644
index 000000000..cf3051cfd
--- /dev/null
+++ b/frontend/openapi/model/judgementVote.ts
@@ -0,0 +1,27 @@
+/**
+ * DRES API
+ * API for DRES (Distributed Retrieval Evaluation Server), Version 1.0
+ *
+ * The version of the OpenAPI document: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+export interface JudgementVote {
+ verdict: JudgementVote.VerdictEnum;
+}
+export namespace JudgementVote {
+ export type VerdictEnum = 'CORRECT' | 'WRONG' | 'INDETERMINATE' | 'UNDECIDABLE';
+ export const VerdictEnum = {
+ CORRECT: 'CORRECT' as VerdictEnum,
+ WRONG: 'WRONG' as VerdictEnum,
+ INDETERMINATE: 'INDETERMINATE' as VerdictEnum,
+ UNDECIDABLE: 'UNDECIDABLE' as VerdictEnum
+ };
+}
+
+
diff --git a/frontend/openapi/model/models.ts b/frontend/openapi/model/models.ts
index 60af21967..5dd541895 100644
--- a/frontend/openapi/model/models.ts
+++ b/frontend/openapi/model/models.ts
@@ -13,6 +13,7 @@ export * from './errorStatus';
export * from './judgement';
export * from './judgementRequest';
export * from './judgementValidatorStatus';
+export * from './judgementVote';
export * from './loginRequest';
export * from './queryEvent';
export * from './queryEventLog';
diff --git a/frontend/openapi/package.json b/frontend/openapi/package.json
index ac4468e9b..0b3eef11e 100644
--- a/frontend/openapi/package.json
+++ b/frontend/openapi/package.json
@@ -1,6 +1,6 @@
{
"name": "@dres-openapi/api",
- "version": "1.0-SNAPSHOT.202102011229",
+ "version": "1.0-SNAPSHOT.202102011837",
"description": "OpenAPI client for @dres-openapi/api",
"author": "OpenAPI-Generator Contributors",
"keywords": [
From d72b7342ad1637676218203941bdf2b399271290 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Mon, 1 Feb 2021 21:39:34 +0100
Subject: [PATCH 09/95] Simplified interaction and result logging
---
.../dev/dres/data/model/log/ParticipantLog.kt | 19 +++++++++++--------
.../handlers/ResultLogStatisticsHandler.kt | 12 ++++++------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt b/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
index 3cd4e182d..96d8f632f 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
@@ -2,25 +2,28 @@ package dev.dres.data.model.log
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonSetter
-import com.fasterxml.jackson.annotation.Nulls
@JsonIgnoreProperties(ignoreUnknown = true)
-data class QueryEvent(val timestamp: Long = -1, val category: String = "", @field:JsonSetter(contentNulls = Nulls.FAIL) val type: List = emptyList(), val value: String = "")
+data class QueryEvent(val timestamp: Long = -1,
+ val category: String = "",
+ val type: String = "",
+ val value: String = "")
@JsonIgnoreProperties(ignoreUnknown = true)
data class QueryEventLog internal constructor(val timestamp: Long = -1,
@field:JsonSetter(contentNulls = Nulls.FAIL) val events: List = emptyList(),
- val type: String = "",
internal val serverTimeStamp: Long = System.currentTimeMillis())
@JsonIgnoreProperties(ignoreUnknown = true)
-data class QueryResult(val video: String = "", val shot: Int? = null, val frame: Int? = null, val score: Double? = null, val rank: Int? = null)
+data class QueryResult(val item: String = "",
+ val segment: Int? = null,
+ val frame: Int? = null,
+ val score: Double? = null,
+ val rank: Int? = null)
@JsonIgnoreProperties(ignoreUnknown = true)
data class QueryResultLog internal constructor(val timestamp: Long = -1,
- @field:JsonSetter(contentNulls = Nulls.FAIL) val values: List = emptyList(),
- @field:JsonSetter(contentNulls = Nulls.FAIL) val usedCategories: List = emptyList(),
- @field:JsonSetter(contentNulls = Nulls.FAIL) val usedTypes: List = emptyList(),
- @field:JsonSetter(contentNulls = Nulls.FAIL) val sortType: List = emptyList(),
+ val sortType: String = "",
val resultSetAvailability: String = "",
@field:JsonSetter(contentNulls = Nulls.FAIL)val results: List = emptyList(),
+ @field:JsonSetter(contentNulls = Nulls.FAIL)val events: List = emptyList(),
internal val serverTimeStamp: Long = System.currentTimeMillis())
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt b/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
index b6409a8ec..19a362557 100644
--- a/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
@@ -46,7 +46,7 @@ class ResultLogStatisticsHandler(private val segmentIndex: DaoIndexer
- if ( relevantTargets.any { it.first.name == queryResult.video } )
+ if ( relevantTargets.any { it.first.name == queryResult.item } )
index to queryResult else null }.filterNotNull()
if (correctItems.isEmpty()) {
@@ -57,23 +57,23 @@ class ResultLogStatisticsHandler(private val segmentIndex: DaoIndexer
+ val correctTime = (it.second.segment != null || it.second.frame != null) && relevantTemporalTargets.any { target ->
val segments = this.segmentIndex[target.first.id].firstOrNull() ?: return@any false
- val segment = TemporalRange(if (it.second.shot != null) {
- TimeUtil.shotToTime(it.second.shot.toString(), target.first as MediaItem.VideoItem, segments)
+ val segment = TemporalRange(if (it.second.segment != null) {
+ TimeUtil.shotToTime(it.second.segment.toString(), target.first as MediaItem.VideoItem, segments)
} else {
TimeUtil.timeToSegment(TimeUtil.frameToTime(it.second.frame!!, target.first as MediaItem.VideoItem), target.first as MediaItem.VideoItem, segments)
} ?: return@any false )
segment.overlaps(target.second!!)
}
- writer.println("${System.currentTimeMillis()},${relevantTask.name},${event.session},${it.second.video},${it.second.shot},${it.second.frame},${it.second.rank},${it.first},$correctTime")
+ writer.println("${System.currentTimeMillis()},${relevantTask.name},${event.session},${it.second.item},${it.second.segment},${it.second.frame},${it.second.rank},${it.first},$correctTime")
}
}
From 5bf5241e403b49e8679e7767490de11a53faafa6 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Tue, 2 Feb 2021 13:34:27 +0100
Subject: [PATCH 10/95] Made category in QueryEvent explicit
---
.../main/kotlin/dev/dres/data/model/log/ParticipantLog.kt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt b/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
index 96d8f632f..ef0137e43 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/log/ParticipantLog.kt
@@ -2,10 +2,15 @@ package dev.dres.data.model.log
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonSetter
+import com.fasterxml.jackson.annotation.Nulls
+
+enum class QueryEventCategory {
+ TEXT, IMAGE, SKETCH, FILTER, BROWSING, COOPERATION, OTHER
+}
@JsonIgnoreProperties(ignoreUnknown = true)
data class QueryEvent(val timestamp: Long = -1,
- val category: String = "",
+ val category: QueryEventCategory = QueryEventCategory.OTHER,
val type: String = "",
val value: String = "")
From 3db2f203f0a2c5b1cb840453ba64e2cc73dada62 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Thu, 4 Feb 2021 22:13:37 +0100
Subject: [PATCH 11/95] Fixed check in SubmissionHandler
---
.../main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
index 551898e9e..70e2cdebc 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
@@ -82,7 +82,7 @@ class SubmissionHandler (val collections: DAO, private val item
val item = this.itemIndex[collectionId to itemParam].firstOrNull() ?:
throw ErrorStatusException(404, "Media item '$itemParam (collection = $collectionId)' could not be found.", ctx)
- val mapToSegment = runManager.currentTask?.taskType?.options?.contains(TaskType.Options.MAP_TO_SEGMENT) == true
+ val mapToSegment = runManager.currentTask?.taskType?.options?.any { it.option == TaskType.Options.MAP_TO_SEGMENT } == true
return when {
map.containsKey(PARAMETER_NAME_SHOT) && item is MediaItem.VideoItem -> {
From 502e0f9921f4c8e08df1601b0f951da1c34491ab Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Fri, 5 Feb 2021 11:31:58 +0100
Subject: [PATCH 12/95] BasicJudgementValidator can now be initialized with
known to be correct or wrong item ranges
---
.../validation/judged/BasicJudgementValidator.kt | 16 ++++++----------
.../dev/dres/run/validation/judged/ItemRange.kt | 11 +++++++++++
2 files changed, 17 insertions(+), 10 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
index 507ed717c..ccb78f006 100644
--- a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
@@ -1,9 +1,7 @@
package dev.dres.run.validation.judged
-import dev.dres.data.model.basics.media.MediaItem
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
-import dev.dres.data.model.run.TemporalSubmissionAspect
import dev.dres.run.audit.AuditLogger
import dev.dres.run.validation.interfaces.JudgementValidator
import java.util.*
@@ -17,12 +15,11 @@ import kotlin.concurrent.write
/**
* A validator class that checks, if a submission is correct based on a manual judgement by a user.
*
- * TODO: Track these in the RunExecutor
*
* @author Luca Rossetto & Ralph Gasser
* @version 1.0
*/
-class BasicJudgementValidator(): JudgementValidator { //TODO better name
+class BasicJudgementValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList()): JudgementValidator {
companion object {
private val counter = AtomicInteger()
@@ -31,12 +28,6 @@ class BasicJudgementValidator(): JudgementValidator { //TODO better name
override val id = "bjv${counter.incrementAndGet()}"
- /** Helper class to store submission information independent of source */
- private data class ItemRange(val item: MediaItem, val start: Long, val end: Long){
- constructor(submission: TemporalSubmissionAspect): this(submission.item, submission.start, submission.end)
- constructor(submission: Submission): this(submission.item, 0, 0)
- }
-
private val updateLock = ReentrantReadWriteLock()
/** Internal queue that keeps track of all the [Submission]s in need of a verdict. */
@@ -51,6 +42,11 @@ class BasicJudgementValidator(): JudgementValidator { //TODO better name
/** Internal map of already judged [Submission]s, independent of their source. */
private val cache: MutableMap = ConcurrentHashMap()
+ init {
+ knownCorrectRanges.forEach { cache[it] = SubmissionStatus.CORRECT }
+ knownWrongRanges.forEach { cache[it] = SubmissionStatus.WRONG }
+ }
+
private fun checkTimeOuts() = updateLock.write {
val now = System.currentTimeMillis()
val due = timeouts.filter { it.first <= now }
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
new file mode 100644
index 000000000..c5e763e2a
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
@@ -0,0 +1,11 @@
+package dev.dres.run.validation.judged
+
+import dev.dres.data.model.basics.media.MediaItem
+import dev.dres.data.model.run.Submission
+import dev.dres.data.model.run.TemporalSubmissionAspect
+
+/** Helper class to store submission information independent of source */
+data class ItemRange(val item: MediaItem, val start: Long, val end: Long){
+ constructor(submission: TemporalSubmissionAspect): this(submission.item, submission.start, submission.end)
+ constructor(submission: Submission): this(submission.item, 0, 0)
+}
\ No newline at end of file
From 04c7aa5f70db1242ac2506f4f89922ebaf894886 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Fri, 5 Feb 2021 12:05:28 +0100
Subject: [PATCH 13/95] Connected BasicJudgementValidator with Rest API to
specify known correct item ranges
---
.../tasks/RestTaskDescriptionTarget.kt | 2 +-
.../data/model/competition/TaskDescription.kt | 17 +++++++++++++++-
.../competition/TaskDescriptionTarget.kt | 2 +-
.../serializers/TaskDescriptionSerializer.kt | 20 ++++++++++++++++---
.../dres/run/validation/judged/ItemRange.kt | 3 ++-
5 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
index 9193a8885..9eab08a69 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
@@ -36,7 +36,7 @@ data class RestTaskDescriptionTarget(val type: TaskType.TargetType, val mediaIte
*/
fun toTarget(mediaItems: DAO) = when(this.type){
TaskType.TargetType.SINGLE_MEDIA_SEGMENT -> TaskDescriptionTarget.VideoSegmentTarget(mediaItems[this.mediaItems.first().mediaItem.UID()]!! as MediaItem.VideoItem, this.mediaItems.first().temporalRange!!)
- TaskType.TargetType.JUDGEMENT -> TaskDescriptionTarget.JudgementTaskDescriptionTarget
+ TaskType.TargetType.JUDGEMENT -> TaskDescriptionTarget.JudgementTaskDescriptionTarget(this.mediaItems.map { mediaItems[it.mediaItem.UID()]!! to it.temporalRange })
TaskType.TargetType.SINGLE_MEDIA_ITEM -> TaskDescriptionTarget.MediaItemTarget(mediaItems[this.mediaItems.first().mediaItem.UID()]!!)
TaskType.TargetType.MULTIPLE_MEDIA_ITEMS -> TaskDescriptionTarget.MultipleMediaItemTarget(this.mediaItems.map { mediaItems[it.mediaItem.UID()]!! })
}
diff --git a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
index f53ce2646..5980417e1 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
@@ -7,12 +7,15 @@ import dev.dres.data.dbo.DAO
import dev.dres.data.model.Config
import dev.dres.data.model.UID
import dev.dres.data.model.basics.media.MediaCollection
+import dev.dres.data.model.basics.media.MediaItem
import dev.dres.run.filter.SubmissionFilter
import dev.dres.run.score.interfaces.TaskRunScorer
import dev.dres.run.validation.MediaItemsSubmissionValidator
import dev.dres.run.validation.TemporalOverlapSubmissionValidator
import dev.dres.run.validation.interfaces.SubmissionValidator
import dev.dres.run.validation.judged.BasicJudgementValidator
+import dev.dres.run.validation.judged.ItemRange
+import dev.dres.utilities.TimeUtil
import java.io.FileNotFoundException
import java.io.IOException
import java.io.PrintStream
@@ -71,7 +74,19 @@ class TaskDescription(
TaskType.TargetType.SINGLE_MEDIA_ITEM -> MediaItemsSubmissionValidator(setOf((target as TaskDescriptionTarget.MediaItemTarget).item))
TaskType.TargetType.SINGLE_MEDIA_SEGMENT -> TemporalOverlapSubmissionValidator(target as TaskDescriptionTarget.VideoSegmentTarget)
TaskType.TargetType.MULTIPLE_MEDIA_ITEMS -> MediaItemsSubmissionValidator((target as TaskDescriptionTarget.MultipleMediaItemTarget).items.toSet())
- TaskType.TargetType.JUDGEMENT -> BasicJudgementValidator()
+ TaskType.TargetType.JUDGEMENT -> BasicJudgementValidator(knownCorrectRanges =
+ (target as TaskDescriptionTarget.JudgementTaskDescriptionTarget).targets.map {
+ if (it.second == null){
+ ItemRange(it.first)
+ } else {
+ val item = it.first
+ val range = if (item is MediaItem.VideoItem) {
+ TimeUtil.toMilliseconds(it.second!!, item.fps)
+ } else {
+ TimeUtil.toMilliseconds(it.second!!)
+ }
+ ItemRange(item, range.first, range.second)
+ } })
}
/**
diff --git a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
index 6dfe993b5..893e35354 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
@@ -47,7 +47,7 @@ sealed class TaskDescriptionTarget {
/**
* A [TaskDescriptionTarget] that is validated by human judges.
*/
- object JudgementTaskDescriptionTarget : TaskDescriptionTarget() {
+ data class JudgementTaskDescriptionTarget(val targets: List>) : TaskDescriptionTarget() {
override val ordinal: Int = 1
override fun textDescription() = "Judgement"
override fun toQueryContentElement(config: Config, collections: DAO): List = emptyList()
diff --git a/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt b/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
index 136480a30..ddc3af7a6 100644
--- a/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
+++ b/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
@@ -3,7 +3,6 @@ package dev.dres.data.serializers
import dev.dres.data.dbo.DAO
import dev.dres.data.model.basics.media.MediaItem
import dev.dres.data.model.competition.*
-import dev.dres.data.model.competition.TaskDescription
import dev.dres.utilities.extensions.readUID
import dev.dres.utilities.extensions.writeUID
import org.mapdb.DataInput2
@@ -50,7 +49,16 @@ class TaskDescriptionSerializer(val taskGroups: List, val taskTypes:
private fun writeTaskDescriptionTarget(out: DataOutput2, target: TaskDescriptionTarget) {
out.packInt(target.ordinal)
when(target) {
- is TaskDescriptionTarget.JudgementTaskDescriptionTarget -> {}
+ is TaskDescriptionTarget.JudgementTaskDescriptionTarget -> {
+ out.packInt(target.targets.size)
+ target.targets.forEach {
+ out.writeUID(it.first.id)
+ out.writeBoolean(it.second != null)
+ if (it.second != null){
+ TemporalRangeSerializer.serialize(out, it.second!!)
+ }
+ }
+ }
is TaskDescriptionTarget.VideoSegmentTarget -> {
out.writeUID(target.item.id)
TemporalRangeSerializer.serialize(out, target.temporalRange)
@@ -108,7 +116,13 @@ class TaskDescriptionSerializer(val taskGroups: List, val taskTypes:
*/
private fun readTaskDescriptionTarget(input: DataInput2, available: Int, mediaItems: DAO) : TaskDescriptionTarget {
return when(val ordinal = input.unpackInt()) {
- 1 -> TaskDescriptionTarget.JudgementTaskDescriptionTarget
+ 1 -> TaskDescriptionTarget.JudgementTaskDescriptionTarget(
+ (0 until input.unpackInt()).map {
+ Pair(mediaItems[input.readUID()]!!, if (input.readBoolean()) {
+ TemporalRangeSerializer.deserialize(input, available)
+ } else null)
+ }
+ )
2 -> TaskDescriptionTarget.MediaItemTarget(mediaItems[input.readUID()]!!)
3 -> TaskDescriptionTarget.VideoSegmentTarget(mediaItems[input.readUID()]!! as MediaItem.VideoItem, TemporalRangeSerializer.deserialize(input, available))
4 -> TaskDescriptionTarget.MultipleMediaItemTarget((0 until input.unpackInt()).map { mediaItems[input.readUID()]!! })
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
index c5e763e2a..300644e22 100644
--- a/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/ItemRange.kt
@@ -7,5 +7,6 @@ import dev.dres.data.model.run.TemporalSubmissionAspect
/** Helper class to store submission information independent of source */
data class ItemRange(val item: MediaItem, val start: Long, val end: Long){
constructor(submission: TemporalSubmissionAspect): this(submission.item, submission.start, submission.end)
- constructor(submission: Submission): this(submission.item, 0, 0)
+ constructor(submission: Submission): this(submission.item)
+ constructor(item: MediaItem): this(item, 0, 0)
}
\ No newline at end of file
From 3721edecc689f5df057a7b228ab77612a6fd5613 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Fri, 5 Feb 2021 19:22:49 +0100
Subject: [PATCH 14/95] Added first version of BasicVoteValidator
---
.../judged/BasicJudgementValidator.kt | 12 +++-
.../validation/judged/BasicVoteValidator.kt | 59 +++++++++++++++++++
2 files changed, 68 insertions(+), 3 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
index ccb78f006..85b3820df 100644
--- a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicJudgementValidator.kt
@@ -19,7 +19,7 @@ import kotlin.concurrent.write
* @author Luca Rossetto & Ralph Gasser
* @version 1.0
*/
-class BasicJudgementValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList()): JudgementValidator {
+open class BasicJudgementValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList()): JudgementValidator {
companion object {
private val counter = AtomicInteger()
@@ -122,9 +122,13 @@ class BasicJudgementValidator(knownCorrectRanges: Collection = emptyL
* @param token The token used to identify the [Submission].
* @param verdict The verdict of the judge.
*/
- override fun judge(token: String, verdict: SubmissionStatus) = updateLock.write {
+ override fun judge(token: String, verdict: SubmissionStatus) {
+ doJudge(token, verdict)
+ }
+
+ internal fun doJudge(token: String, verdict: SubmissionStatus) : Submission? = updateLock.write {
require(this.waiting.containsKey(token)) { "This JudgementValidator does not contain a submission for the token '$token'." }
- val submission = this.waiting[token] ?: return@write //submission with token not found TODO: this should be logged
+ val submission = this.waiting[token] ?: return@write null //submission with token not found TODO: this should be logged
submission.status = verdict
//add to cache
@@ -132,6 +136,8 @@ class BasicJudgementValidator(knownCorrectRanges: Collection = emptyL
//remove from waiting map
this.waiting.remove(token)
+
+ return@write submission
}
/**
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
new file mode 100644
index 000000000..449efb5c1
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
@@ -0,0 +1,59 @@
+package dev.dres.run.validation.judged
+
+import dev.dres.data.model.run.Submission
+import dev.dres.data.model.run.SubmissionStatus
+import dev.dres.run.validation.interfaces.VoteValidator
+import java.util.concurrent.ConcurrentHashMap
+import java.util.concurrent.ConcurrentLinkedQueue
+import java.util.concurrent.locks.ReentrantReadWriteLock
+import kotlin.concurrent.write
+
+class BasicVoteValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList()) : BasicJudgementValidator(knownCorrectRanges, knownWrongRanges), VoteValidator {
+
+ private val submissionQueue = ConcurrentLinkedQueue()
+ private val voteCountMap = ConcurrentHashMap()
+ private val updateLock = ReentrantReadWriteLock()
+
+ override val isActive: Boolean
+ get() = submissionQueue.isNotEmpty()
+
+ override val voteCount: Map
+ get() = voteCountMap.mapKeys { it.toString() }
+
+ override fun vote(verdict: SubmissionStatus) = updateLock.write {
+
+ if (verdict == SubmissionStatus.INDETERMINATE || verdict == SubmissionStatus.UNDECIDABLE){ //should not happen anyway but will be ignored in case it does
+ return@write
+ }
+
+ val submission = submissionQueue.firstOrNull() ?: return@write
+
+ voteCountMap[verdict] = 1 + voteCountMap.getOrDefault(verdict, 0)
+
+ if (enoughVotes()){
+
+ val finalVerdict = voteCountMap.entries.maxByOrNull { it.value }!!.key
+ submission.status = finalVerdict
+
+ submissionQueue.poll()
+ voteCountMap.clear()
+
+ }
+ }
+
+ private fun enoughVotes() : Boolean {
+ return voteCountMap.values.sum() > 5 //TODO make configurable
+ }
+
+ override fun nextSubmissionToVoteOn(): Submission? = submissionQueue.firstOrNull() //TODO maybe add timeout mechanism?
+
+ //siphon of undecidable submission from logic of super class
+ override fun judge(token: String, verdict: SubmissionStatus) {
+ val submission = super.doJudge(token, verdict)
+
+ if (submission != null && verdict == SubmissionStatus.UNDECIDABLE) {
+ submissionQueue.add(submission)
+ }
+
+ }
+}
\ No newline at end of file
From 042b78f4f530c561d978f225942d0c183cf02d61 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Sun, 7 Feb 2021 16:53:49 +0100
Subject: [PATCH 15/95] BasicVoteValidator is now configurable via API
---
.../tasks/RestTaskDescriptionTarget.kt | 4 +++-
.../data/model/competition/TaskDescription.kt | 20 ++++++++++++++++-
.../competition/TaskDescriptionTarget.kt | 6 +++++
.../dres/data/model/competition/TaskType.kt | 3 ++-
.../serializers/TaskDescriptionSerializer.kt | 17 ++++++++++++++
.../handlers/ResultLogStatisticsHandler.kt | 2 +-
.../validation/judged/BasicVoteValidator.kt | 22 +++++++++++++++++--
7 files changed, 68 insertions(+), 6 deletions(-)
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
index 9eab08a69..bcb21d1eb 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/competition/tasks/RestTaskDescriptionTarget.kt
@@ -22,10 +22,11 @@ data class RestTaskDescriptionTarget(val type: TaskType.TargetType, val mediaIte
* @param target The [TaskDescriptionTarget] to convert.
*/
fun fromTarget(target: TaskDescriptionTarget) = when(target) {
- is TaskDescriptionTarget.JudgementTaskDescriptionTarget -> RestTaskDescriptionTarget(TaskType.TargetType.JUDGEMENT)
+ is TaskDescriptionTarget.JudgementTaskDescriptionTarget -> RestTaskDescriptionTarget(TaskType.TargetType.JUDGEMENT, target.targets.map { RestTaskDescriptionTargetItem(it.first.id.string, it.second) })
is TaskDescriptionTarget.VideoSegmentTarget -> RestTaskDescriptionTarget(TaskType.TargetType.SINGLE_MEDIA_SEGMENT, listOf(RestTaskDescriptionTargetItem(target.item.id.string, target.temporalRange)))
is TaskDescriptionTarget.MediaItemTarget -> RestTaskDescriptionTarget(TaskType.TargetType.SINGLE_MEDIA_ITEM, listOf(RestTaskDescriptionTargetItem(target.item.id.string)))
is TaskDescriptionTarget.MultipleMediaItemTarget -> RestTaskDescriptionTarget(TaskType.TargetType.MULTIPLE_MEDIA_ITEMS, target.items.map { RestTaskDescriptionTargetItem(it.id.string) })
+ is TaskDescriptionTarget.VoteTaskDescriptionTarget -> RestTaskDescriptionTarget(TaskType.TargetType.VOTE, target.targets.map { RestTaskDescriptionTargetItem(it.first.id.string, it.second) })
}
}
@@ -39,5 +40,6 @@ data class RestTaskDescriptionTarget(val type: TaskType.TargetType, val mediaIte
TaskType.TargetType.JUDGEMENT -> TaskDescriptionTarget.JudgementTaskDescriptionTarget(this.mediaItems.map { mediaItems[it.mediaItem.UID()]!! to it.temporalRange })
TaskType.TargetType.SINGLE_MEDIA_ITEM -> TaskDescriptionTarget.MediaItemTarget(mediaItems[this.mediaItems.first().mediaItem.UID()]!!)
TaskType.TargetType.MULTIPLE_MEDIA_ITEMS -> TaskDescriptionTarget.MultipleMediaItemTarget(this.mediaItems.map { mediaItems[it.mediaItem.UID()]!! })
+ TaskType.TargetType.VOTE -> TaskDescriptionTarget.VoteTaskDescriptionTarget(this.mediaItems.map { mediaItems[it.mediaItem.UID()]!! to it.temporalRange })
}
}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
index 5980417e1..086b5bd7d 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescription.kt
@@ -14,6 +14,7 @@ import dev.dres.run.validation.MediaItemsSubmissionValidator
import dev.dres.run.validation.TemporalOverlapSubmissionValidator
import dev.dres.run.validation.interfaces.SubmissionValidator
import dev.dres.run.validation.judged.BasicJudgementValidator
+import dev.dres.run.validation.judged.BasicVoteValidator
import dev.dres.run.validation.judged.ItemRange
import dev.dres.utilities.TimeUtil
import java.io.FileNotFoundException
@@ -87,6 +88,23 @@ class TaskDescription(
}
ItemRange(item, range.first, range.second)
} })
+ TaskType.TargetType.VOTE -> BasicVoteValidator(
+ knownCorrectRanges =
+ (target as TaskDescriptionTarget.VoteTaskDescriptionTarget).targets.map {
+ if (it.second == null){
+ ItemRange(it.first)
+ } else {
+ val item = it.first
+ val range = if (item is MediaItem.VideoItem) {
+ TimeUtil.toMilliseconds(it.second!!, item.fps)
+ } else {
+ TimeUtil.toMilliseconds(it.second!!)
+ }
+ ItemRange(item, range.first, range.second)
+ } },
+ parameters = taskType.targetType.parameters
+
+ )
}
/**
@@ -134,7 +152,7 @@ class TaskDescription(
* @throws FileNotFoundException
* @throws IOException
*/
- fun toTaskTarget(config: Config, collections: DAO): TaskTarget? = this.target.toQueryContentElement(config, collections).let { TaskTarget(this.id.string, it) }
+ fun toTaskTarget(config: Config, collections: DAO): TaskTarget = this.target.toQueryContentElement(config, collections).let { TaskTarget(this.id.string, it) }
/** Produces a Textual description of the content of the task if possible */
fun textualDescription(): String = hints.filterIsInstance(TaskDescriptionHint.TextTaskDescriptionHint::class.java)
diff --git a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
index 893e35354..943025b43 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskDescriptionTarget.kt
@@ -134,4 +134,10 @@ sealed class TaskDescriptionTarget {
return contentElements
}
}
+
+ data class VoteTaskDescriptionTarget(val targets: List>) : TaskDescriptionTarget() {
+ override val ordinal: Int = 5
+ override fun textDescription() = "Judgement with voting"
+ override fun toQueryContentElement(config: Config, collections: DAO): List = emptyList()
+ }
}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskType.kt b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskType.kt
index 195a9abd4..919206cf5 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/competition/TaskType.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/competition/TaskType.kt
@@ -31,7 +31,8 @@ data class TaskType(
SINGLE_MEDIA_ITEM, // Whole Media Item"
SINGLE_MEDIA_SEGMENT, //Part of a Media Item
MULTIPLE_MEDIA_ITEMS, //Multiple Media Items
- JUDGEMENT //Judgement
+ JUDGEMENT, //Judgement
+ VOTE //Judgement with audience voting
}
enum class QueryComponentType : Option{
diff --git a/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt b/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
index ddc3af7a6..d9ad17266 100644
--- a/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
+++ b/backend/src/main/kotlin/dev/dres/data/serializers/TaskDescriptionSerializer.kt
@@ -59,6 +59,16 @@ class TaskDescriptionSerializer(val taskGroups: List, val taskTypes:
}
}
}
+ is TaskDescriptionTarget.VoteTaskDescriptionTarget-> {
+ out.packInt(target.targets.size)
+ target.targets.forEach {
+ out.writeUID(it.first.id)
+ out.writeBoolean(it.second != null)
+ if (it.second != null){
+ TemporalRangeSerializer.serialize(out, it.second!!)
+ }
+ }
+ }
is TaskDescriptionTarget.VideoSegmentTarget -> {
out.writeUID(target.item.id)
TemporalRangeSerializer.serialize(out, target.temporalRange)
@@ -126,6 +136,13 @@ class TaskDescriptionSerializer(val taskGroups: List, val taskTypes:
2 -> TaskDescriptionTarget.MediaItemTarget(mediaItems[input.readUID()]!!)
3 -> TaskDescriptionTarget.VideoSegmentTarget(mediaItems[input.readUID()]!! as MediaItem.VideoItem, TemporalRangeSerializer.deserialize(input, available))
4 -> TaskDescriptionTarget.MultipleMediaItemTarget((0 until input.unpackInt()).map { mediaItems[input.readUID()]!! })
+ 5 -> TaskDescriptionTarget.VoteTaskDescriptionTarget(
+ (0 until input.unpackInt()).map {
+ Pair(mediaItems[input.readUID()]!!, if (input.readBoolean()) {
+ TemporalRangeSerializer.deserialize(input, available)
+ } else null)
+ }
+ )
else -> throw IllegalStateException("Failed to deserialize Task Description Target for ordinal $ordinal; not implemented.")
}
}
diff --git a/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt b/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
index 19a362557..b7477868c 100644
--- a/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/run/eventstream/handlers/ResultLogStatisticsHandler.kt
@@ -33,7 +33,7 @@ class ResultLogStatisticsHandler(private val segmentIndex: DaoIndexer {
lastActiveTask[event.runId] = event.taskDescription
lastActiveTargets[event.runId] = when(event.taskDescription.target) {
- is TaskDescriptionTarget.JudgementTaskDescriptionTarget -> return //no analysis possible
+ is TaskDescriptionTarget.JudgementTaskDescriptionTarget, is TaskDescriptionTarget.VoteTaskDescriptionTarget, -> return //no analysis possible
is TaskDescriptionTarget.MediaItemTarget -> listOf(event.taskDescription.target.item to null)
is TaskDescriptionTarget.VideoSegmentTarget -> listOf(event.taskDescription.target.item to event.taskDescription.target.temporalRange)
is TaskDescriptionTarget.MultipleMediaItemTarget -> event.taskDescription.target.items.map { it to null }
diff --git a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
index 449efb5c1..12296f782 100644
--- a/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
+++ b/backend/src/main/kotlin/dev/dres/run/validation/judged/BasicVoteValidator.kt
@@ -8,7 +8,22 @@ import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.concurrent.write
-class BasicVoteValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList()) : BasicJudgementValidator(knownCorrectRanges, knownWrongRanges), VoteValidator {
+class BasicVoteValidator(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList(), val minimumVotes: Int = defaultMinimimVotes, val voteDifference: Int = defaultVoteDifference) : BasicJudgementValidator(knownCorrectRanges, knownWrongRanges), VoteValidator {
+
+ constructor(knownCorrectRanges: Collection = emptyList(), knownWrongRanges: Collection = emptyList(), parameters: Map): this(
+ knownCorrectRanges, knownWrongRanges,
+ parameters.getOrDefault("minimumVotes", "$defaultMinimimVotes").toIntOrNull() ?: defaultMinimimVotes,
+ parameters.getOrDefault("voteDifference", "$defaultVoteDifference").toIntOrNull() ?: defaultVoteDifference
+ )
+
+ init {
+ require(minimumVotes > 0) {"minimum vote count cannot be <= 0"}
+ }
+
+ companion object {
+ private val defaultMinimimVotes = 5
+ private val defaultVoteDifference = 1
+ }
private val submissionQueue = ConcurrentLinkedQueue()
private val voteCountMap = ConcurrentHashMap()
@@ -42,7 +57,10 @@ class BasicVoteValidator(knownCorrectRanges: Collection = emptyList()
}
private fun enoughVotes() : Boolean {
- return voteCountMap.values.sum() > 5 //TODO make configurable
+ val sum = voteCountMap.values.sum()
+ if (sum < minimumVotes) return false
+ val max = voteCountMap.values.maxOrNull() ?: 0
+ return (sum - max) >= voteDifference
}
override fun nextSubmissionToVoteOn(): Submission? = submissionQueue.firstOrNull() //TODO maybe add timeout mechanism?
From 3d475cfaddd0f1f8a79404d1f81a9fe179721742 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Sun, 7 Feb 2021 19:53:13 +0100
Subject: [PATCH 16/95] Some refactoring to start distinction between different
types of RunManagers
---
.../dev/dres/api/cli/CompetitionRunCommand.kt | 13 +-
.../handler/CompetitionRunAdminHandler.kt | 17 ++-
.../api/rest/handler/CompetitionRunHandler.kt | 19 ++-
.../handler/CompetitionRunScoreHandler.kt | 12 +-
.../api/rest/handler/SubmissionHandler.kt | 7 +-
.../dev/dres/api/rest/types/run/RunState.kt | 3 +-
.../dev/dres/run/InteractiveRunManager.kt | 136 ++++++++++++++++++
.../main/kotlin/dev/dres/run/RunExecutor.kt | 2 +-
.../main/kotlin/dev/dres/run/RunManager.kt | 121 ----------------
...kt => SynchronousInteractiveRunManager.kt} | 36 ++---
.../dres/run/updatables/EndTaskUpdatable.kt | 4 +-
11 files changed, 197 insertions(+), 173 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
rename backend/src/main/kotlin/dev/dres/run/{SynchronousRunManager.kt => SynchronousInteractiveRunManager.kt} (96%)
diff --git a/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt b/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
index a04286d7d..6052786c5 100644
--- a/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
+++ b/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
@@ -5,18 +5,13 @@ import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.core.subcommands
-import com.github.ajalt.clikt.parameters.options.flag
-import com.github.ajalt.clikt.parameters.options.convert
-import com.github.ajalt.clikt.parameters.options.multiple
-import com.github.ajalt.clikt.parameters.options.option
-import com.github.ajalt.clikt.parameters.options.required
-import com.github.ajalt.clikt.parameters.types.long
+import com.github.ajalt.clikt.parameters.options.*
import com.jakewharton.picnic.table
-
import dev.dres.data.dbo.DAO
import dev.dres.data.model.UID
import dev.dres.data.model.run.CompetitionRun
import dev.dres.data.model.run.SubmissionStatus
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunExecutor
import dev.dres.utilities.extensions.UID
import java.nio.file.Files
@@ -54,7 +49,7 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
return
}
if (plain) {
- RunExecutor.managers().forEach {
+ RunExecutor.managers().filterIsInstance(InteractiveRunManager::class.java).forEach {
println("${RunSummary(it.id.string, it.name, it.competitionDescription.description, it.currentTask?.name)} (${it.status})")
}
} else {
@@ -68,7 +63,7 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
row("id", "name", "description", "currentTask", "status")
}
body {
- RunExecutor.managers().forEach {
+ RunExecutor.managers().filterIsInstance(InteractiveRunManager::class.java).forEach {
row(it.id.string, it.name, it.competitionDescription.description, it.currentTask?.name
?: "N/A", it.status)
}
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
index beae014d8..c8fe59956 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
@@ -14,10 +14,7 @@ import dev.dres.data.model.UID
import dev.dres.data.model.basics.media.MediaCollection
import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.run.CompetitionRun
-import dev.dres.run.RunExecutor
-import dev.dres.run.RunManager
-import dev.dres.run.RunManagerStatus
-import dev.dres.run.SynchronousRunManager
+import dev.dres.run.*
import dev.dres.run.audit.AuditLogger
import dev.dres.run.audit.LogEventSource
import dev.dres.run.eventstream.EventStreamProcessor
@@ -37,7 +34,13 @@ abstract class AbstractCompetitionRunAdminRestHandler : RestHandler, AccessManag
override val permittedRoles: Set = setOf(RestApiRole.ADMIN)
- fun getRun(runId: UID): RunManager? = RunExecutor.managerForId(runId)
+ fun getRun(runId: UID): InteractiveRunManager? {
+ val run = RunExecutor.managerForId(runId)
+ if (run != null && run is InteractiveRunManager){
+ return run
+ }
+ return null
+ }
fun runId(ctx: Context) = ctx.pathParamMap().getOrElse("runId") {
throw ErrorStatusException(404, "Parameter 'runId' is missing!'", ctx)
@@ -81,7 +84,7 @@ class CreateCompetitionRunAdminHandler(private val competitions: DAO TODO()
- RunType.SYNCHRONOUS -> SynchronousRunManager(competitionToStart, competitionStartMessage.name)
+ RunType.SYNCHRONOUS -> SynchronousInteractiveRunManager(competitionToStart, competitionStartMessage.name)
}
/**... and schedule RunManager. */
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
index ff46a3260..2fc4d63e4 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
@@ -16,8 +16,8 @@ import dev.dres.data.model.Config
import dev.dres.data.model.UID
import dev.dres.data.model.basics.media.MediaCollection
import dev.dres.data.model.competition.TaskType
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunExecutor
-import dev.dres.run.RunManager
import dev.dres.run.RunManagerStatus
import dev.dres.utilities.extensions.UID
import dev.dres.utilities.extensions.sessionId
@@ -42,24 +42,29 @@ abstract class AbstractCompetitionRunRestHandler : RestHandler, AccessManagedRes
//private fun isViewer(ctx: Context): Boolean = AccessManager.rolesOfSession(ctx.sessionId()).contains(RestApiRole.VIEWER) && !AccessManager.rolesOfSession(ctx.sessionId()).contains(RestApiRole.ADMIN)
fun isParticipant(ctx: Context): Boolean = AccessManager.rolesOfSession(ctx.sessionId()).contains(RestApiRole.PARTICIPANT) && !AccessManager.rolesOfSession(ctx.sessionId()).contains(RestApiRole.ADMIN)
- fun getRelevantManagers(ctx: Context): List {
+ fun getRelevantManagers(ctx: Context): List {
if (isParticipant(ctx)) {
val userId = userId(ctx)
- return RunExecutor.managers().filter { m -> m.competitionDescription.teams.any { it.users.contains(userId) } }
+ return RunExecutor.managers().filterIsInstance(InteractiveRunManager::class.java).filter { m -> m.competitionDescription.teams.any { it.users.contains(userId) } }
}
- return RunExecutor.managers()
+ return RunExecutor.managers().filterIsInstance(InteractiveRunManager::class.java)
}
- fun getRun(ctx: Context, runId: UID): RunManager? {
+ fun getRun(ctx: Context, runId: UID): InteractiveRunManager? {
if (isParticipant(ctx)) {
val userId = userId(ctx)
val run = RunExecutor.managerForId(runId) ?: return null
- if (run.competitionDescription.teams.any { it.users.contains(userId) }) {
+ if (run is InteractiveRunManager && run.competitionDescription.teams.any { it.users.contains(userId) }) {
return run
}
return null
}
- return RunExecutor.managerForId(runId)
+ val run = RunExecutor.managerForId(runId)
+ if (run != null && run is InteractiveRunManager){
+ return run
+ }
+ return null
+
}
fun runId(ctx: Context) = ctx.pathParamMap().getOrElse("runId") {
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
index 1345e8463..96a5f05c7 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
@@ -5,8 +5,8 @@ import dev.dres.api.rest.RestApiRole
import dev.dres.api.rest.types.status.ErrorStatus
import dev.dres.api.rest.types.status.ErrorStatusException
import dev.dres.data.model.UID
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunExecutor
-import dev.dres.run.RunManager
import dev.dres.run.score.scoreboard.Score
import dev.dres.run.score.scoreboard.ScoreOverview
import dev.dres.utilities.extensions.UID
@@ -45,16 +45,20 @@ abstract class AbstractScoreRestHandler : RestHandler, AccessManagedRestHandler
*/
fun isAdmin(ctx: Context): Boolean = AccessManager.rolesOfSession(ctx.sessionId()).contains(RestApiRole.ADMIN)
- fun getRun(ctx: Context, runId: UID): RunManager? {
+ fun getRun(ctx: Context, runId: UID): InteractiveRunManager? {
if (isParticipant(ctx)) {
val userId = userId(ctx)
val run = RunExecutor.managerForId(runId) ?: return null
- if (run.competitionDescription.teams.any { it.users.contains(userId) }) {
+ if (run is InteractiveRunManager && run.competitionDescription.teams.any { it.users.contains(userId) }) {
return run
}
return null
}
- return RunExecutor.managerForId(runId)
+ val run = RunExecutor.managerForId(runId)
+ if (run != null && run is InteractiveRunManager){
+ return run
+ }
+ return null
}
}
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
index 70e2cdebc..58c1d9fab 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/SubmissionHandler.kt
@@ -16,6 +16,7 @@ import dev.dres.data.model.basics.media.MediaItemSegmentList
import dev.dres.data.model.basics.media.PlayableMediaItem
import dev.dres.data.model.competition.TaskType
import dev.dres.data.model.run.*
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunManager
import dev.dres.run.RunManagerStatus
import dev.dres.run.audit.AuditLogger
@@ -49,8 +50,8 @@ class SubmissionHandler (val collections: DAO, private val item
private fun getRelevantManagers(userId: UID): Set = AccessManager.getRunManagerForUser(userId)
- private fun getActiveRun(userId: UID, ctx: Context): RunManager {
- val managers = getRelevantManagers(userId).filter { it.status == RunManagerStatus.RUNNING_TASK }
+ private fun getActiveRun(userId: UID, ctx: Context): InteractiveRunManager {
+ val managers = getRelevantManagers(userId).filterIsInstance(InteractiveRunManager::class.java).filter { it.status == RunManagerStatus.RUNNING_TASK }
if (managers.isEmpty()) {
throw ErrorStatusException(404, "There is currently no eligible competition with an active task.", ctx)
}
@@ -62,7 +63,7 @@ class SubmissionHandler (val collections: DAO, private val item
return managers.first()
}
- private fun toSubmission(ctx: Context, userId: UID, runManager: RunManager, submissionTime: Long): Submission {
+ private fun toSubmission(ctx: Context, userId: UID, runManager: InteractiveRunManager, submissionTime: Long): Submission {
val map = ctx.queryParamMap()
/* Find team that the user belongs to. */
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
index eb4c4b838..78b560848 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
@@ -1,6 +1,7 @@
package dev.dres.api.rest.types.run
import dev.dres.data.model.run.CompetitionRun
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunManager
import dev.dres.run.RunManagerStatus
@@ -13,6 +14,6 @@ import dev.dres.run.RunManagerStatus
* @version 1.0.2
*/
data class RunState(val id: String, val status: RunManagerStatus, val currentTask: TaskInfo?, val timeLeft: Long) {
- constructor(run: RunManager) : this(run.id.string, run.status, run.currentTask?.let { TaskInfo(it) }, run.timeLeft() / 1000)
+ constructor(run: InteractiveRunManager) : this(run.id.string, run.status, run.currentTask?.let { TaskInfo(it) }, run.timeLeft() / 1000)
}
diff --git a/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt b/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
new file mode 100644
index 000000000..9ac54bc1e
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
@@ -0,0 +1,136 @@
+package dev.dres.run
+
+import dev.dres.data.model.UID
+import dev.dres.data.model.competition.CompetitionDescription
+import dev.dres.data.model.competition.TaskDescription
+import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.Submission
+import dev.dres.data.model.run.SubmissionStatus
+import dev.dres.run.score.scoreboard.Scoreboard
+
+interface InteractiveRunManager : RunManager {
+
+ /**
+ * Reference to the currently active [TaskDescription].
+ *
+ * Part of the [RunManager]'s navigational state.
+ */
+ val currentTask: TaskDescription?
+
+ /**
+ * Reference to the [CompetitionRun.TaskRun] that is currently being executed OR that has just ended.
+ *
+ * Part of the [RunManager]'s execution state. Can be null!
+ */
+ val currentTaskRun: CompetitionRun.TaskRun?
+
+ /**
+ * Prepares this [RunManager] for the execution of previous [Task] as per order defined in [CompetitionDescription.tasks].
+ * Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
+ *
+ * As all state affecting methods, this method throws an [IllegalStateException] if invocation
+ * does not match the current state.
+ *
+ * @return True if [Task] was moved, false otherwise. Usually happens if last [Task] has been reached.
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
+ */
+ fun previousTask(): Boolean
+
+ /**
+ * Prepares this [RunManager] for the execution of next [Task] as per order defined in [CompetitionDescription.tasks].
+ * Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
+ *
+ * As all state affecting methods, this method throws an [IllegalStateException] if invocation
+ * does not match the current state.
+ *
+ * @return True if [Task] was moved, false otherwise. Usually happens if last [Task] has been reached.
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
+ */
+ fun nextTask(): Boolean
+
+ /**
+ * Prepares this [RunManager] for the execution of the [Task] given by the index as per order
+ * defined in [CompetitionDescription.tasks]. Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
+ *
+ * As all state affecting methods, this method throws an [IllegalStateException] if invocation
+ * does not match the current state.
+ *
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
+ */
+ fun goToTask(index: Int)
+
+ /**
+ * Starts the [RunManager.currentTask] and thus moves the [RunManager.status] from
+ * [RunManagerStatus.ACTIVE] to either [RunManagerStatus.PREPARING_TASK] or [RunManagerStatus.RUNNING_TASK]
+ *
+ * As all state affecting methods, this method throws an [IllegalStateException] if invocation
+ * does not match the current state.
+ *
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE] or [RunManager.currentTask] is not set.
+ */
+ fun startTask()
+
+ /**
+ * Force-abort the [RunManager.currentTask] and thus moves the [RunManager.status] from
+ * [RunManagerStatus.PREPARING_TASK] or [RunManagerStatus.RUNNING_TASK] to [RunManagerStatus.ACTIVE]
+ *
+ * As all state affecting methods, this method throws an [IllegalStateException] if invocation
+ * does not match the current state.
+ *
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
+ */
+ fun abortTask()
+
+ /**
+ * Adjusts the duration of the current [TaskRun] by the specified amount. Amount can be positive or negative.
+ *
+ * @param s The number of seconds to adjust the duration by.
+ * @return Time remaining until the task will end.
+ *
+ * @throws IllegalArgumentException If the specified correction cannot be applied.
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
+ */
+ fun adjustDuration(s: Int): Long
+
+ /**
+ * Returns the time in milliseconds that is left until the end of the currently running task.
+ * Only works if the [RunManager] is in state [RunManagerStatus.RUNNING_TASK]. If no task is running,
+ * this method returns -1L.
+ *
+ * @return Time remaining until the task will end or -1, if no task is running.
+ */
+ fun timeLeft(): Long
+
+ /**
+ * Returns [CompetitionRun.TaskRun]s for the specified index. The index is zero based, i.e.,
+ * an index of 0 returns the first [CompetitionRun.TaskRun], index of 1 the second etc.
+ *
+ * @param taskRunId The [UID] of the desired [CompetitionRun.TaskRun].
+ */
+ fun taskRunForId(taskRunId: UID): CompetitionRun.TaskRun?
+
+ /**
+ * Override the ready state for a given viewer ID.
+ *
+ * @param viewerId The ID of the viewer that should be overridden.
+ * @return true on success, false otherwise
+ */
+ fun overrideReadyState(viewerId: String): Boolean
+
+ /**
+ * Invoked by an external caller to post a new [Submission] for the [Task] that is currently being
+ * executed by this [RunManager]. [Submission]s usually cause updates to the internal state and/or
+ * the [Scoreboard] of this [RunManager].
+ *
+ * This method will not throw an exception and instead returns false if a [Submission] was
+ * ignored for whatever reason (usually a state mismatch). It is up to the caller to re-invoke
+ * this method again.
+ *
+ * @param sub The [Submission] to be posted.
+ * @return [SubmissionStatus] of the [Submission]
+ * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
+ */
+ fun postSubmission(sub: Submission): SubmissionStatus
+
+
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
index 42fd82a23..a2649717b 100644
--- a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
+++ b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
@@ -69,7 +69,7 @@ object RunExecutor : Consumer {
fun init(runs: DAO) {
this.runs = runs
this.runs.filter { !it.hasEnded }.forEach {
- val run = SynchronousRunManager(it) /* TODO: Distinction between Synchronous and Asynchronous runs. */
+ val run = SynchronousInteractiveRunManager(it) /* TODO: Distinction between Synchronous and Asynchronous runs. */
this.schedule(run)
}
}
diff --git a/backend/src/main/kotlin/dev/dres/run/RunManager.kt b/backend/src/main/kotlin/dev/dres/run/RunManager.kt
index 4f4cb6163..ebaaee505 100644
--- a/backend/src/main/kotlin/dev/dres/run/RunManager.kt
+++ b/backend/src/main/kotlin/dev/dres/run/RunManager.kt
@@ -1,11 +1,9 @@
package dev.dres.run
import dev.dres.api.rest.types.WebSocketConnection
-import dev.dres.api.rest.RestApiRole
import dev.dres.api.rest.types.run.websocket.ClientMessage
import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
-import dev.dres.data.model.competition.TaskDescription
import dev.dres.data.model.run.CompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
@@ -38,20 +36,6 @@ interface RunManager : Runnable {
/** List of [ScoreTimePoint]s tracking the states of the different [Scoreboard]s over time*/
val scoreHistory: List
- /**
- * Reference to the currently active [TaskDescription].
- *
- * Part of the [RunManager]'s navigational state.
- */
- val currentTask: TaskDescription?
-
- /**
- * Reference to the [CompetitionRun.TaskRun] that is currently being executed OR that has just ended.
- *
- * Part of the [RunManager]'s execution state. Can be null!
- */
- val currentTaskRun: CompetitionRun.TaskRun?
-
/**
* List of [Submission]s for the current [CompetitionRun.TaskRun].
*
@@ -90,90 +74,6 @@ interface RunManager : Runnable {
*/
fun end()
- /**
- * Prepares this [RunManager] for the execution of previous [Task] as per order defined in [CompetitionDescription.tasks].
- * Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
- *
- * As all state affecting methods, this method throws an [IllegalStateException] if invocation
- * does not match the current state.
- *
- * @return True if [Task] was moved, false otherwise. Usually happens if last [Task] has been reached.
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
- */
- fun previousTask(): Boolean
-
- /**
- * Prepares this [RunManager] for the execution of next [Task] as per order defined in [CompetitionDescription.tasks].
- * Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
- *
- * As all state affecting methods, this method throws an [IllegalStateException] if invocation
- * does not match the current state.
- *
- * @return True if [Task] was moved, false otherwise. Usually happens if last [Task] has been reached.
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
- */
- fun nextTask(): Boolean
-
- /**
- * Prepares this [RunManager] for the execution of the [Task] given by the index as per order
- * defined in [CompetitionDescription.tasks]. Requires [RunManager.status] to be [RunManagerStatus.ACTIVE].
- *
- * As all state affecting methods, this method throws an [IllegalStateException] if invocation
- * does not match the current state.
- *
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE]
- */
- fun goToTask(index: Int)
-
- /**
- * Starts the [RunManager.currentTask] and thus moves the [RunManager.status] from
- * [RunManagerStatus.ACTIVE] to either [RunManagerStatus.PREPARING_TASK] or [RunManagerStatus.RUNNING_TASK]
- *
- * As all state affecting methods, this method throws an [IllegalStateException] if invocation
- * does not match the current state.
- *
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.ACTIVE] or [RunManager.currentTask] is not set.
- */
- fun startTask()
-
- /**
- * Force-abort the [RunManager.currentTask] and thus moves the [RunManager.status] from
- * [RunManagerStatus.PREPARING_TASK] or [RunManagerStatus.RUNNING_TASK] to [RunManagerStatus.ACTIVE]
- *
- * As all state affecting methods, this method throws an [IllegalStateException] if invocation
- * does not match the current state.
- *
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
- */
- fun abortTask()
-
- /**
- * Adjusts the duration of the current [TaskRun] by the specified amount. Amount can be positive or negative.
- *
- * @param s The number of seconds to adjust the duration by.
- * @return Time remaining until the task will end.
- *
- * @throws IllegalArgumentException If the specified correction cannot be applied.
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
- */
- fun adjustDuration(s: Int): Long
-
- /**
- * Returns the time in milliseconds that is left until the end of the currently running task.
- * Only works if the [RunManager] is in state [RunManagerStatus.RUNNING_TASK]. If no task is running,
- * this method returns -1L.
- *
- * @return Time remaining until the task will end or -1, if no task is running.
- */
- fun timeLeft(): Long
-
- /**
- * Returns [CompetitionRun.TaskRun]s for the specified index. The index is zero based, i.e.,
- * an index of 0 returns the first [CompetitionRun.TaskRun], index of 1 the second etc.
- *
- * @param taskRunId The [UID] of the desired [CompetitionRun.TaskRun].
- */
- fun taskRunForId(taskRunId: UID): CompetitionRun.TaskRun?
/**
* Returns the number of [CompetitionRun.TaskRun]s held by this [RunManager].
@@ -189,13 +89,6 @@ interface RunManager : Runnable {
*/
fun viewers(): HashMap
- /**
- * Override the ready state for a given viewer ID.
- *
- * @param viewerId The ID of the viewer that should be overridden.
- * @return true on success, false otherwise
- */
- fun overrideReadyState(viewerId: String): Boolean
/**
* Invoked by an external caller such in order to inform the [RunManager] that it has received a [ClientMessage].
@@ -210,20 +103,6 @@ interface RunManager : Runnable {
*/
fun wsMessageReceived(connection: WebSocketConnection, message: ClientMessage): Boolean
- /**
- * Invoked by an external caller to post a new [Submission] for the [Task] that is currently being
- * executed by this [RunManager]. [Submission]s usually cause updates to the internal state and/or
- * the [Scoreboard] of this [RunManager].
- *
- * This method will not throw an exception and instead returns false if a [Submission] was
- * ignored for whatever reason (usually a state mismatch). It is up to the caller to re-invoke
- * this method again.
- *
- * @param sub The [Submission] to be posted.
- * @return [SubmissionStatus] of the [Submission]
- * @throws IllegalStateException If [RunManager] was not in status [RunManagerStatus.RUNNING_TASK].
- */
- fun postSubmission(sub: Submission): SubmissionStatus
/**
* Invoked by an external caller to update an existing [Submission] by its [Submission.uid] with a new [SubmissionStatus].
diff --git a/backend/src/main/kotlin/dev/dres/run/SynchronousRunManager.kt b/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
similarity index 96%
rename from backend/src/main/kotlin/dev/dres/run/SynchronousRunManager.kt
rename to backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
index 3403778ab..7e1ff3904 100644
--- a/backend/src/main/kotlin/dev/dres/run/SynchronousRunManager.kt
+++ b/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
@@ -37,7 +37,7 @@ import kotlin.math.max
* @version 2.1.0
* @author Ralph Gasser
*/
-class SynchronousRunManager(val run: CompetitionRun) : RunManager {
+class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRunManager {
private val VIEWER_TIME_OUT = 30L //TODO make configurable
@@ -55,15 +55,15 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
*/
constructor(description: CompetitionDescription, name: String) : this(CompetitionRun(UID.EMPTY, name, description).apply { RunExecutor.runs.append(this) })
- /** Run ID of this [SynchronousRunManager]. */
+ /** Run ID of this [SynchronousInteractiveRunManager]. */
override val id: UID
get() = this.run.id
- /** Name of this [SynchronousRunManager]. */
+ /** Name of this [SynchronousInteractiveRunManager]. */
override val name: String
get() = this.run.name
- /** The [CompetitionDescription] executed by this [SynchronousRunManager]. */
+ /** The [CompetitionDescription] executed by this [SynchronousInteractiveRunManager]. */
override val competitionDescription: CompetitionDescription
get() = this.run.competitionDescription
@@ -88,7 +88,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
this.currentTaskRun?.submissions ?: emptyList()
}
- /** The list of all [Submission]s tracked ever received by this [SynchronousRunManager]. */
+ /** The list of all [Submission]s tracked ever received by this [SynchronousInteractiveRunManager]. */
override val allSubmissions: List
get() = this.stateLock.read {
this.run.runs.flatMap { it.submissions }
@@ -106,11 +106,11 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
}
private set
- /** Returns list [JudgementValidator]s associated with this [SynchronousRunManager]. May be empty*/
+ /** Returns list [JudgementValidator]s associated with this [SynchronousInteractiveRunManager]. May be empty*/
override val judgementValidators: List
get() = this.run.runs.mapNotNull { if (it.hasStarted && it.validator is JudgementValidator) it.validator else null }
- /** List of [Scoreboard]s for this [SynchronousRunManager]. */
+ /** List of [Scoreboard]s for this [SynchronousInteractiveRunManager]. */
override val scoreboards: List
get() = this._scoreboards.scoreboards
@@ -121,28 +121,28 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
/** Internal data structure that tracks all [WebSocketConnection]s and their ready state (for [RunManagerStatus.PREPARING_TASK]) */
private val readyLatch = ReadyLatch()
- /** The internal [ScoreboardsUpdatable] instance for this [SynchronousRunManager]. */
+ /** The internal [ScoreboardsUpdatable] instance for this [SynchronousInteractiveRunManager]. */
private val _scoreboards = ScoreboardsUpdatable(this.competitionDescription.generateDefaultScoreboards(), SCOREBOARD_UPDATE_INTERVAL_MS, this.run)
- /** The internal [MessageQueueUpdatable] instance used by this [SynchronousRunManager]. */
+ /** The internal [MessageQueueUpdatable] instance used by this [SynchronousInteractiveRunManager]. */
private val messageQueueUpdatable = MessageQueueUpdatable(RunExecutor)
- /** The internal [ScoresUpdatable] instance for this [SynchronousRunManager]. */
+ /** The internal [ScoresUpdatable] instance for this [SynchronousInteractiveRunManager]. */
private val scoresUpdatable = ScoresUpdatable(this.id, this._scoreboards, this.messageQueueUpdatable)
- /** The internal [DAOUpdatable] instance used by this [SynchronousRunManager]. */
+ /** The internal [DAOUpdatable] instance used by this [SynchronousInteractiveRunManager]. */
private val daoUpdatable = DAOUpdatable(RunExecutor.runs, this.run)
/** The internal [DAOUpdatable] used to end a task once no more submissions are possible */
private val endTaskUpdatable = EndTaskUpdatable(this)
- /** List of [Updatable] held by this [SynchronousRunManager]. */
+ /** List of [Updatable] held by this [SynchronousInteractiveRunManager]. */
private val updatables = mutableListOf()
///** The pipeline for [Submission] processing. All [Submission]s undergo three steps: filter, validation and score update. */
//private val submissionPipeline: List> = LinkedList()
- /** A lock for state changes to this [SynchronousRunManager]. */
+ /** A lock for state changes to this [SynchronousInteractiveRunManager]. */
private val stateLock = ReentrantReadWriteLock()
init {
@@ -350,7 +350,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
}
/**
- * Lists all WebsSocket session IDs for viewer instances currently registered to this [SynchronousRunManager].
+ * Lists all WebsSocket session IDs for viewer instances currently registered to this [SynchronousInteractiveRunManager].
*
* @return Map of session ID to ready state.
*/
@@ -466,7 +466,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
var errorCounter = 0
- /** Start [SynchronousRunManager] . */
+ /** Start [SynchronousInteractiveRunManager] . */
while (this.status != RunManagerStatus.TERMINATED) {
try {
/* Obtain lock on current state. */
@@ -521,7 +521,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
}
/**
- * Invokes all [Updatable]s registered with this [SynchronousRunManager].
+ * Invokes all [Updatable]s registered with this [SynchronousInteractiveRunManager].
*/
private fun invokeUpdatables() {
this.updatables.forEach {
@@ -536,7 +536,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
}
/**
- * This is an internal method that facilitates internal state updates to this [SynchronousRunManager],
+ * This is an internal method that facilitates internal state updates to this [SynchronousInteractiveRunManager],
* i.e., status updates that are not triggered by an outside interaction.
*/
private fun internalStateUpdate() {
@@ -563,7 +563,7 @@ class SynchronousRunManager(val run: CompetitionRun) : RunManager {
val task = this.currentTaskRun!!
task.end()
this.status = RunManagerStatus.TASK_ENDED
- AuditLogger.taskEnd(this.id, this.currentTask.name, LogEventSource.INTERNAL, null);
+ AuditLogger.taskEnd(this.id, this.currentTask.name, LogEventSource.INTERNAL, null)
EventStreamProcessor.event(TaskEndEvent(this.id, task.uid))
}
diff --git a/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt b/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
index 9b843b549..68b811399 100644
--- a/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
+++ b/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
@@ -2,11 +2,11 @@ package dev.dres.run.updatables
import dev.dres.data.model.competition.TaskType
import dev.dres.data.model.run.SubmissionStatus
-import dev.dres.run.RunManager
+import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunManagerStatus
import java.util.concurrent.atomic.AtomicInteger
-class EndTaskUpdatable(private val run: RunManager) : Updatable {
+class EndTaskUpdatable(private val run: InteractiveRunManager) : Updatable {
override val phase: Phase = Phase.MAIN
From 671e405c7a8240cdb4010733c731ad757bba637f Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Sun, 7 Feb 2021 20:43:40 +0100
Subject: [PATCH 17/95] First sketch of data structures for batch submissions
---
.../dev/dres/data/model/run/Submission.kt | 47 ++++++++++++++++---
.../dev/dres/run/NonInteractiveRunManager.kt | 9 ++++
2 files changed, 50 insertions(+), 6 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/run/NonInteractiveRunManager.kt
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt b/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
index 75d5de273..a883e1184 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
@@ -6,7 +6,6 @@ import dev.dres.data.model.basics.media.MediaItem
import dev.dres.data.model.basics.time.TemporalPoint
import dev.dres.data.model.basics.time.TemporalRange
import dev.dres.data.model.basics.time.TemporalUnit
-import java.util.*
/**
* A [Submission] as received by a competition participant.
@@ -15,16 +14,25 @@ import java.util.*
* @version 1.0.1
*/
-interface BaseSubmissionAspect {
+interface StatusAspect {
+ var status: SubmissionStatus
+}
+
+interface ItemAspect {
+ val item: MediaItem
+}
+
+interface OriginAspect {
val uid: UID
val teamId: UID
val memberId: UID
+}
+
+interface BaseSubmissionAspect : StatusAspect, ItemAspect, OriginAspect {
val timestamp: Long
- val item: MediaItem
- var status: SubmissionStatus
}
-interface TemporalSubmissionAspect : BaseSubmissionAspect {
+interface TemporalAspect {
/** Start time in milliseconds */
val start: Long
@@ -35,6 +43,8 @@ interface TemporalSubmissionAspect : BaseSubmissionAspect {
val temporalRange: TemporalRange
}
+interface TemporalSubmissionAspect : BaseSubmissionAspect, TemporalAspect
+
interface SpatialSubmissionAspect : BaseSubmissionAspect {
//TODO some spatial representation
}
@@ -75,4 +85,29 @@ data class TemporalSubmission(override val teamId: UID,
override val temporalRange: TemporalRange
get() = TemporalRange(TemporalPoint(start.toDouble(), TemporalUnit.MILLISECONDS), TemporalPoint(end.toDouble(), TemporalUnit.MILLISECONDS))
-}
\ No newline at end of file
+}
+
+interface BaseBatch {
+ val task: TaskRunId
+ val name: String
+ val results: List
+}
+
+data class TemporalBatchElement(
+ override val item: MediaItem,
+ override val start: Long,
+ override val end: Long,
+ override val temporalRange: TemporalRange
+) : ItemAspect, TemporalAspect
+
+interface BaseSubmissionBatch : OriginAspect {
+ val results : Collection
+}
+
+data class TemporalSubmissionBatch
+ (
+ override val teamId: UID,
+ override val memberId: UID,
+ override val uid: UID,
+ override val results: Collection>,
+) : BaseSubmissionBatch>
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/run/NonInteractiveRunManager.kt b/backend/src/main/kotlin/dev/dres/run/NonInteractiveRunManager.kt
new file mode 100644
index 000000000..ea00bedb5
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/run/NonInteractiveRunManager.kt
@@ -0,0 +1,9 @@
+package dev.dres.run
+
+import dev.dres.data.model.run.BaseSubmissionBatch
+
+interface NonInteractiveRunManager : RunManager {
+
+ fun addSubmissionBatch(batch: BaseSubmissionBatch<*>)
+
+}
\ No newline at end of file
From b8b87c413e8a5a8eb3811b494e950c11031b7caa Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Mon, 8 Feb 2021 19:26:26 +0100
Subject: [PATCH 18/95] More refactoring in preparation for non-interactive
runs
---
.../dev/dres/api/cli/CompetitionRunCommand.kt | 81 +++++----
.../handler/CompetitionRunAdminHandler.kt | 26 +--
.../api/rest/handler/CompetitionRunHandler.kt | 2 +-
.../handler/CompetitionRunScoreHandler.kt | 8 +-
.../dres/api/rest/handler/JudgementHandler.kt | 4 +-
.../dev/dres/api/rest/types/run/RunInfo.kt | 4 +-
.../dev/dres/api/rest/types/run/RunState.kt | 4 +-
.../dev/dres/api/rest/types/run/TaskInfo.kt | 5 +-
.../dev/dres/api/rest/types/run/TeamInfo.kt | 4 +-
.../dev/dres/data/dbo/DataAccessLayer.kt | 5 +-
.../dev/dres/data/model/run/CompetitionRun.kt | 162 +-----------------
.../model/run/InteractiveCompetitionRun.kt | 145 ++++++++++++++++
.../model/run/NonInteractiveCompetitonRun.kt | 22 +++
.../dev/dres/data/model/run/Submission.kt | 2 +-
.../kotlin/dev/dres/data/model/run/Task.kt | 25 +++
.../serializers/CompetitionRunSerializer.kt | 57 ++++--
.../dev/dres/run/InteractiveRunManager.kt | 21 ++-
.../main/kotlin/dev/dres/run/RunExecutor.kt | 14 +-
.../main/kotlin/dev/dres/run/RunManager.kt | 21 +--
.../run/SynchronousInteractiveRunManager.kt | 50 +++---
.../SynchronousNonInteractiveRunManager.kt | 82 +++++++++
.../dev/dres/run/eventstream/StreamEvent.kt | 1 -
.../interfaces/RecalculatingTaskRunScorer.kt | 4 +-
.../scoreboard/MaxNormalizingScoreBoard.kt | 6 +-
.../dres/run/score/scoreboard/Scoreboard.kt | 4 +-
.../scoreboard/SumAggregateScoreBoard.kt | 4 +-
.../dres/run/updatables/EndTaskUpdatable.kt | 2 +-
.../run/updatables/ScoreboardsUpdatable.kt | 6 +-
.../dres/run/updatables/ScoresUpdatable.kt | 10 +-
29 files changed, 478 insertions(+), 303 deletions(-)
create mode 100644 backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
create mode 100644 backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
create mode 100644 backend/src/main/kotlin/dev/dres/data/model/run/Task.kt
create mode 100644 backend/src/main/kotlin/dev/dres/run/SynchronousNonInteractiveRunManager.kt
diff --git a/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt b/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
index 6052786c5..17f5546e1 100644
--- a/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
+++ b/backend/src/main/kotlin/dev/dres/api/cli/CompetitionRunCommand.kt
@@ -10,6 +10,7 @@ import com.jakewharton.picnic.table
import dev.dres.data.dbo.DAO
import dev.dres.data.model.UID
import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.SubmissionStatus
import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunExecutor
@@ -81,7 +82,8 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
override fun run() {
if (plain) {
this@CompetitionRunCommand.runs.forEach {
- println("${RunSummary(it.id.string, it.name, it.competitionDescription.description, it.lastTask?.task?.name)}")
+ println("${RunSummary(it.id.string, it.name, it.competitionDescription.description, if (it is InteractiveCompetitionRun) it.lastTask?.taskDescription?.name
+ ?: "N/A" else "N/A")}")
}
} else {
table {
@@ -106,8 +108,8 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
}else{
"unkown"
}
- row(it.id, it.name, it.competitionDescription.description, it.lastTask?.task?.name
- ?: "N/A", status)
+ row(it.id, it.name, it.competitionDescription.description, if (it is InteractiveCompetitionRun) it.lastTask?.taskDescription?.name
+ ?: "N/A" else "N/A", status)
}
}
}
@@ -210,11 +212,15 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
println()
println("Evaluated Tasks:")
- it.runs.forEach {
- println(it.task)
+ it.tasks.forEach {t ->
+ println(t.taskDescription)
+
+ if (t is InteractiveCompetitionRun.TaskRun){
+ println("Submissions")
+ t.submissions.forEach { println(it) }
+ }
+
- println("Submissions")
- it.submissions.forEach { println(it) }
}
println()
}
@@ -244,17 +250,22 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
return
}
- /* Fetch submissions and reset them. */
- val submissions = run.runs.flatMap {
- it.submissions
- }.filter {
- it.uid.string in ids
- }
- submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
+ if (run is InteractiveCompetitionRun) {
+
+ /* Fetch submissions and reset them. */
+ val submissions = run.tasks.flatMap {
+ it.submissions
+ }.filter {
+ it.uid.string in ids
+ }
+ submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
- /* Update competition run through dao. */
- this@CompetitionRunCommand.runs.update(run)
- println("Successfully reset ${submissions.size} submissions.")
+ /* Update competition run through dao. */
+ this@CompetitionRunCommand.runs.update(run)
+ println("Successfully reset ${submissions.size} submissions.")
+ } else {
+ println("Operation not supported for run type")
+ }
}
}
@@ -272,16 +283,20 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
return
}
- /* Fetch submissions and reset them. */
- val submissions = run.runs.filter {
- it.uid.string in ids
- }.flatMap {
- it.submissions
- }
- submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
+ if (run is InteractiveCompetitionRun) {
+ /* Fetch submissions and reset them. */
+ val submissions = run.tasks.filter {
+ it.uid.string in ids
+ }.flatMap {
+ it.submissions
+ }
+ submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
- this@CompetitionRunCommand.runs.update(run)
- println("Successfully reset ${submissions.size} submissions.")
+ this@CompetitionRunCommand.runs.update(run)
+ println("Successfully reset ${submissions.size} submissions.")
+ } else {
+ println("Operation not supported for run type")
+ }
}
}
@@ -298,12 +313,18 @@ class CompetitionRunCommand(internal val runs: DAO) : NoOpCliktC
return
}
- val submissions = run.runs.filter { it.task.taskGroup.name == taskGroup }.flatMap { it.submissions }
- submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
+ if (run is InteractiveCompetitionRun) {
+
+ val submissions =
+ run.tasks.filter { it.taskDescription.taskGroup.name == taskGroup }.flatMap { it.submissions }
+ submissions.forEach { it.status = SubmissionStatus.INDETERMINATE }
- this@CompetitionRunCommand.runs.update(run)
+ this@CompetitionRunCommand.runs.update(run)
- println("reset ${submissions.size} submissions")
+ println("reset ${submissions.size} submissions")
+ } else {
+ println("Operation not supported for run type")
+ }
}
}
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
index c8fe59956..2530af01a 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunAdminHandler.kt
@@ -13,7 +13,7 @@ import dev.dres.data.model.Config
import dev.dres.data.model.UID
import dev.dres.data.model.basics.media.MediaCollection
import dev.dres.data.model.competition.CompetitionDescription
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.run.*
import dev.dres.run.audit.AuditLogger
import dev.dres.run.audit.LogEventSource
@@ -48,7 +48,7 @@ abstract class AbstractCompetitionRunAdminRestHandler : RestHandler, AccessManag
}
/**
- * REST handler to create a [CompetitionRun].
+ * REST handler to create a [InteractiveCompetitionRun].
*/
class CreateCompetitionRunAdminHandler(private val competitions: DAO, private val collections: DAO, config: Config) : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
@@ -131,7 +131,7 @@ class CreateCompetitionRunAdminHandler(private val competitions: DAO {
override val route: String = "run/admin/:runId/start"
@@ -162,7 +162,7 @@ class StartCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler()
}
/**
- * REST handler to move to the next task in a [CompetitionRun].
+ * REST handler to move to the next task in a [InteractiveCompetitionRun].
*/
class NextTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/task/next"
@@ -195,7 +195,7 @@ class NextTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandle
}
/**
- * REST handler to move to the next task in a [CompetitionRun].
+ * REST handler to move to the next task in a [InteractiveCompetitionRun].
*/
class SwitchTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/task/switch/:idx"
@@ -234,7 +234,7 @@ class SwitchTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHand
}
/**
- * REST handler to move to the previous task in a [CompetitionRun].
+ * REST handler to move to the previous task in a [InteractiveCompetitionRun].
*/
class PreviousTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/task/previous"
@@ -267,7 +267,7 @@ class PreviousTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHa
}
/**
- * REST handler to start the current task in a [CompetitionRun].
+ * REST handler to start the current task in a [InteractiveCompetitionRun].
*/
class StartTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/task/start"
@@ -299,7 +299,7 @@ class StartTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandl
}
/**
- * REST handler to abort the current task in a [CompetitionRun].
+ * REST handler to abort the current task in a [InteractiveCompetitionRun].
*/
class AbortTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/task/abort"
@@ -331,7 +331,7 @@ class AbortTaskCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandl
}
/**
- * REST handler to terminate a [CompetitionRun].
+ * REST handler to terminate a [InteractiveCompetitionRun].
*/
class TerminateCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/terminate"
@@ -362,7 +362,7 @@ class TerminateCompetitionRunAdminHandler : AbstractCompetitionRunAdminRestHandl
}
/**
- * REST handler to adjust a [CompetitionRun.TaskRun]'s duration.
+ * REST handler to adjust a [InteractiveCompetitionRun.TaskRun]'s duration.
*/
class AdjustDurationRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), PostRestHandler {
override val route: String = "run/admin/:runId/adjust/:duration"
@@ -428,7 +428,7 @@ class ListSubmissionsPerTaskRunAdminHandler : AbstractCompetitionRunAdminRestHan
val taskId = ctx.pathParamMap().getOrElse("taskId") {
throw ErrorStatusException(404, "Parameter 'taskId' is missing!'", ctx)
}.UID()
- return run.submissions.filter { it.taskRun?.taskId?.equals(taskId) ?: false }.map { SubmissionInfo.withId(it) }.toTypedArray()
+ return run.submissions.filter { it.taskRun?.taskDescriptionId?.equals(taskId) ?: false }.map { SubmissionInfo.withId(it) }.toTypedArray()
}
}
@@ -457,7 +457,7 @@ class OverrideSubmissionStatusRunAdminHandler: AbstractCompetitionRunAdminRestHa
val toPatchRest = ctx.body()
/* Sanity check to see, whether the submission exists */
- val found = run.submissions.find { it.uid == (toPatchRest.id?.UID() ?: UID.EMPTY)}
+ run.submissions.find { it.uid == (toPatchRest.id?.UID() ?: UID.EMPTY)}
?: throw ErrorStatusException(404, "The given submission $toPatchRest was not found", ctx)
if(run.updateSubmission(toPatchRest.id!!.UID(), toPatchRest.status) ){
@@ -470,7 +470,7 @@ class OverrideSubmissionStatusRunAdminHandler: AbstractCompetitionRunAdminRestHa
}
/**
- * REST handler to list all viewers for a [CompetitionRun].
+ * REST handler to list all viewers for a [InteractiveCompetitionRun].
*/
class ListViewersRunAdminHandler : AbstractCompetitionRunAdminRestHandler(), GetRestHandler> {
override val route: String = "run/admin/:runId/viewer/list"
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
index 2fc4d63e4..6dce28eb5 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunHandler.kt
@@ -376,7 +376,7 @@ class HistorySubmissionInfoHandler : AbstractCompetitionRunRestHandler(), GetRes
}
val taskId = ctx.pathParamMap()["taskId"]?.UID() ?: throw ErrorStatusException(404, "Missing task id", ctx)
- return if (run.currentTaskRun?.taskId == taskId && run.status == RunManagerStatus.RUNNING_TASK) {
+ return if (run.currentTaskRun?.taskDescriptionId == taskId && run.status == RunManagerStatus.RUNNING_TASK) {
if (run.currentTask?.taskType?.options?.any{ it.option == TaskType.Options.HIDDEN_RESULTS} == true) {
run.submissions.map { SubmissionInfo.blind(it) }
} else {
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
index 96a5f05c7..2338a8263 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/CompetitionRunScoreHandler.kt
@@ -20,7 +20,7 @@ import io.javalin.plugin.openapi.annotations.OpenApiResponse
/**
* A collection of [RestHandler]s that deal with [ScoreOverview]s for ongoing
- * [dev.dres.data.model.run.CompetitionRun]s.
+ * [dev.dres.data.model.run.InteractiveCompetitionRun]s.
*
* @author Ralph Gasser
* @version 1.0.0
@@ -63,7 +63,7 @@ abstract class AbstractScoreRestHandler : RestHandler, AccessManagedRestHandler
}
/**
- * Generates and lists all [ScoreOverview]s for the provided [dev.dres.data.model.run.CompetitionRun].
+ * Generates and lists all [ScoreOverview]s for the provided [dev.dres.data.model.run.InteractiveCompetitionRun].
*
* @author Ralph Gasser
* @version 1.0.0
@@ -91,7 +91,7 @@ class ListCompetitionScoreHandler : AbstractScoreRestHandler(), GetRestHandler) : Abstract
val collection = this.collections[next.second.item.collection] ?: throw ErrorStatusException(404, "Could not find collection with id ${next.second.item.collection}", ctx)
- val taskDescription = next.second.taskRun?.task?.textualDescription() ?: next.second.taskRun?.task?.name ?: "no task description available"
+ val taskDescription = next.second.taskRun?.taskDescription?.textualDescription() ?: next.second.taskRun?.taskDescription?.name ?: "no task description available"
return if (next.second is TemporalSubmissionAspect){
val tsa = next.second as TemporalSubmissionAspect
@@ -206,7 +206,7 @@ class NextOpenVoteJudgementHandler(val collections: DAO) : Abst
val collection = this.collections[next.item.collection] ?: throw ErrorStatusException(404, "Could not find collection with id ${next.item.collection}", ctx)
- val taskDescription = next.taskRun?.task?.textualDescription() ?: next.taskRun?.task?.name ?: "no task description available"
+ val taskDescription = next.taskRun?.taskDescription?.textualDescription() ?: next.taskRun?.taskDescription?.name ?: "no task description available"
return if (next is TemporalSubmissionAspect){
val tsa = next as TemporalSubmissionAspect
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunInfo.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunInfo.kt
index 3b9310fd1..e38826b5c 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunInfo.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunInfo.kt
@@ -1,10 +1,10 @@
package dev.dres.api.rest.types.run
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.run.RunManager
/**
- * Contains the basic and most importantly static information about a [CompetitionRun] and the
+ * Contains the basic and most importantly static information about a [InteractiveCompetitionRun] and the
* associated [RunManager]. Since this information usually doesn't change in the course of a run,
* it allows for local caching and other optimizations.
*
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
index 78b560848..1bd19001e 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/run/RunState.kt
@@ -1,12 +1,12 @@
package dev.dres.api.rest.types.run
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.run.InteractiveRunManager
import dev.dres.run.RunManager
import dev.dres.run.RunManagerStatus
/**
- * Contains the information about the state of a [CompetitionRun] and the associated [RunManager].
+ * Contains the information about the state of a [InteractiveCompetitionRun] and the associated [RunManager].
*
* This is information that changes in the course of a run an therefore must be updated frequently.
*
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/run/TaskInfo.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/run/TaskInfo.kt
index 266570184..fca572f17 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/run/TaskInfo.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/run/TaskInfo.kt
@@ -1,12 +1,11 @@
package dev.dres.api.rest.types.run
import dev.dres.data.model.competition.TaskDescription
-import dev.dres.data.model.competition.TaskType
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
/**
* Basic and most importantly static information about the [dres.data.model.competition.TaskDescription]
- * of a [CompetitionRun]. Since this information usually doesn't change in the course of a run, it
+ * of a [InteractiveCompetitionRun]. Since this information usually doesn't change in the course of a run, it
* allows for local caching and other optimizations.
*
* @author Ralph Gasser
diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/run/TeamInfo.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/run/TeamInfo.kt
index 13315ace1..b75c0da91 100644
--- a/backend/src/main/kotlin/dev/dres/api/rest/types/run/TeamInfo.kt
+++ b/backend/src/main/kotlin/dev/dres/api/rest/types/run/TeamInfo.kt
@@ -1,10 +1,10 @@
package dev.dres.api.rest.types.run
import dev.dres.data.model.competition.Team
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
/**
- * Basic and most importantly static information about the [Team] partaking in a [CompetitionRun].
+ * Basic and most importantly static information about the [Team] partaking in a [InteractiveCompetitionRun].
* Since this information usually doesn't change in the course of a run,t allows for local caching
* and other optimizations.
*
diff --git a/backend/src/main/kotlin/dev/dres/data/dbo/DataAccessLayer.kt b/backend/src/main/kotlin/dev/dres/data/dbo/DataAccessLayer.kt
index 26ffc806d..7ec541882 100644
--- a/backend/src/main/kotlin/dev/dres/data/dbo/DataAccessLayer.kt
+++ b/backend/src/main/kotlin/dev/dres/data/dbo/DataAccessLayer.kt
@@ -1,5 +1,6 @@
package dev.dres.data.dbo
+import dev.dres.data.model.run.CompetitionRun
import dev.dres.data.serializers.*
import java.nio.file.Path
@@ -32,8 +33,8 @@ class DataAccessLayer(private val basePath: Path) {
/** List of [dev.dres.data.model.competition.CompetitionDescription]s managed by this DRES instance. */
val competitions = DAO(this.basePath.resolve("competitions.db"), competitionSerializer)
- /** List of [dev.dres.data.model.run.CompetitionRun]s managed by this DRES instance. */
- val runs = DAO(this.basePath.resolve("runs.db"), CompetitionRunSerializer(competitionSerializer))
+ /** List of [dev.dres.data.model.run.InteractiveCompetitionRun]s managed by this DRES instance. */
+ val runs: DAO = DAO(this.basePath.resolve("runs.db"), CompetitionRunSerializer(competitionSerializer))
val audit = DAO(this.basePath.resolve("auditLog.db"), AuditLogEntrySerializer, cacheDuration = 1440)
val auditTimes = NumericDaoIndexer(audit){it.timestamp}
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
index 63682f5e4..329ffe6a7 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
@@ -1,40 +1,16 @@
package dev.dres.data.model.run
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import dev.dres.data.model.Entity
import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
-import dev.dres.data.model.competition.TaskDescription
-import dev.dres.data.model.competition.TaskDescriptionId
-import dev.dres.data.model.run.CompetitionRun.TaskRun
-import dev.dres.run.filter.SubmissionFilter
-import dev.dres.run.score.interfaces.TaskRunScorer
-import dev.dres.run.validation.interfaces.SubmissionValidator
-import java.util.*
+import dev.dres.data.model.run.InteractiveCompetitionRun.TaskRun
typealias CompetitionRunId = UID
typealias TaskRunId = UID
-/**
- * Represents a concrete [Run] of a [CompetitionDescription]. [CompetitionRun]s can be started and
- * ended and they can be used to create new [TaskRun]s and access the current [TaskRun].
- *
- * @author Ralph Gasser
- * @param 1.2.1
- */
-open class CompetitionRun(override var id: CompetitionRunId, val name: String, val competitionDescription: CompetitionDescription): Run, Entity {
+abstract class CompetitionRun(override var id: CompetitionRunId, val name: String, val competitionDescription: CompetitionDescription): Run, Entity {
- internal constructor(id: CompetitionRunId, name: String, competitionDescription: CompetitionDescription, started: Long, ended: Long) : this(id, name, competitionDescription) {
- this.started = if (started == -1L) { null } else { started }
- this.ended = if (ended == -1L) { null } else { ended }
- }
-
- init {
- require(competitionDescription.tasks.size > 0) { "Cannot create a run from a competition that doesn't have any tasks. "}
- require(competitionDescription.teams.size > 0) { "Cannot create a run from a competition that doesn't have any teams. "}
- }
-
- /** Timestamp of when this [CompetitionRun] was started. */
+ /** Timestamp of when this [InteractiveCompetitionRun] was started. */
@Volatile
override var started: Long? = null
protected set
@@ -44,15 +20,8 @@ open class CompetitionRun(override var id: CompetitionRunId, val name: String, v
override var ended: Long? = null
protected set
- /** List of [TaskRun]s registered for this [CompetitionRun]. */
- val runs: List = LinkedList()
-
- /** Returns the last [TaskRun]. */
- val lastTask: TaskRun?
- get() = this.runs.lastOrNull()
-
/**
- * Starts this [CompetitionRun].
+ * Starts this [InteractiveCompetitionRun].
*/
open fun start() {
if (this.hasStarted) {
@@ -62,7 +31,7 @@ open class CompetitionRun(override var id: CompetitionRunId, val name: String, v
}
/**
- * Ends this [CompetitionRun].
+ * Ends this [InteractiveCompetitionRun].
*/
open fun end() {
if (!this.isRunning) {
@@ -71,125 +40,6 @@ open class CompetitionRun(override var id: CompetitionRunId, val name: String, v
this.ended = System.currentTimeMillis()
}
- /**
- * Creates a new [TaskRun] for the given [TaskDescription].
- *
- * @param taskId [UID] of the [TaskDescription] to start a [TaskRun] for.
- */
- fun newTaskRun(taskId: TaskDescriptionId): TaskRun {
- if (this@CompetitionRun.runs.isEmpty() || this@CompetitionRun.runs.last().hasEnded) {
- val ret = TaskRun(taskId = taskId)
- (this.runs as MutableList).add(ret)
- return ret
- } else {
- throw IllegalStateException("Another Task is currently running.")
- }
- }
-
- override fun toString(): String = "CompetitionRun(id=$id, name=${name})"
-
-
-
-
- /**
- * Represents a concrete [Run] of a [TaskDescription]. [TaskRun]s always exist within a [CompetitionRun].
- * As a [CompetitionRun], [TaskRun]s can be started and ended and they can be used to register [Submission]s.
- *
- * @version 1.2.0
- * @author Ralph Gasser
- */
- @JsonIgnoreProperties(value = ["competition"])
- inner class TaskRun (val uid: TaskRunId = UID(), val taskId: UID): Run {
-
- internal constructor(uid: TaskRunId, taskId: TaskDescriptionId, started: Long, ended: Long): this(uid, taskId) {
- this.started = if (started == -1L) { null } else { started }
- this.ended = if (ended == -1L) { null } else { ended }
- }
+ abstract val tasks: List
- /** List of [Submission]s* registered for this [TaskRun]. */
- val submissions: List = mutableListOf()
-
- /** The [CompetitionRun] this [TaskRun] belongs to.*/
- val competition: CompetitionRun
- get() = this@CompetitionRun
-
- /** The position of this [TaskRun] within the [CompetitionRun]. */
- val position: Int
- get() = this@CompetitionRun.runs.indexOf(this)
-
- /** Reference to the [TaskDescription] describing this [TaskRun]. */
- @Transient
- val task: TaskDescription = this@CompetitionRun.competitionDescription.tasks.find { it.id == this.taskId } ?: throw IllegalArgumentException("There is no task with ID ${this.taskId}.")
-
- /** The [SubmissionFilter] used to filter [Submission]s. */
- @Transient
- val filter: SubmissionFilter = this.task.newFilter()
-
- /** The [TaskRunScorer] used to update score for this [TaskRun]. */
- @Transient
- val scorer: TaskRunScorer = this.task.newScorer()
-
- /** The [SubmissionValidator] used to validate [Submission]s. */
- @Transient
- val validator: SubmissionValidator = this.task.newValidator()
-
- /** Timestamp of when this [TaskRun] was started. */
- @Volatile
- override var started: Long? = null
- private set
-
- /** Timestamp of when this [TaskRun] was ended. */
- @Volatile
- override var ended: Long? = null
- private set
-
- /** Duration of this [TaskRun]. Defaults to the duration specified in the [TaskDescription]. */
- @Volatile
- var duration: Long = this.task.duration
-
- /**
- * Starts this [CompetitionRun.TaskRun].
- */
- internal fun start() {
- if (this.hasStarted) {
- throw IllegalStateException("Task run '${this@CompetitionRun.name}.${this.position}' has already been started.")
- }
- this.started = System.currentTimeMillis()
- }
-
- /**
- * Ends this [CompetitionRun.TaskRun].
- */
- internal fun end() {
- if (!this.isRunning) {
- val end = System.currentTimeMillis()
- this.started = end
- this.ended = end
- } else {
- this.ended = System.currentTimeMillis()
- }
- }
-
- /**
- * Adds a [Submission] to this [TaskRun].
- *
- * @param submission The [Submission] to add.
- */
- @Synchronized
- fun addSubmission(submission: Submission) {
- if (!this.isRunning) {
- throw IllegalStateException("Task run '${this@CompetitionRun.name}.${this.position}' is currently not running.")
- }
- if (!this@CompetitionRun.competitionDescription.teams.any { it.uid == submission.teamId }) {
- throw IllegalStateException("Team ${submission.teamId} does not exists for competition run ${this@CompetitionRun.name}.")
- }
- if (!this.filter.test(submission)) {
- throw IllegalArgumentException("The provided submission $submission was rejected.")
- }
-
- /* Process Submission. */
- (this.submissions as MutableList).add(submission)
- this.validator.validate(submission)
- }
- }
}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
new file mode 100644
index 000000000..1d20b9c1f
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
@@ -0,0 +1,145 @@
+package dev.dres.data.model.run
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties
+import dev.dres.data.model.UID
+import dev.dres.data.model.competition.CompetitionDescription
+import dev.dres.data.model.competition.TaskDescription
+import dev.dres.data.model.competition.TaskDescriptionId
+import dev.dres.data.model.run.InteractiveCompetitionRun.TaskRun
+import java.util.*
+
+
+/**
+ * Represents a concrete [Run] of a [CompetitionDescription]. [InteractiveCompetitionRun]s can be started and
+ * ended and they can be used to create new [TaskRun]s and access the current [TaskRun].
+ *
+ * @author Ralph Gasser
+ * @param 1.2.1
+ */
+open class InteractiveCompetitionRun(override var id: CompetitionRunId, name: String, competitionDescription: CompetitionDescription): CompetitionRun(id, name, competitionDescription) {
+
+ internal constructor(id: CompetitionRunId, name: String, competitionDescription: CompetitionDescription, started: Long, ended: Long) : this(id, name, competitionDescription) {
+ this.started = if (started == -1L) { null } else { started }
+ this.ended = if (ended == -1L) { null } else { ended }
+ }
+
+ init {
+ require(competitionDescription.tasks.size > 0) { "Cannot create a run from a competition that doesn't have any tasks. "}
+ require(competitionDescription.teams.size > 0) { "Cannot create a run from a competition that doesn't have any teams. "}
+ }
+
+ /** List of [TaskRun]s registered for this [InteractiveCompetitionRun]. */
+ override val tasks: List = LinkedList()
+
+ /** Returns the last [TaskRun]. */
+ val lastTask: TaskRun?
+ get() = this.tasks.lastOrNull()
+
+ /**
+ * Creates a new [TaskRun] for the given [TaskDescription].
+ *
+ * @param taskId [UID] of the [TaskDescription] to start a [TaskRun] for.
+ */
+ fun newTaskRun(taskId: TaskDescriptionId): TaskRun {
+ if (this@InteractiveCompetitionRun.tasks.isEmpty() || this@InteractiveCompetitionRun.tasks.last().hasEnded) {
+ val ret = TaskRun(taskDescriptionId = taskId)
+ (this.tasks as MutableList).add(ret)
+ return ret
+ } else {
+ throw IllegalStateException("Another Task is currently running.")
+ }
+ }
+
+ override fun toString(): String = "InteractiveCompetitionRun(id=$id, name=${name})"
+
+
+ /**
+ * Represents a concrete [Run] of a [TaskDescription]. [TaskRun]s always exist within a [InteractiveCompetitionRun].
+ * As a [InteractiveCompetitionRun], [TaskRun]s can be started and ended and they can be used to register [Submission]s.
+ *
+ * @version 1.2.0
+ * @author Ralph Gasser
+ */
+ @JsonIgnoreProperties(value = ["competition"])
+ inner class TaskRun (val uid: TaskRunId = UID(), val taskDescriptionId: TaskDescriptionId): Run, Task() {
+
+ internal constructor(uid: TaskRunId, taskId: TaskDescriptionId, started: Long, ended: Long): this(uid, taskId) {
+ this.started = if (started == -1L) { null } else { started }
+ this.ended = if (ended == -1L) { null } else { ended }
+ }
+
+ /** List of [Submission]s* registered for this [TaskRun]. */
+ val submissions: List = mutableListOf()
+
+ /** The [InteractiveCompetitionRun] this [TaskRun] belongs to.*/
+ val competition: InteractiveCompetitionRun
+ get() = this@InteractiveCompetitionRun
+
+ /** The position of this [TaskRun] within the [InteractiveCompetitionRun]. */
+ val position: Int
+ get() = this@InteractiveCompetitionRun.tasks.indexOf(this)
+
+ /** Reference to the [TaskDescription] describing this [TaskRun]. */
+ @Transient
+ override val taskDescription: TaskDescription = this@InteractiveCompetitionRun.competitionDescription.tasks.find { it.id == this.taskDescriptionId } ?: throw IllegalArgumentException("There is no task with ID ${this.taskDescriptionId}.")
+
+ /** Timestamp of when this [TaskRun] was started. */
+ @Volatile
+ override var started: Long? = null
+ private set
+
+ /** Timestamp of when this [TaskRun] was ended. */
+ @Volatile
+ override var ended: Long? = null
+ private set
+
+ /** Duration of this [TaskRun]. Defaults to the duration specified in the [TaskDescription]. */
+ @Volatile
+ var duration: Long = this.taskDescription.duration
+
+ /**
+ * Starts this [InteractiveCompetitionRun.TaskRun].
+ */
+ internal fun start() {
+ if (this.hasStarted) {
+ throw IllegalStateException("Task run '${this@InteractiveCompetitionRun.name}.${this.position}' has already been started.")
+ }
+ this.started = System.currentTimeMillis()
+ }
+
+ /**
+ * Ends this [InteractiveCompetitionRun.TaskRun].
+ */
+ internal fun end() {
+ if (!this.isRunning) {
+ val end = System.currentTimeMillis()
+ this.started = end
+ this.ended = end
+ } else {
+ this.ended = System.currentTimeMillis()
+ }
+ }
+
+ /**
+ * Adds a [Submission] to this [TaskRun].
+ *
+ * @param submission The [Submission] to add.
+ */
+ @Synchronized
+ fun addSubmission(submission: Submission) {
+ if (!this.isRunning) {
+ throw IllegalStateException("Task run '${this@InteractiveCompetitionRun.name}.${this.position}' is currently not running.")
+ }
+ if (!this@InteractiveCompetitionRun.competitionDescription.teams.any { it.uid == submission.teamId }) {
+ throw IllegalStateException("Team ${submission.teamId} does not exists for competition run ${this@InteractiveCompetitionRun.name}.")
+ }
+ if (!this.filter.test(submission)) {
+ throw IllegalArgumentException("The provided submission $submission was rejected.")
+ }
+
+ /* Process Submission. */
+ (this.submissions as MutableList).add(submission)
+ this.validator.validate(submission)
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
new file mode 100644
index 000000000..7df7059f6
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
@@ -0,0 +1,22 @@
+package dev.dres.data.model.run
+
+import dev.dres.data.model.competition.CompetitionDescription
+import dev.dres.data.model.competition.TaskDescription
+import dev.dres.data.model.competition.TaskDescriptionId
+
+
+open class NonInteractiveCompetitionRun(override var id: CompetitionRunId, name: String, competitionDescription: CompetitionDescription): CompetitionRun(id, name, competitionDescription) {
+
+ override val tasks: List = TODO()
+
+
+
+ inner class TaskContainer(val taskDescriptionId: TaskDescriptionId) : Task() {
+ override val taskDescription: TaskDescription = this@NonInteractiveCompetitionRun.competitionDescription.tasks.find { it.id == this.taskDescriptionId } ?: throw IllegalArgumentException("There is no task with ID ${this.taskDescriptionId}.")
+
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt b/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
index a883e1184..03c5bafcd 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/Submission.kt
@@ -60,7 +60,7 @@ sealed class Submission(override val teamId: UID,
@Transient
@JsonIgnore
- var taskRun: CompetitionRun.TaskRun? = null
+ var taskRun: InteractiveCompetitionRun.TaskRun? = null
internal set
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/Task.kt b/backend/src/main/kotlin/dev/dres/data/model/run/Task.kt
new file mode 100644
index 000000000..9a9508297
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/Task.kt
@@ -0,0 +1,25 @@
+package dev.dres.data.model.run
+
+import dev.dres.data.model.competition.TaskDescription
+import dev.dres.run.filter.SubmissionFilter
+import dev.dres.run.score.interfaces.TaskRunScorer
+import dev.dres.run.validation.interfaces.SubmissionValidator
+
+abstract class Task {
+
+ /** Reference to the [TaskDescription] describing this [Task]. */
+ abstract val taskDescription: TaskDescription
+
+ /** The [SubmissionFilter] used to filter [Submission]s. */
+ @Transient
+ val filter: SubmissionFilter = taskDescription.newFilter()
+
+ /** The [TaskRunScorer] used to update score for this [Task]. */
+ @Transient
+ val scorer: TaskRunScorer = taskDescription.newScorer()
+
+ /** The [SubmissionValidator] used to validate [Submission]s. */
+ @Transient
+ val validator: SubmissionValidator = taskDescription.newValidator()
+
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/data/serializers/CompetitionRunSerializer.kt b/backend/src/main/kotlin/dev/dres/data/serializers/CompetitionRunSerializer.kt
index 28bb77e90..07222236f 100644
--- a/backend/src/main/kotlin/dev/dres/data/serializers/CompetitionRunSerializer.kt
+++ b/backend/src/main/kotlin/dev/dres/data/serializers/CompetitionRunSerializer.kt
@@ -1,6 +1,8 @@
package dev.dres.data.serializers
import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
+import dev.dres.data.model.run.NonInteractiveCompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.utilities.extensions.UID
import dev.dres.utilities.extensions.readUID
@@ -11,33 +13,56 @@ import org.mapdb.Serializer
class CompetitionRunSerializer(private val competitionSerializer: CompetitionSerializer): Serializer {
override fun serialize(out: DataOutput2, value: CompetitionRun) {
+ when(value) {
+ is InteractiveCompetitionRun -> out.packInt(1)
+ is NonInteractiveCompetitionRun -> out.packInt(2)
+ }
out.writeUID(value.id)
out.writeUTF(value.name)
competitionSerializer.serialize(out, value.competitionDescription)
out.writeLong(value.started ?: -1)
out.writeLong(value.ended ?: -1)
- out.writeInt(value.runs.size)
- for (taskRun in value.runs) {
- out.writeUID(taskRun.uid)
- out.writeUID(taskRun.taskId)
- out.writeLong(taskRun.started ?: -1)
- out.writeLong(taskRun.ended ?: -1)
- out.writeInt(taskRun.submissions.size)
- for (submission in taskRun.submissions) {
- SubmissionSerializer.serialize(out, submission)
+ out.writeInt(value.tasks.size)
+
+ when(value){
+ is InteractiveCompetitionRun -> {
+ for (taskRun in value.tasks) {
+ out.writeUID(taskRun.uid)
+ out.writeUID(taskRun.taskDescriptionId)
+ out.writeLong(taskRun.started ?: -1)
+ out.writeLong(taskRun.ended ?: -1)
+ out.writeInt(taskRun.submissions.size)
+ for (submission in taskRun.submissions) {
+ SubmissionSerializer.serialize(out, submission)
+ }
+ }
+ }
+ is NonInteractiveCompetitionRun -> {
+ //TODO
}
}
+
+
}
override fun deserialize(input: DataInput2, available: Int): CompetitionRun {
- val run = CompetitionRun(input.readUTF().UID(), input.readUTF(), competitionSerializer.deserialize(input, available), input.readLong(), input.readLong())
- for (i in 0 until input.readInt()) {
- val taskRun = run.TaskRun(input.readUID(), input.readUID(), input.readLong(), input.readLong())
- for (j in 0 until input.readInt()) {
- (taskRun.submissions as MutableList).add(SubmissionSerializer.deserialize(input,available))
+ return when(val type = input.unpackInt()) {
+ 1 -> {
+ val run = InteractiveCompetitionRun(input.readUTF().UID(), input.readUTF(), competitionSerializer.deserialize(input, available), input.readLong(), input.readLong())
+ for (i in 0 until input.readInt()) {
+ val taskRun = run.TaskRun(input.readUID(), input.readUID(), input.readLong(), input.readLong())
+ for (j in 0 until input.readInt()) {
+ (taskRun.submissions as MutableList).add(SubmissionSerializer.deserialize(input,available))
+ }
+ (run.tasks as MutableList).add(taskRun)
+ }
+ run
+ }
+ 2 -> {
+ TODO()
}
- (run.runs as MutableList).add(taskRun)
+ else -> throw IllegalArgumentException("Unknown CompetitionRun type: $type")
}
- return run
+
}
}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt b/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
index 9ac54bc1e..b12845202 100644
--- a/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
+++ b/backend/src/main/kotlin/dev/dres/run/InteractiveRunManager.kt
@@ -3,7 +3,7 @@ package dev.dres.run
import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.competition.TaskDescription
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
import dev.dres.run.score.scoreboard.Scoreboard
@@ -18,11 +18,18 @@ interface InteractiveRunManager : RunManager {
val currentTask: TaskDescription?
/**
- * Reference to the [CompetitionRun.TaskRun] that is currently being executed OR that has just ended.
+ * List of [Submission]s for the current [InteractiveCompetitionRun.TaskRun].
+ *
+ * Part of the [RunManager]'s execution state. Can be empty!
+ */
+ val submissions: List
+
+ /**
+ * Reference to the [InteractiveCompetitionRun.TaskRun] that is currently being executed OR that has just ended.
*
* Part of the [RunManager]'s execution state. Can be null!
*/
- val currentTaskRun: CompetitionRun.TaskRun?
+ val currentTaskRun: InteractiveCompetitionRun.TaskRun?
/**
* Prepares this [RunManager] for the execution of previous [Task] as per order defined in [CompetitionDescription.tasks].
@@ -102,12 +109,12 @@ interface InteractiveRunManager : RunManager {
fun timeLeft(): Long
/**
- * Returns [CompetitionRun.TaskRun]s for the specified index. The index is zero based, i.e.,
- * an index of 0 returns the first [CompetitionRun.TaskRun], index of 1 the second etc.
+ * Returns [InteractiveCompetitionRun.TaskRun]s for the specified index. The index is zero based, i.e.,
+ * an index of 0 returns the first [InteractiveCompetitionRun.TaskRun], index of 1 the second etc.
*
- * @param taskRunId The [UID] of the desired [CompetitionRun.TaskRun].
+ * @param taskRunId The [UID] of the desired [InteractiveCompetitionRun.TaskRun].
*/
- fun taskRunForId(taskRunId: UID): CompetitionRun.TaskRun?
+ fun taskRunForId(taskRunId: UID): InteractiveCompetitionRun.TaskRun?
/**
* Override the ready state for a given viewer ID.
diff --git a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
index a2649717b..1ef76876c 100644
--- a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
+++ b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
@@ -9,6 +9,8 @@ import dev.dres.api.rest.types.run.websocket.ServerMessageType
import dev.dres.data.dbo.DAO
import dev.dres.data.model.UID
import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
+import dev.dres.data.model.run.NonInteractiveCompetitionRun
import dev.dres.run.validation.interfaces.JudgementValidator
import dev.dres.utilities.extensions.UID
import dev.dres.utilities.extensions.read
@@ -58,18 +60,22 @@ object RunExecutor : Consumer {
/** Internal array of [Future]s for cleaning after [RunManager]s. See [RunExecutor.cleanerThread]*/
private val results = HashMap, UID>()
- /** Instance of shared [DAO] used to access [CompetitionRun]s. */
+ /** Instance of shared [DAO] used to access [InteractiveCompetitionRun]s. */
lateinit var runs: DAO
/**
* Initializes this [RunExecutor].
*
- * @param runs The shared [DAO] used to access [CompetitionRun]s.
+ * @param runs The shared [DAO] used to access [InteractiveCompetitionRun]s.
*/
fun init(runs: DAO) {
this.runs = runs
- this.runs.filter { !it.hasEnded }.forEach {
- val run = SynchronousInteractiveRunManager(it) /* TODO: Distinction between Synchronous and Asynchronous runs. */
+ this.runs.filter { !it.hasEnded }.forEach { //TODO needs more distinction
+ val run = when(it) {
+ is InteractiveCompetitionRun -> SynchronousInteractiveRunManager(it)
+ is NonInteractiveCompetitionRun -> SynchronousNonInteractiveRunManager(it)
+ else -> throw NotImplementedError("No matching run manager found for $it")
+ }
this.schedule(run)
}
}
diff --git a/backend/src/main/kotlin/dev/dres/run/RunManager.kt b/backend/src/main/kotlin/dev/dres/run/RunManager.kt
index ebaaee505..55cdb8c23 100644
--- a/backend/src/main/kotlin/dev/dres/run/RunManager.kt
+++ b/backend/src/main/kotlin/dev/dres/run/RunManager.kt
@@ -4,7 +4,7 @@ import dev.dres.api.rest.types.WebSocketConnection
import dev.dres.api.rest.types.run.websocket.ClientMessage
import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
import dev.dres.run.score.ScoreTimePoint
@@ -13,9 +13,9 @@ import dev.dres.run.validation.interfaces.JudgementValidator
import java.util.*
/**
- * A managing class for concrete executions of [CompetitionDescription], i.e. [CompetitionRun]s.
+ * A managing class for concrete executions of [CompetitionDescription], i.e. [InteractiveCompetitionRun]s.
*
- * @see CompetitionRun
+ * @see InteractiveCompetitionRun
*
* @author Ralph Gasser
* @version 1.4.0
@@ -36,14 +36,7 @@ interface RunManager : Runnable {
/** List of [ScoreTimePoint]s tracking the states of the different [Scoreboard]s over time*/
val scoreHistory: List
- /**
- * List of [Submission]s for the current [CompetitionRun.TaskRun].
- *
- * Part of the [RunManager]'s execution state. Can be empty!
- */
- val submissions: List
-
- /** List of all [Submission]s for this [RunManager], irrespective of the [CompetitionRun.TaskRun] it belongs to. */
+ /** List of all [Submission]s for this [RunManager], irrespective of the [InteractiveCompetitionRun.TaskRun] it belongs to. */
val allSubmissions: List
/** Current [RunManagerStatus] of the [RunManager]. */
@@ -76,11 +69,11 @@ interface RunManager : Runnable {
/**
- * Returns the number of [CompetitionRun.TaskRun]s held by this [RunManager].
+ * Returns the number of [InteractiveCompetitionRun.TaskRun]s held by this [RunManager].
*
- * @return The number of [CompetitionRun.TaskRun]s held by this [RunManager]
+ * @return The number of [InteractiveCompetitionRun.TaskRun]s held by this [RunManager]
*/
- fun taskRuns(): Int
+ fun tasks(): Int
/**
* Returns a list of viewer [WebSocketConnection]s for this [RunManager] alongside with their respective state.
diff --git a/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt b/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
index 7e1ff3904..c08dc091b 100644
--- a/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
+++ b/backend/src/main/kotlin/dev/dres/run/SynchronousInteractiveRunManager.kt
@@ -9,7 +9,7 @@ import dev.dres.api.rest.types.run.websocket.ServerMessageType
import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.competition.TaskDescription
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
import dev.dres.run.audit.AuditLogger
@@ -32,12 +32,12 @@ import kotlin.math.max
/**
* An implementation of [RunManager] aimed at distributed execution having a single DRES Server instance and multiple
- * viewers connected via WebSocket. Before starting a [CompetitionRun.TaskRun], all viewer instances are synchronized.
+ * viewers connected via WebSocket. Before starting a [InteractiveCompetitionRun.TaskRun], all viewer instances are synchronized.
*
* @version 2.1.0
* @author Ralph Gasser
*/
-class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRunManager {
+class SynchronousInteractiveRunManager(val run: InteractiveCompetitionRun) : InteractiveRunManager {
private val VIEWER_TIME_OUT = 30L //TODO make configurable
@@ -51,9 +51,9 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
private val maxErrorCount = 5
/**
- * Alternative constructor from existing [CompetitionRun].
+ * Alternative constructor from existing [InteractiveCompetitionRun].
*/
- constructor(description: CompetitionDescription, name: String) : this(CompetitionRun(UID.EMPTY, name, description).apply { RunExecutor.runs.append(this) })
+ constructor(description: CompetitionDescription, name: String) : this(InteractiveCompetitionRun(UID.EMPTY, name, description).apply { RunExecutor.runs.append(this) })
/** Run ID of this [SynchronousInteractiveRunManager]. */
override val id: UID
@@ -71,8 +71,8 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
override var currentTask: TaskDescription = this.competitionDescription.tasks[0]
private set
- /** Reference to the currently active [CompetitionRun.TaskRun].*/
- override val currentTaskRun: CompetitionRun.TaskRun?
+ /** Reference to the currently active [InteractiveCompetitionRun.TaskRun].*/
+ override val currentTaskRun: InteractiveCompetitionRun.TaskRun?
get() = this.stateLock.read {
return when (this.status) {
RunManagerStatus.PREPARING_TASK,
@@ -82,7 +82,7 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
}
- /** The list of [Submission]s for the current [CompetitionRun.TaskRun]. */
+ /** The list of [Submission]s for the current [InteractiveCompetitionRun.TaskRun]. */
override val submissions: List
get() = this.stateLock.read {
this.currentTaskRun?.submissions ?: emptyList()
@@ -91,7 +91,7 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
/** The list of all [Submission]s tracked ever received by this [SynchronousInteractiveRunManager]. */
override val allSubmissions: List
get() = this.stateLock.read {
- this.run.runs.flatMap { it.submissions }
+ this.run.tasks.flatMap { it.submissions }
}
/** The status of this [RunManager]. */
@@ -108,7 +108,7 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
/** Returns list [JudgementValidator]s associated with this [SynchronousInteractiveRunManager]. May be empty*/
override val judgementValidators: List
- get() = this.run.runs.mapNotNull { if (it.hasStarted && it.validator is JudgementValidator) it.validator else null }
+ get() = this.run.tasks.mapNotNull { if (it.hasStarted && it.validator is JudgementValidator) it.validator else null }
/** List of [Scoreboard]s for this [SynchronousInteractiveRunManager]. */
override val scoreboards: List
@@ -160,14 +160,14 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/** Re-enqueue pending submissions (if any). */
- this.run.runs.forEach { run ->
+ this.run.tasks.forEach { run ->
run.submissions.filter { it.status == SubmissionStatus.INDETERMINATE }.forEach {
run.validator.validate(it)
}
}
/** Re-calculate all the relevant scores. */
- this.run.runs.forEach { run ->
+ this.run.tasks.forEach { run ->
run.submissions.forEach { sub ->
this.scoresUpdatable.enqueue(Pair(run, sub))
}
@@ -301,21 +301,21 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/**
- * Returns [CompetitionRun.TaskRun]s for a specific task [UID]. May be empty.
+ * Returns [InteractiveCompetitionRun.TaskRun]s for a specific task [UID]. May be empty.
*
- * @param taskRunId The [UID] of the [CompetitionRun.TaskRun].
+ * @param taskRunId The [UID] of the [InteractiveCompetitionRun.TaskRun].
*/
- override fun taskRunForId(taskRunId: UID): CompetitionRun.TaskRun? = this.run.runs.find { it.uid == taskRunId }
+ override fun taskRunForId(taskRunId: UID): InteractiveCompetitionRun.TaskRun? = this.run.tasks.find { it.uid == taskRunId }
/**
- * Returns the number of [CompetitionRun.TaskRun]s held by this [RunManager].
+ * Returns the number of [InteractiveCompetitionRun.TaskRun]s held by this [RunManager].
*
- * @return The number of [CompetitionRun.TaskRun]s held by this [RunManager]
+ * @return The number of [InteractiveCompetitionRun.TaskRun]s held by this [RunManager]
*/
- override fun taskRuns(): Int = this.run.runs.size
+ override fun tasks(): Int = this.run.tasks.size
/**
- * Adjusts the duration of the current [CompetitionRun.TaskRun] by the specified amount. Amount can be either positive or negative.
+ * Adjusts the duration of the current [InteractiveCompetitionRun.TaskRun] by the specified amount. Amount can be either positive or negative.
*
* @param s The number of seconds to adjust the duration by.
* @return Time remaining until the task will end in milliseconds
@@ -334,7 +334,7 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/**
- * Returns the time in milliseconds that is left until the end of the current [CompetitionRun.TaskRun].
+ * Returns the time in milliseconds that is left until the end of the current [InteractiveCompetitionRun.TaskRun].
* Only works if the [RunManager] is in state [RunManagerStatus.RUNNING_TASK]. If no task is running,
* this method returns -1L.
*
@@ -397,8 +397,8 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/**
- * Processes incoming [Submission]s. If a [CompetitionRun.TaskRun] is running then that [Submission] will usually
- * be associated with that [CompetitionRun.TaskRun].
+ * Processes incoming [Submission]s. If a [InteractiveCompetitionRun.TaskRun] is running then that [Submission] will usually
+ * be associated with that [InteractiveCompetitionRun.TaskRun].
*
* This method will not throw an exception and instead return false if a [Submission] was
* ignored for whatever reason (usually a state mismatch). It is up to the caller to re-invoke
@@ -426,8 +426,8 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/**
- * Processes incoming [Submission]s. If a [CompetitionRun.TaskRun] is running then that [Submission] will usually
- * be associated with that [CompetitionRun.TaskRun].
+ * Processes incoming [Submission]s. If a [InteractiveCompetitionRun.TaskRun] is running then that [Submission] will usually
+ * be associated with that [InteractiveCompetitionRun.TaskRun].
*
* This method will not throw an exception and instead return false if a [Submission] was
* ignored for whatever reason (usually a state mismatch). It is up to the caller to re-invoke
@@ -458,7 +458,7 @@ class SynchronousInteractiveRunManager(val run: CompetitionRun) : InteractiveRun
}
/**
- * Internal method that orchestrates the internal progression of the [CompetitionRun].
+ * Internal method that orchestrates the internal progression of the [InteractiveCompetitionRun].
*/
override fun run() {
/** Sort list of by [Phase] in ascending order. */
diff --git a/backend/src/main/kotlin/dev/dres/run/SynchronousNonInteractiveRunManager.kt b/backend/src/main/kotlin/dev/dres/run/SynchronousNonInteractiveRunManager.kt
new file mode 100644
index 000000000..604f3f505
--- /dev/null
+++ b/backend/src/main/kotlin/dev/dres/run/SynchronousNonInteractiveRunManager.kt
@@ -0,0 +1,82 @@
+package dev.dres.run
+
+import dev.dres.api.rest.types.WebSocketConnection
+import dev.dres.api.rest.types.run.websocket.ClientMessage
+import dev.dres.data.model.UID
+import dev.dres.data.model.competition.CompetitionDescription
+import dev.dres.data.model.run.BaseSubmissionBatch
+import dev.dres.data.model.run.NonInteractiveCompetitionRun
+import dev.dres.data.model.run.Submission
+import dev.dres.data.model.run.SubmissionStatus
+import dev.dres.run.score.ScoreTimePoint
+import dev.dres.run.score.scoreboard.Scoreboard
+import dev.dres.run.validation.interfaces.JudgementValidator
+import java.util.*
+import java.util.concurrent.locks.ReentrantReadWriteLock
+
+class SynchronousNonInteractiveRunManager(val run: NonInteractiveCompetitionRun) : NonInteractiveRunManager {
+
+ /** A lock for state changes to this [SynchronousInteractiveRunManager]. */
+ private val stateLock = ReentrantReadWriteLock()
+
+ /** Run ID of this [SynchronousInteractiveRunManager]. */
+ override val id: UID
+ get() = this.run.id
+
+ /** Name of this [SynchronousInteractiveRunManager]. */
+ override val name: String
+ get() = this.run.name
+
+ /** The [CompetitionDescription] executed by this [SynchronousInteractiveRunManager]. */
+ override val competitionDescription: CompetitionDescription
+ get() = this.run.competitionDescription
+
+
+ override val scoreboards: List
+ get() = TODO("Not yet implemented")
+
+ override val scoreHistory: List
+ get() = TODO("Not yet implemented")
+
+
+ override val allSubmissions: List
+ get() = TODO("Not yet implemented")
+
+ override val status: RunManagerStatus
+ get() = TODO("Not yet implemented")
+
+ override val judgementValidators: List
+ get() = TODO("Not yet implemented")
+
+ override fun start() {
+ TODO("Not yet implemented")
+ }
+
+ override fun end() {
+ TODO("Not yet implemented")
+ }
+
+ override fun tasks(): Int {
+ TODO("Not yet implemented")
+ }
+
+ override fun viewers(): HashMap {
+ TODO("Not yet implemented")
+ }
+
+ override fun wsMessageReceived(connection: WebSocketConnection, message: ClientMessage): Boolean {
+ TODO("Not yet implemented")
+ }
+
+ override fun updateSubmission(suid: UID, newStatus: SubmissionStatus): Boolean {
+ TODO("Not yet implemented")
+ }
+
+ override fun run() {
+ TODO("Not yet implemented")
+ }
+
+ override fun addSubmissionBatch(batch: BaseSubmissionBatch<*>) {
+ TODO("Not yet implemented")
+ }
+}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/dev/dres/run/eventstream/StreamEvent.kt b/backend/src/main/kotlin/dev/dres/run/eventstream/StreamEvent.kt
index c055c25f5..7fd9c8fc3 100644
--- a/backend/src/main/kotlin/dev/dres/run/eventstream/StreamEvent.kt
+++ b/backend/src/main/kotlin/dev/dres/run/eventstream/StreamEvent.kt
@@ -5,7 +5,6 @@ import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.competition.TaskDescription
import dev.dres.data.model.log.QueryEventLog
import dev.dres.data.model.log.QueryResultLog
-import dev.dres.data.model.run.CompetitionRun
import dev.dres.data.model.run.Submission
sealed class StreamEvent(var timeStamp : Long = System.currentTimeMillis(), var session: String? = null)
diff --git a/backend/src/main/kotlin/dev/dres/run/score/interfaces/RecalculatingTaskRunScorer.kt b/backend/src/main/kotlin/dev/dres/run/score/interfaces/RecalculatingTaskRunScorer.kt
index 827ce8957..94b3be9d3 100644
--- a/backend/src/main/kotlin/dev/dres/run/score/interfaces/RecalculatingTaskRunScorer.kt
+++ b/backend/src/main/kotlin/dev/dres/run/score/interfaces/RecalculatingTaskRunScorer.kt
@@ -2,11 +2,11 @@ package dev.dres.run.score.interfaces
import dev.dres.data.model.UID
import dev.dres.data.model.competition.TeamId
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.Submission
/**
- * Computes the current scores of all teams for a given [CompetitionRun.TaskRun]
+ * Computes the current scores of all teams for a given [InteractiveCompetitionRun.TaskRun]
*
* @author Luca Rossetto & Ralph Gasser
* @version 1.0.1
diff --git a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/MaxNormalizingScoreBoard.kt b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/MaxNormalizingScoreBoard.kt
index 6e6964f2c..b9e71acdc 100644
--- a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/MaxNormalizingScoreBoard.kt
+++ b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/MaxNormalizingScoreBoard.kt
@@ -3,7 +3,7 @@ package dev.dres.run.score.scoreboard
import dev.dres.data.model.UID
import dev.dres.data.model.competition.TaskDescription
import dev.dres.data.model.competition.Team
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.TaskRunId
import dev.dres.run.score.interfaces.TaskRunScorer
import java.util.concurrent.ConcurrentHashMap
@@ -40,10 +40,10 @@ class MaxNormalizingScoreBoard(override val name: String, teams: List, pri
this.scorePerTaskMap.putAll(scorers.map { it.key to it.value.scores() }.toMap())
}
- override fun update(runs: List) {
+ override fun update(runs: List) {
update(
runs
- .filter { it.started != null && taskFilter(it.task) }
+ .filter { it.started != null && taskFilter(it.taskDescription) }
.map { it.uid to it.scorer }.toMap()
)
}
diff --git a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/Scoreboard.kt b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/Scoreboard.kt
index 622d231b8..753050998 100644
--- a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/Scoreboard.kt
+++ b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/Scoreboard.kt
@@ -3,7 +3,7 @@ package dev.dres.run.score.scoreboard
import dev.dres.data.model.UID
import dev.dres.data.model.competition.Team
import dev.dres.data.model.competition.TeamId
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.TaskRunId
import dev.dres.run.score.interfaces.TaskRunScorer
@@ -43,7 +43,7 @@ interface Scoreboard {
/**
* Updates the [Scoreboard].
*/
- fun update(runs: List)
+ fun update(runs: List)
/**
* Updates using a map of the [TaskRun] ids to the corresponding [TaskRunScorer]s
diff --git a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/SumAggregateScoreBoard.kt b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/SumAggregateScoreBoard.kt
index a3da07086..c16848417 100644
--- a/backend/src/main/kotlin/dev/dres/run/score/scoreboard/SumAggregateScoreBoard.kt
+++ b/backend/src/main/kotlin/dev/dres/run/score/scoreboard/SumAggregateScoreBoard.kt
@@ -1,7 +1,7 @@
package dev.dres.run.score.scoreboard
import dev.dres.data.model.competition.TeamId
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.TaskRunId
import dev.dres.run.score.interfaces.TaskRunScorer
@@ -14,7 +14,7 @@ class SumAggregateScoreBoard(override val name: String, private val boards: List
override fun score(teamId: TeamId) = boards.map { it.score(teamId) }.sum()
- override fun update(runs: List) {
+ override fun update(runs: List) {
//since calls are delegated, nothing needs to be done here
}
diff --git a/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt b/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
index 68b811399..14e7929ba 100644
--- a/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
+++ b/backend/src/main/kotlin/dev/dres/run/updatables/EndTaskUpdatable.kt
@@ -14,7 +14,7 @@ class EndTaskUpdatable(private val run: InteractiveRunManager) : Updatable {
private var submissions = AtomicInteger(0)
override fun update(status: RunManagerStatus) {
- val limitingFilter = run.currentTaskRun?.task?.taskType?.filter?.find{ it.option == TaskType.SubmissionFilterType.LIMIT_CORRECT_PER_TEAM } ?: return
+ val limitingFilter = run.currentTaskRun?.taskDescription?.taskType?.filter?.find{ it.option == TaskType.SubmissionFilterType.LIMIT_CORRECT_PER_TEAM } ?: return
val limit = limitingFilter.parameters.getOrDefault("limit", "1").toIntOrNull() ?: 1
if (this.run.timeLeft() > 0) {
val taskRun = this.run.currentTaskRun
diff --git a/backend/src/main/kotlin/dev/dres/run/updatables/ScoreboardsUpdatable.kt b/backend/src/main/kotlin/dev/dres/run/updatables/ScoreboardsUpdatable.kt
index e20f77131..435d825d9 100644
--- a/backend/src/main/kotlin/dev/dres/run/updatables/ScoreboardsUpdatable.kt
+++ b/backend/src/main/kotlin/dev/dres/run/updatables/ScoreboardsUpdatable.kt
@@ -1,6 +1,6 @@
package dev.dres.run.updatables
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.run.RunManager
import dev.dres.run.RunManagerStatus
import dev.dres.run.score.ScoreTimePoint
@@ -14,7 +14,7 @@ import java.util.*
* @author Ralph Gasser & Luca Rossetto
* @version 1.1.0
*/
-class ScoreboardsUpdatable(val scoreboards: List, val updateIntervalMs: Long, private val run: CompetitionRun): StatefulUpdatable {
+class ScoreboardsUpdatable(val scoreboards: List, val updateIntervalMs: Long, private val run: InteractiveCompetitionRun): StatefulUpdatable {
companion object {
val ELIGIBLE_STATUS = arrayOf(RunManagerStatus.ACTIVE, RunManagerStatus.RUNNING_TASK, RunManagerStatus.TASK_ENDED, RunManagerStatus.PREPARING_TASK)
@@ -40,7 +40,7 @@ class ScoreboardsUpdatable(val scoreboards: List, val updateInterval
this.dirty = false
this.lastUpdate = now
this.scoreboards.forEach {
- it.update(this.run.runs)
+ it.update(this.run.tasks)
it.scores().map{ score -> this._timeSeries.add(ScoreTimePoint(it.name, score)) }
}
}
diff --git a/backend/src/main/kotlin/dev/dres/run/updatables/ScoresUpdatable.kt b/backend/src/main/kotlin/dev/dres/run/updatables/ScoresUpdatable.kt
index 141956d86..8ce9e8b2a 100644
--- a/backend/src/main/kotlin/dev/dres/run/updatables/ScoresUpdatable.kt
+++ b/backend/src/main/kotlin/dev/dres/run/updatables/ScoresUpdatable.kt
@@ -3,7 +3,7 @@ package dev.dres.run.updatables
import dev.dres.api.rest.types.run.websocket.ServerMessage
import dev.dres.api.rest.types.run.websocket.ServerMessageType
import dev.dres.data.model.UID
-import dev.dres.data.model.run.CompetitionRun
+import dev.dres.data.model.run.InteractiveCompetitionRun
import dev.dres.data.model.run.Submission
import dev.dres.data.model.run.SubmissionStatus
import dev.dres.run.RunManagerStatus
@@ -13,7 +13,7 @@ import java.util.*
/**
* This is a [Updatable] that runs necessary post-processing after a [Submission] has been validated;
- * it update the scores for the respective [CompetitionRun.TaskRun].
+ * it update the scores for the respective [InteractiveCompetitionRun.TaskRun].
*
* @author Ralph Gasser
* @version 1.0
@@ -25,17 +25,17 @@ class ScoresUpdatable(val runId: UID, val scoreboardsUpdatable: ScoreboardsUpdat
}
/** Internal list of [Submission] that pend processing. */
- private val list = LinkedList>()
+ private val list = LinkedList>()
/** The [Phase] this [ScoresUpdatable] belongs to. */
override val phase: Phase = Phase.MAIN
/** Enqueues a new [Submission] for post-processing. */
- fun enqueue(submission: Pair) = this.list.add(submission)
+ fun enqueue(submission: Pair) = this.list.add(submission)
override fun update(status: RunManagerStatus) {
if (!this.list.isEmpty()) {
- val scorersToUpdate = mutableSetOf>()
+ val scorersToUpdate = mutableSetOf>()
val removed = this.list.removeIf {
val scorer = it.first.scorer
if (it.second.status != SubmissionStatus.INDETERMINATE) {
From fae85fd7eb0c4d20e6debf4f06481a4356b95af9 Mon Sep 17 00:00:00 2001
From: Luca Rossetto
Date: Thu, 11 Feb 2021 20:13:41 +0100
Subject: [PATCH 19/95] More base structures for non interactive runs
---
.../dev/dres/data/model/run/CompetitionRun.kt | 2 +-
.../model/run/InteractiveCompetitionRun.kt | 6 ++---
.../model/run/NonInteractiveCompetitonRun.kt | 23 +++++++++++++++++--
.../dev/dres/data/model/run/Submission.kt | 4 ++--
.../kotlin/dev/dres/data/model/run/Task.kt | 21 +++++++++++++++++
.../scoreboard/MaxNormalizingScoreBoard.kt | 4 ++--
.../dres/run/score/scoreboard/Scoreboard.kt | 4 ++--
.../scoreboard/SumAggregateScoreBoard.kt | 4 ++--
8 files changed, 54 insertions(+), 14 deletions(-)
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
index 329ffe6a7..495fc1f0f 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/CompetitionRun.kt
@@ -6,7 +6,7 @@ import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.run.InteractiveCompetitionRun.TaskRun
typealias CompetitionRunId = UID
-typealias TaskRunId = UID
+
abstract class CompetitionRun(override var id: CompetitionRunId, val name: String, val competitionDescription: CompetitionDescription): Run, Entity {
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
index 1d20b9c1f..94e5f8b5b 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/InteractiveCompetitionRun.kt
@@ -61,9 +61,9 @@ open class InteractiveCompetitionRun(override var id: CompetitionRunId, name: St
* @author Ralph Gasser
*/
@JsonIgnoreProperties(value = ["competition"])
- inner class TaskRun (val uid: TaskRunId = UID(), val taskDescriptionId: TaskDescriptionId): Run, Task() {
+ inner class TaskRun (override val uid: TaskId = UID(), val taskDescriptionId: TaskDescriptionId): Run, InteractiveTask() {
- internal constructor(uid: TaskRunId, taskId: TaskDescriptionId, started: Long, ended: Long): this(uid, taskId) {
+ internal constructor(uid: TaskId, taskId: TaskDescriptionId, started: Long, ended: Long): this(uid, taskId) {
this.started = if (started == -1L) { null } else { started }
this.ended = if (ended == -1L) { null } else { ended }
}
@@ -126,7 +126,7 @@ open class InteractiveCompetitionRun(override var id: CompetitionRunId, name: St
* @param submission The [Submission] to add.
*/
@Synchronized
- fun addSubmission(submission: Submission) {
+ override fun addSubmission(submission: Submission) {
if (!this.isRunning) {
throw IllegalStateException("Task run '${this@InteractiveCompetitionRun.name}.${this.position}' is currently not running.")
}
diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt b/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
index 7df7059f6..9eff62c3f 100644
--- a/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
+++ b/backend/src/main/kotlin/dev/dres/data/model/run/NonInteractiveCompetitonRun.kt
@@ -1,17 +1,36 @@
package dev.dres.data.model.run
+import dev.dres.data.model.UID
import dev.dres.data.model.competition.CompetitionDescription
import dev.dres.data.model.competition.TaskDescription
import dev.dres.data.model.competition.TaskDescriptionId
+import dev.dres.data.model.competition.TeamId
open class NonInteractiveCompetitionRun(override var id: CompetitionRunId, name: String, competitionDescription: CompetitionDescription): CompetitionRun(id, name, competitionDescription) {
- override val tasks: List = TODO()
+ override val tasks: List = competitionDescription.tasks.map { TaskContainer(taskDescriptionId = it.id) }
+ inner class TaskContainer(override val uid: TaskId = UID(), val taskDescriptionId: TaskDescriptionId) : NonInteractiveTask() {
+
+ private val submissions : MutableMap