Update xblock, start Selenium.
This commit is contained in:
@@ -59,16 +59,13 @@ class CombinedOpenEndedFields(object):
|
||||
attempts = StringyInteger(display_name="Maximum Attempts",
|
||||
help="The number of times the student can try to answer this problem.", default=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,
|
||||
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
|
||||
is_graded = Boolean(display_name="Graded", help="Whether or not the problem is graded.", default=False, scope=Scope.settings)
|
||||
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,
|
||||
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
|
||||
help="Whether or not the student can submit files as a response.", default=False, scope=Scope.settings)
|
||||
skip_spelling_checks = Boolean(display_name="Disable Quality Filter",
|
||||
# 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.",
|
||||
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)
|
||||
graceperiod = String(help="Amount of time after the due date that submissions will be accepted", default=None,
|
||||
scope=Scope.settings)
|
||||
|
||||
@@ -31,15 +31,14 @@ class PeerGradingFields(object):
|
||||
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. '
|
||||
'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)
|
||||
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.',
|
||||
default=LINK_TO_LOCATION, scope=Scope.settings)
|
||||
# TODO: move boolean default into xfields
|
||||
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,
|
||||
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}], scope=Scope.settings)
|
||||
help='Whether the student gets credit for grading this problem. Only used when "Show Single Problem" is True.',
|
||||
default=IS_GRADED, 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)
|
||||
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):
|
||||
# Used for testing float type
|
||||
float_non_select = StringyFloat(scope=Scope.settings, default=.999, values={'min': 0 , 'step' : .3})
|
||||
# Used for testing that Booleans get mapped to select type
|
||||
# TODO: move default value into xblock!
|
||||
boolean_select = Boolean(scope=Scope.settings, values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}])
|
||||
boolean_select = Boolean(scope=Scope.settings)
|
||||
|
||||
|
||||
class EditableMetadataFieldsTest(unittest.TestCase):
|
||||
|
||||
@@ -649,6 +649,8 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
|
||||
# 3. A generic string editor for anything else (editing JSON representation of the value).
|
||||
type = "Generic"
|
||||
values = [] if field.values is None else copy.deepcopy(field.values)
|
||||
if isinstance(values, tuple):
|
||||
values = list(values)
|
||||
if isinstance(values, list):
|
||||
if len(values) > 0:
|
||||
type = "Select"
|
||||
|
||||
Reference in New Issue
Block a user