Commit f438922a by Sarina Canelake

Fix error seen in combinedopenended modules

parent 7b6dcbba
...@@ -8,7 +8,7 @@ from .x_module import XModule ...@@ -8,7 +8,7 @@ from .x_module import XModule
from xblock.core import Integer, Scope, String, List, Float, Boolean from xblock.core import Integer, Scope, String, List, Float, Boolean
from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module, CombinedOpenEndedV1Descriptor from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module, CombinedOpenEndedV1Descriptor
from collections import namedtuple from collections import namedtuple
from .fields import Date from .fields import Date, Timedelta
import textwrap import textwrap
log = logging.getLogger("mitx.courseware") log = logging.getLogger("mitx.courseware")
...@@ -229,7 +229,7 @@ class CombinedOpenEndedFields(object): ...@@ -229,7 +229,7 @@ class CombinedOpenEndedFields(object):
default=None, default=None,
scope=Scope.settings scope=Scope.settings
) )
graceperiod = String( graceperiod = Timedelta(
help="Amount of time after the due date that submissions will be accepted", help="Amount of time after the due date that submissions will be accepted",
default=None, default=None,
scope=Scope.settings scope=Scope.settings
......
...@@ -82,6 +82,9 @@ TIMEDELTA_REGEX = re.compile(r'^((?P<days>\d+?) day(?:s?))?(\s)?((?P<hours>\d+?) ...@@ -82,6 +82,9 @@ TIMEDELTA_REGEX = re.compile(r'^((?P<days>\d+?) day(?:s?))?(\s)?((?P<hours>\d+?)
class Timedelta(ModelType): class Timedelta(ModelType):
# Timedeltas are immutable, see http://docs.python.org/2/library/datetime.html#available-types
MUTABLE = False
def from_json(self, time_str): def from_json(self, time_str):
""" """
time_str: A string with the following components: time_str: A string with the following components:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment