Skip to content

Commit 0436fed

Browse files
WIP: added groups attribute to AssignmentSettings (#316)
* WIP: added groups attribute to AssignmentSettings * fix: add deleted lines back * fix: add missing attribute (group) in test_base_handler.py
1 parent 80371c7 commit 0436fed

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

docs/source/_static/openapi/schemas.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ components:
8989
- "full_auto"
9090
- "unassisted"
9191
default: "auto"
92+
group:
93+
type: "string"
94+
example: "Chapter 1: Data Types"
9295
example:
9396
late_submission:
9497
- period: "P1W1D"

grader_service/api/models/assignment_settings.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AssignmentSettings(Model):
1414
Do not edit the class manually.
1515
"""
1616

17-
def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_submission=None, autograde_type='auto'): # noqa: E501
17+
def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_submission=None, autograde_type='auto', group=None): # noqa: E501
1818
"""AssignmentSettings - a model defined in OpenAPI
1919
2020
:param deadline: The deadline of this AssignmentSettings. # noqa: E501
@@ -27,28 +27,33 @@ def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_s
2727
:type late_submission: List[SubmissionPeriod]
2828
:param autograde_type: The autograde_type of this AssignmentSettings. # noqa: E501
2929
:type autograde_type: str
30+
:param group: The group of this AssignmentSettings. # noqa: E501
31+
:type group: str
3032
"""
3133
self.openapi_types = {
3234
'deadline': datetime,
3335
'max_submissions': int,
3436
'allowed_files': List[str],
3537
'late_submission': List[SubmissionPeriod],
36-
'autograde_type': str
38+
'autograde_type': str,
39+
'group': str
3740
}
3841

3942
self.attribute_map = {
4043
'deadline': 'deadline',
4144
'max_submissions': 'max_submissions',
4245
'allowed_files': 'allowed_files',
4346
'late_submission': 'late_submission',
44-
'autograde_type': 'autograde_type'
47+
'autograde_type': 'autograde_type',
48+
'group': 'group'
4549
}
4650

4751
self._deadline = deadline
4852
self._max_submissions = max_submissions
4953
self._allowed_files = allowed_files
5054
self._late_submission = late_submission
5155
self._autograde_type = autograde_type
56+
self._group = group
5257

5358
@classmethod
5459
def from_dict(cls, dikt) -> 'AssignmentSettings':
@@ -171,3 +176,24 @@ def autograde_type(self, autograde_type: str):
171176
)
172177

173178
self._autograde_type = autograde_type
179+
180+
@property
181+
def group(self) -> str:
182+
"""Gets the group of this AssignmentSettings.
183+
184+
185+
:return: The group of this AssignmentSettings.
186+
:rtype: str
187+
"""
188+
return self._group
189+
190+
@group.setter
191+
def group(self, group: str):
192+
"""Sets the group of this AssignmentSettings.
193+
194+
195+
:param group: The group of this AssignmentSettings.
196+
:type group: str
197+
"""
198+
199+
self._group = group

grader_service/api/models/base_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from datetime import datetime
21
import pprint
3-
2+
from datetime import datetime
43
import typing
54

65
from grader_service.api import util

grader_service/tests/handlers/test_base_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def test_assignment_serialization():
6363
"settings": {
6464
"late_submission": None,
6565
"deadline": datetime.now(tz=timezone.utc).isoformat(),
66+
"group": None,
6667
"max_submissions": 1,
6768
"autograde_type": "unassisted",
6869
"allowed_files": None,

0 commit comments

Comments
 (0)