Skip to content
Snippets Groups Projects
Verified Commit dbb15451 authored by Hamza Remmal's avatar Hamza Remmal :homes: Committed by Hamza Remmal
Browse files

chore: add placeholder for the submission feedback requests

parent fcbc96ed
No related branches found
No related tags found
1 merge request!302Draft: Add the possibility to get the grade and feedback in the api
...@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -129,6 +130,10 @@ public final class SubmissionController { ...@@ -129,6 +130,10 @@ public final class SubmissionController {
return new InputStreamResource(files); return new InputStreamResource(files);
} }
// ============================================================================================
// ================================ FEEDBACK RELATED ENDPOINTS ================================
// ============================================================================================
/** /**
* REST Endpoint to upload the feedback of a submission * REST Endpoint to upload the feedback of a submission
* *
...@@ -163,4 +168,66 @@ public final class SubmissionController { ...@@ -163,4 +168,66 @@ public final class SubmissionController {
} }
} }
/**
* REST Endpoint to get the feedback information of a given submission
*
* @param id The unique id of the requested submission
* @since 1.3.0
* @return
* <ul>
* <li>{@link HttpStatus.OK} if the request is successful and the feedback is available</li>
* <li>{@link HttpStatus.NO_CONTENT} if the request is successful but no feedback is available yet</li>
* <li>{@link HttpStatus.UNAUTHORIZED} if the user is not authenticated</li>
* <li>{@link HttpStatus.FORBIDDEN} if the user is authenticated but not allowed to perform this action</li>
* <li>{@link HttpStatus.NOT_FOUND} if the submission is missing</li>
* <li>{@link HttpStatus.INTERNAL_SERVER_ERROR} in case of a server failure</li>
* </ul>
*/
@GetMapping(value = "/{id}/feedback", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getFeedback(final @PathVariable int id) {
// TODO: Request the feedback from Moodle
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}
/**
* REST Endpoint to get the feedback files of a given submission
*
* @param id The unique id of the requested submission
* @since 1.3.0
* @return
* <ul>
* <li>{@link HttpStatus.OK} if the request is successful and the zip file was produced</li>
* <li>{@link HttpStatus.NO_CONTENT} if the request is successful but no feedback files were found</li>
* <li>{@link HttpStatus.UNAUTHORIZED} if the user is not authenticated</li>
* <li>{@link HttpStatus.FORBIDDEN} if the user is authenticated but not allowed to perform this action</li>
* <li>{@link HttpStatus.NOT_FOUND} if the submission is missing</li>
* <li>{@link HttpStatus.INTERNAL_SERVER_ERROR} in case of a server failure</li>
* </ul>
*/
@GetMapping(value = "/{id}/feedback/files", consumes = MediaType.ALL_VALUE, produces = "application/zip")
public ResponseEntity<?> getFeedbackFiles(final @PathVariable int id) {
// TODO: Request the feedback files from Moodle
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}
/**
* REST Endpoint to request the grade of a given submission
*
* @param id The unique id of the requested submission
* @since 1.3.0
* @return
* <ul>
* <li>{@link HttpStatus.OK} if the request is successful</li>
* <li>{@link HttpStatus.UNAUTHORIZED} if the user is not authenticated</li>
* <li>{@link HttpStatus.FORBIDDEN} if the user is authenticated but not allowed to perform this action</li>
* <li>{@link HttpStatus.NOT_FOUND} if the submission is missing</li>
* <li>{@link HttpStatus.INTERNAL_SERVER_ERROR} in case of a server failure</li>
* </ul>
*/
@GetMapping(value = "/{id}/feedback/grade", consumes = MediaType.ALL_VALUE, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<?> getGrade(final @PathVariable int id) {
// TODO: Request the grade from Moodle
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment