Commit 3dc97913 by cahrens

Update xblock, start Selenium.

parent bb699f48
...@@ -59,16 +59,13 @@ class CombinedOpenEndedFields(object): ...@@ -59,16 +59,13 @@ class CombinedOpenEndedFields(object):
attempts = StringyInteger(display_name="Maximum Attempts", attempts = StringyInteger(display_name="Maximum Attempts",
help="The number of times the student can try to answer this problem.", default=1, help="The number of times the student can try to answer this problem.", default=1,
scope=Scope.settings, values = {"min" : 1 }) scope=Scope.settings, values = {"min" : 1 })
# TODO: move values to Boolean in xblock. is_graded = Boolean(display_name="Graded", help="Whether or not the problem is graded.", default=False, scope=Scope.settings)
is_graded = Boolean(display_name="Graded", help="Whether or not the problem is graded.", default=False, scope=Scope.settings,
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
accept_file_upload = Boolean(display_name="Allow File Uploads", accept_file_upload = Boolean(display_name="Allow File Uploads",
help="Whether or not the student can submit files as a response.", default=False, scope=Scope.settings, help="Whether or not the student can submit files as a response.", default=False, scope=Scope.settings)
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
skip_spelling_checks = Boolean(display_name="Disable Quality Filter", skip_spelling_checks = Boolean(display_name="Disable Quality Filter",
# TODO: passing of text failed with "won't". Need to make our code more robust. # TODO: passing of text failed with "won't". Need to make our code more robust.
help="If False, submissions with poor spelling, short length, or poor grammar will not be peer reviewed.", help="If False, submissions with poor spelling, short length, or poor grammar will not be peer reviewed.",
default=False, scope=Scope.settings, values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}]) default=False, scope=Scope.settings)
due = Date(help="Date that this problem is due by", default=None, scope=Scope.settings) due = Date(help="Date that this problem is due by", default=None, scope=Scope.settings)
graceperiod = String(help="Amount of time after the due date that submissions will be accepted", default=None, graceperiod = String(help="Amount of time after the due date that submissions will be accepted", default=None,
scope=Scope.settings) scope=Scope.settings)
......
...@@ -31,15 +31,14 @@ class PeerGradingFields(object): ...@@ -31,15 +31,14 @@ class PeerGradingFields(object):
use_for_single_location = StringyBoolean(display_name="Show Single Problem", use_for_single_location = StringyBoolean(display_name="Show Single Problem",
help='When True, only the single problem specified by "Link to Problem Location" is shown. ' help='When True, only the single problem specified by "Link to Problem Location" is shown. '
'When False, a panel is displayed with all problems available for peer grading.', 'When False, a panel is displayed with all problems available for peer grading.',
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}],
default=USE_FOR_SINGLE_LOCATION, scope=Scope.settings) default=USE_FOR_SINGLE_LOCATION, scope=Scope.settings)
link_to_location = String(display_name="Link to Problem Location", link_to_location = String(display_name="Link to Problem Location",
help='The location of the problem being graded. Only used when "Show Single Problem" is True.', help='The location of the problem being graded. Only used when "Show Single Problem" is True.',
default=LINK_TO_LOCATION, scope=Scope.settings) default=LINK_TO_LOCATION, scope=Scope.settings)
# TODO: move boolean default into xfields # TODO: move boolean default into xfields
is_graded = StringyBoolean(display_name="Graded", is_graded = StringyBoolean(display_name="Graded",
help='Whether the student gets credit for grading this problem. Only used when "Show Single Problem" is True.', default=IS_GRADED, help='Whether the student gets credit for grading this problem. Only used when "Show Single Problem" is True.',
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}], scope=Scope.settings) default=IS_GRADED, scope=Scope.settings)
due_date = Date(help="Due date that should be displayed.", default=None, scope=Scope.settings) due_date = Date(help="Due date that should be displayed.", default=None, scope=Scope.settings)
grace_period_string = String(help="Amount of grace to give on the due date.", default=None, scope=Scope.settings) grace_period_string = String(help="Amount of grace to give on the due date.", default=None, scope=Scope.settings)
max_grade = StringyInteger(help="The maximum grade that a student can receive for this problem.", default=MAX_SCORE, max_grade = StringyInteger(help="The maximum grade that a student can receive for this problem.", default=MAX_SCORE,
......
...@@ -32,8 +32,7 @@ class TestFields(object): ...@@ -32,8 +32,7 @@ class TestFields(object):
# Used for testing float type # Used for testing float type
float_non_select = StringyFloat(scope=Scope.settings, default=.999, values={'min': 0 , 'step' : .3}) float_non_select = StringyFloat(scope=Scope.settings, default=.999, values={'min': 0 , 'step' : .3})
# Used for testing that Booleans get mapped to select type # Used for testing that Booleans get mapped to select type
# TODO: move default value into xblock! boolean_select = Boolean(scope=Scope.settings)
boolean_select = Boolean(scope=Scope.settings, values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
class EditableMetadataFieldsTest(unittest.TestCase): class EditableMetadataFieldsTest(unittest.TestCase):
......
...@@ -649,6 +649,8 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -649,6 +649,8 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
# 3. A generic string editor for anything else (editing JSON representation of the value). # 3. A generic string editor for anything else (editing JSON representation of the value).
type = "Generic" type = "Generic"
values = [] if field.values is None else copy.deepcopy(field.values) values = [] if field.values is None else copy.deepcopy(field.values)
if isinstance(values, tuple):
values = list(values)
if isinstance(values, list): if isinstance(values, list):
if len(values) > 0: if len(values) > 0:
type = "Select" type = "Select"
......
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