Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-autograde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CS-107
moodle-autograde
Commits
dbb15451
Verified
Commit
dbb15451
authored
5 months ago
by
Hamza Remmal
Committed by
Hamza Remmal
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: add placeholder for the submission feedback requests
parent
fcbc96ed
No related branches found
No related tags found
1 merge request
!302
Draft: Add the possibility to get the grade and feedback in the api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autograde-service/src/main/java/ch/epfl/autograde/controller/api/v1/SubmissionController.java
+67
-0
67 additions, 0 deletions
...pfl/autograde/controller/api/v1/SubmissionController.java
with
67 additions
and
0 deletions
autograde-service/src/main/java/ch/epfl/autograde/controller/api/v1/SubmissionController.java
+
67
−
0
View file @
dbb15451
...
@@ -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
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment