-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiViewerState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package dev.dres.api.rest.types.evaluation | ||
|
||
import dev.dres.api.rest.types.evaluation.scores.ApiScore | ||
import dev.dres.api.rest.types.evaluation.scores.ApiTeamGroupValue | ||
import dev.dres.api.rest.types.evaluation.submission.ApiSubmission | ||
import dev.dres.api.rest.types.template.team.ApiTeamGroup | ||
import dev.dres.data.model.run.interfaces.EvaluationId | ||
import dev.dres.data.model.run.interfaces.TaskId | ||
import dev.dres.data.model.template.task.TaskTemplateId | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* A DTO to transfer the initial state to the viewer. | ||
* Contains all relevant information for the viewer to initiate itself. | ||
*/ | ||
@Serializable | ||
data class ApiViewerState( | ||
/** The [EvaluationId] of the evaluation this state represents */ | ||
val evaluationId: EvaluationId, | ||
/** The name of the evaluation this state represents */ | ||
val evaluationName: String, | ||
/** The [ApiTeamInfo]s related to this evaluation */ | ||
val teamInfos: List<ApiTeamInfo>, | ||
/** The [ApiTeamGroup]s of this evaluation */ | ||
val teamGroups: List<ApiTeamGroup>, | ||
/** The [ApiTeamGroupValue]s associated with the [ApiTeamGroup]s */ | ||
val teamGroupValue: List<ApiTeamGroupValue>, | ||
|
||
/** The [ApiScore]s of the active task */ | ||
val taskScores: List<ApiScore>, | ||
/** The [ApiScore]s, grouped for the entire evaluation */ | ||
val evaluationScores: Map<String, List<ApiScore>>, // ApiScoreOverview had taskGroup in it | ||
|
||
/** The [TaskId] of the current task. Could also only be selected task so far */ | ||
val activeTaskId: TaskId, | ||
/** The [TaskTemplateId] of the current task. */ | ||
val activeTaskTemplateId: TaskTemplateId, | ||
/** The time elapsed so far */ | ||
val timeElapsed: Long, | ||
/** The time remaining. Null means the task is perpetually running */ | ||
val timeRemaining: Long?, // Prepare perpetual task | ||
/** The [ApiTaskStatus] of the currently active task */ | ||
val activeTaskStatus: ApiTaskStatus, | ||
/** The [ApiSubmission]s related to the currently active task */ | ||
val submissionsOverview: List<ApiSubmission> | ||
) |
4 changes: 3 additions & 1 deletion
4
backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/scores/ApiScore.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package dev.dres.api.rest.types.evaluation.scores | ||
|
||
import dev.dres.data.model.template.team.TeamId | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* A container class to track scores per team. | ||
* | ||
* @author Ralph Gasser | ||
* @version 1.0.0 | ||
*/ | ||
data class ApiScore(val teamId: TeamId, val score: Double) | ||
@Serializable | ||
data class ApiScore(val teamId: TeamId, val score: Double) |
3 changes: 3 additions & 0 deletions
3
backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/scores/ApiTeamGroupValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package dev.dres.api.rest.types.evaluation.scores | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* | ||
*/ | ||
@Serializable | ||
data class ApiTeamGroupValue(val name: String, val value: Double) |