Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/_static/openapi/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ components:
- "full_auto"
- "unassisted"
default: "auto"
group:
type: "string"
example: "Chapter 1: Data Types"
example:
late_submission:
- period: "P1W1D"
Expand Down
32 changes: 29 additions & 3 deletions grader_service/api/models/assignment_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AssignmentSettings(Model):
Do not edit the class manually.
"""

def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_submission=None, autograde_type='auto'): # noqa: E501
def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_submission=None, autograde_type='auto', group=None): # noqa: E501
"""AssignmentSettings - a model defined in OpenAPI

:param deadline: The deadline of this AssignmentSettings. # noqa: E501
Expand All @@ -27,28 +27,33 @@ def __init__(self, deadline=None, max_submissions=None, allowed_files=[], late_s
:type late_submission: List[SubmissionPeriod]
:param autograde_type: The autograde_type of this AssignmentSettings. # noqa: E501
:type autograde_type: str
:param group: The group of this AssignmentSettings. # noqa: E501
:type group: str
"""
self.openapi_types = {
'deadline': datetime,
'max_submissions': int,
'allowed_files': List[str],
'late_submission': List[SubmissionPeriod],
'autograde_type': str
'autograde_type': str,
'group': str
}

self.attribute_map = {
'deadline': 'deadline',
'max_submissions': 'max_submissions',
'allowed_files': 'allowed_files',
'late_submission': 'late_submission',
'autograde_type': 'autograde_type'
'autograde_type': 'autograde_type',
'group': 'group'
}

self._deadline = deadline
self._max_submissions = max_submissions
self._allowed_files = allowed_files
self._late_submission = late_submission
self._autograde_type = autograde_type
self._group = group

@classmethod
def from_dict(cls, dikt) -> 'AssignmentSettings':
Expand Down Expand Up @@ -171,3 +176,24 @@ def autograde_type(self, autograde_type: str):
)

self._autograde_type = autograde_type

@property
def group(self) -> str:
"""Gets the group of this AssignmentSettings.


:return: The group of this AssignmentSettings.
:rtype: str
"""
return self._group

@group.setter
def group(self, group: str):
"""Sets the group of this AssignmentSettings.


:param group: The group of this AssignmentSettings.
:type group: str
"""

self._group = group
3 changes: 0 additions & 3 deletions grader_service/api/models/base_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from datetime import datetime
import pprint

import typing
Expand Down Expand Up @@ -44,8 +43,6 @@ def to_dict(self):
if hasattr(item[1], "to_dict") else item,
value.items()
))
elif isinstance(value, datetime): # Convert datetime to ISO format
result[attr] = value.isoformat()
else:
result[attr] = value

Expand Down
Loading