Commit e4bcfa5c by Vik Paruchuri

Fix indents and copy behavior

parent 687ab3dd
...@@ -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")
...@@ -226,12 +226,10 @@ class CombinedOpenEndedFields(object): ...@@ -226,12 +226,10 @@ class CombinedOpenEndedFields(object):
) )
due = Date( due = Date(
help="Date that this problem is due by", help="Date that this problem is due by",
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,
scope=Scope.settings scope=Scope.settings
) )
version = VersionInteger(help="Current version number", default=DEFAULT_VERSION, scope=Scope.settings) version = VersionInteger(help="Current version number", default=DEFAULT_VERSION, scope=Scope.settings)
......
...@@ -46,7 +46,6 @@ class PeerGradingFields(object): ...@@ -46,7 +46,6 @@ class PeerGradingFields(object):
) )
due = Date( due = Date(
help="Due date that should be displayed.", help="Due date that should be displayed.",
default=None,
scope=Scope.settings) scope=Scope.settings)
graceperiod = Timedelta( graceperiod = Timedelta(
help="Amount of grace to give on the due date.", help="Amount of grace to give on the due date.",
...@@ -525,10 +524,10 @@ class PeerGradingModule(PeerGradingFields, XModule): ...@@ -525,10 +524,10 @@ class PeerGradingModule(PeerGradingFields, XModule):
good_problem_list = [] good_problem_list = []
for problem in problem_list: for problem in problem_list:
problem_location = problem['location'] problem_location = problem['location']
try: try:
descriptor = _find_corresponding_module_for_location(problem_location) descriptor = _find_corresponding_module_for_location(problem_location)
except: except:
continue continue
if descriptor: if descriptor:
problem['due'] = descriptor.lms.due problem['due'] = descriptor.lms.due
grace_period = descriptor.lms.graceperiod grace_period = descriptor.lms.graceperiod
......
...@@ -353,7 +353,8 @@ class LmsKeyValueStore(KeyValueStore): ...@@ -353,7 +353,8 @@ class LmsKeyValueStore(KeyValueStore):
for field in kv_dict: for field in kv_dict:
# Check field for validity # Check field for validity
if field.field_name in self._descriptor_model_data: if field.field_name in self._descriptor_model_data:
raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name) if field.field_name not in ["due","graceperiod"]:
raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name)
if field.scope not in self._allowed_scopes: if field.scope not in self._allowed_scopes:
raise InvalidScopeError(field.scope) raise InvalidScopeError(field.scope)
......
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