Class BaseSubmissionControllerWithoutRequestMapping<A>
java.lang.Object
at.jku.dke.etutor.task_app.controllers.BaseSubmissionControllerWithoutRequestMapping<A>
- Type Parameters:
A
- The type of the submission input used inSubmitSubmissionDto
.
- All Implemented Interfaces:
SubmissionController<A>
- Direct Known Subclasses:
BaseSubmissionController
public abstract class BaseSubmissionControllerWithoutRequestMapping<A>
extends Object
implements SubmissionController<A>
Base implementation of
SubmissionController
.
Add @RestController
and @RequestMapping("/api/submission/[subpath]")
to the extending class.
If your task app only supports one task type, you can use BaseSubmissionController
instead.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseSubmissionControllerWithoutRequestMapping
(SubmissionService<A> submissionService) Creates a new instance of classBaseSubmissionControllerWithoutRequestMapping
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract URI
createDetailsUri
(UUID id) Creates the URI for the details of the submission with the given ID.Returns the evaluation result for a submission.ResponseEntity
<org.springframework.data.domain.Page<SubmissionDto<A>>> getSubmissions
(org.springframework.data.domain.Pageable page, String userFilter, Long taskFilter, String assignmentFilter, SubmissionMode modeFilter) Returns a paged (filtered) list of submissions.submit
(SubmitSubmissionDto<A> submission, boolean runInBackground, boolean persist) Executes and grades a submission.
-
Field Details
-
submissionService
The submission service.
-
-
Constructor Details
-
BaseSubmissionControllerWithoutRequestMapping
Creates a new instance of classBaseSubmissionControllerWithoutRequestMapping
.- Parameters:
submissionService
- The submission service.
-
-
Method Details
-
submit
public ResponseEntity<Serializable> submit(SubmitSubmissionDto<A> submission, boolean runInBackground, boolean persist) Executes and grades a submission.- Specified by:
submit
in interfaceSubmissionController<A>
- Parameters:
submission
- The submission.runInBackground
- Whether to run the grading in background or wait for grading to finish (default:false
).persist
- Whether to persist the submission (default:true
). Only applies ifrunInBackground
isfalse
.- Returns:
- The submission identifier if
runInBackground
istrue
; the grading result ifrunInBackground
isfalse
; or an error response.
-
getResult
Returns the evaluation result for a submission.- Specified by:
getResult
in interfaceSubmissionController<A>
- Parameters:
id
- The submission identifier.timeout
- The maximum time to wait for the result in seconds (default:10
, maximum:60
).delete
- Whether the submission should be deleted.- Returns:
- The result of the submission or an error response.
-
getSubmissions
public ResponseEntity<org.springframework.data.domain.Page<SubmissionDto<A>>> getSubmissions(org.springframework.data.domain.Pageable page, String userFilter, Long taskFilter, String assignmentFilter, SubmissionMode modeFilter) Returns a paged (filtered) list of submissions.- Specified by:
getSubmissions
in interfaceSubmissionController<A>
- Parameters:
page
- The page of submissions to load.userFilter
- Optional user filter string (applies equals toSubmissionDto.userId()
).taskFilter
- Optional task filter (applies equals toSubmissionDto.taskId()
).assignmentFilter
- Optional assignment filter string (applies equals toSubmissionDto.assignmentId()
).modeFilter
- Optional mode filter (applies equals toSubmissionDto.mode()
).- Returns:
- Page of submissions or an error response.
-
createDetailsUri
Creates the URI for the details of the submission with the given ID.- Parameters:
id
- The ID of the submission.- Returns:
- The URI where the details of the submission can be found.
-