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 in SubmitSubmissionDto.
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 Details

    • submissionService

      protected final SubmissionService<A> submissionService
      The submission service.
  • Constructor Details

  • Method Details

    • submit

      public ResponseEntity<Serializable> submit(SubmitSubmissionDto<A> submission, boolean runInBackground, boolean persist)
      Executes and grades a submission.
      Specified by:
      submit in interface SubmissionController<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 if runInBackground is false.
      Returns:
      The submission identifier if runInBackground is true; the grading result if runInBackground is false; or an error response.
    • getResult

      public ResponseEntity<GradingDto> getResult(UUID id, int timeout, boolean delete)
      Returns the evaluation result for a submission.
      Specified by:
      getResult in interface SubmissionController<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 interface SubmissionController<A>
      Parameters:
      page - The page of submissions to load.
      userFilter - Optional user filter string (applies equals to SubmissionDto.userId()).
      taskFilter - Optional task filter (applies equals to SubmissionDto.taskId()).
      assignmentFilter - Optional assignment filter string (applies equals to SubmissionDto.assignmentId()).
      modeFilter - Optional mode filter (applies equals to SubmissionDto.mode()).
      Returns:
      Page of submissions or an error response.
    • createDetailsUri

      protected abstract URI createDetailsUri(UUID id)
      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.