Skip to content

Commit b8ff295

Browse files
WIP: added groups attribute to AssignmentSettings
1 parent d845077 commit b8ff295

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from datetime import datetime
21
import pprint
32

43
import typing
@@ -44,8 +43,6 @@ def to_dict(self):
4443
if hasattr(item[1], "to_dict") else item,
4544
value.items()
4645
))
47-
elif isinstance(value, datetime): # Convert datetime to ISO format
48-
result[attr] = value.isoformat()
4946
else:
5047
result[attr] = value
5148

0 commit comments

Comments
 (0)