Controller methods for Assignments
Endpoint (Method)
Params | Type | Comment |
---|---|---|
Input | ||
moduleId | Long | |
Output | ||
assignments | List |
What does this method do?
- Gets all the assignments per specified module.
- Returns a list of AssignmentViewDTO with name and deadline.
Endpoint (Method)
Params | Type | Comment |
---|---|---|
Input | ||
moduleId | Long | |
assignmentId | Long | |
Output | ||
assignment | AssignmentViewDTO |
What does this method do?
- Gets the details of specified assignment in specified module. Those details include:
- module
- name
- deadline
- list of submissions
- status (meaning script status (String) and grade (Double) for latest submission)
Endpoint (Method)
Params | Type | Comment |
---|---|---|
Input | ||
moduleId | Long | |
name | String | |
deadline | LocalDateTime | |
description | Description | |
Output | ||
assignmentId | Long |
What does this method do?
- Creates a new assignment and stores it in DB.
- Returns the id of the new assignment.
Endpoint (Method)
I mean, then I need 3 methods for setting the values of name, description, or deadline, where I think I would let you know the assignmentId and the new value. But I'm not really sure what should be returned, whether the whole assignmentViewDTO or something else.
Is it useful to also send the moduleId?
So if it makes sense, and sorry for not writing it into the table:
- Method setDeadline(Long assignmentId, LocalDateTime newDeadline) that returns assignmentViewDTO
- Method setDescription(Long assignmentID, Description description) that returns assignmentViewDTO
- Method setName(Long assignmentID, String name) that returns AssignmentViewDTO
DTO
Name: AssignmentCreateDTO
This DTO is a:
-
Create -
Patch -
View
It has the following fields:
Type | Name | Comment |
---|---|---|
String | name | |
Module | module | |
LocalDateTime | deadline | See below. |
Description | description |
I think the description has to be a new entity. It should hold a String with textual description and a list of files. See my MR, I have a placeholder description there, even though it's just as simple as I described here.
DTO
Name: AssignmentPatchDTO
This DTO is a:
-
Create -
Patch -
View
It has the following fields:
Type | Name | Comment |
---|---|---|
String | name | |
Module | module | |
LocalDateTime | deadline | |
Description | description |
DTO
Name: AssignmentViewDTO
This DTO is a:
-
Create -
Patch -
View
It has the following fields:
Type | Name | Comment |
---|---|---|
String | name | |
Module | module | |
LocalDateTime | deadline | |
Description | description | |
List | submissions | |
Pair<String, Double> | latestSubmissionStatus | See below. |
latestSubmissionStatus is supposed to be the script status and grade of latest submission. The thing is, this requires a change in the submission entity as well, because there is no String for script status, only the grade. Should I be doing submission entities at the same time?