diff --git a/helpers/Dojo/DojoBackendHelper.ts b/helpers/Dojo/DojoBackendHelper.ts index b201276faef6eae814dcbff93f7c0325eea20d32..7475376fb003f3661e1363f3c437098b04ad6082 100644 --- a/helpers/Dojo/DojoBackendHelper.ts +++ b/helpers/Dojo/DojoBackendHelper.ts @@ -4,19 +4,19 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js'; class DojoBackendHelper { public getApiUrl(route: ApiRoute, options?: Partial<{ assignmentNameOrUrl: string, exerciseIdOrUrl: string, gitlabProjectId: string }>): string { - const url = `${ ClientsSharedConfig.apiURL }${ route }`; + let url = `${ ClientsSharedConfig.apiURL }${ route }`; if ( options ) { if ( options.assignmentNameOrUrl ) { - return url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl)); + url = url.replace('{{assignmentNameOrUrl}}', encodeURIComponent(options.assignmentNameOrUrl)); } if ( options.exerciseIdOrUrl ) { - return url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl)); + url = url.replace('{{exerciseIdOrUrl}}', encodeURIComponent(options.exerciseIdOrUrl)); } if ( options.gitlabProjectId ) { - return url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId)); + url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId)); } } diff --git a/models/Exercise.ts b/models/Exercise.ts index 1cc6df278985b8bee554a0b78d96d5d558af0e4d..56304057db80e920b70abfee76f451c742df6eab 100644 --- a/models/Exercise.ts +++ b/models/Exercise.ts @@ -18,6 +18,7 @@ interface Exercise { isCorrection: boolean; correctionCommit: Gitlab.CommitSchema | undefined; + correctionDescription: string | undefined; } diff --git a/types/Dojo/ApiRoute.ts b/types/Dojo/ApiRoute.ts index 8e4969b6de34599ca29e803ca6fbcd3a3c91d799..ef63323d1381f1af9f8acc1f3da044602b195fba 100644 --- a/types/Dojo/ApiRoute.ts +++ b/types/Dojo/ApiRoute.ts @@ -1,17 +1,17 @@ enum ApiRoute { - LOGIN = '/login', - REFRESH_TOKENS = '/refresh_tokens', - TEST_SESSION = '/test_session', - GITLAB_CHECK_TEMPLATE_ACCESS = '/gitlab/project/{{gitlabProjectId}}/checkTemplateAccess', - ASSIGNMENT_GET = '/assignments/{{assignmentNameOrUrl}}', - ASSIGNMENT_CREATE = '/assignments', - ASSIGNMENT_PUBLISH = '/assignments/{{assignmentNameOrUrl}}/publish', - ASSIGNMENT_UNPUBLISH = '/assignments/{{assignmentNameOrUrl}}/unpublish', - ASSIGNMENT_CORRECTION_LINK = '/assignments/{{assignmentNameOrUrl}}/corrections', - ASSIGNMENT_CORRECTION_UPDATE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}', - EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises', - EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment', - EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results' + LOGIN = '/login', + REFRESH_TOKENS = '/refresh_tokens', + TEST_SESSION = '/test_session', + GITLAB_CHECK_TEMPLATE_ACCESS = '/gitlab/project/{{gitlabProjectId}}/checkTemplateAccess', + ASSIGNMENT_GET = '/assignments/{{assignmentNameOrUrl}}', + ASSIGNMENT_CREATE = '/assignments', + ASSIGNMENT_PUBLISH = '/assignments/{{assignmentNameOrUrl}}/publish', + ASSIGNMENT_UNPUBLISH = '/assignments/{{assignmentNameOrUrl}}/unpublish', + ASSIGNMENT_CORRECTION_LINK = '/assignments/{{assignmentNameOrUrl}}/corrections', + ASSIGNMENT_CORRECTION_UPDATE_DELETE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}', + EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises', + EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment', + EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results' }