Update combined open ended and peer grading per conversation with Vik.
This commit is contained in:
@@ -5,10 +5,10 @@ from pkg_resources import resource_string
|
||||
|
||||
from xmodule.raw_module import RawDescriptor
|
||||
from .x_module import XModule
|
||||
from xblock.core import Integer, Scope, String, Boolean, List
|
||||
from xblock.core import Scope, String, Integer, Boolean, List
|
||||
from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module, CombinedOpenEndedV1Descriptor
|
||||
from collections import namedtuple
|
||||
from .fields import Date, StringyFloat
|
||||
from .fields import Date, StringyFloat, StringyInteger
|
||||
|
||||
log = logging.getLogger("mitx.courseware")
|
||||
|
||||
@@ -56,18 +56,18 @@ class CombinedOpenEndedFields(object):
|
||||
scope=Scope.user_state)
|
||||
ready_to_reset = Boolean(help="If the problem is ready to be reset or not.", default=False,
|
||||
scope=Scope.user_state)
|
||||
attempts = Integer(display_name="Maximum Attempts",
|
||||
help="Specifies the number of times the student can try to answer this problem.", default=1,
|
||||
attempts = StringyInteger(display_name="Maximum Attempts",
|
||||
help="The number of times the student can try to answer this problem.", default=1,
|
||||
scope=Scope.settings)
|
||||
# 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}])
|
||||
accept_file_upload = Boolean(display_name="Accept File Upload",
|
||||
help="If disabled, students cannot upload images to be graded with this problem.", 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}])
|
||||
skip_spelling_checks = Boolean(display_name="Basic 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.
|
||||
help="If enabled, 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}])
|
||||
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,
|
||||
@@ -75,8 +75,8 @@ class CombinedOpenEndedFields(object):
|
||||
version = VersionInteger(help="Current version number", default=DEFAULT_VERSION, scope=Scope.settings)
|
||||
data = String(help="XML data for the problem", scope=Scope.content)
|
||||
weight = StringyFloat(display_name="Problem Weight",
|
||||
help="Specifies the number of points the problem is worth. By default, each response field in the problem is worth one point.",
|
||||
scope=Scope.settings)
|
||||
help="The number of points the problem is worth. By default, each problem is worth one point.",
|
||||
scope=Scope.settings, values = {"min" : 0 , "step": ".1"})
|
||||
|
||||
|
||||
class CombinedOpenEndedModule(CombinedOpenEndedFields, XModule):
|
||||
|
||||
@@ -22,28 +22,33 @@ USE_FOR_SINGLE_LOCATION = False
|
||||
LINK_TO_LOCATION = ""
|
||||
TRUE_DICT = [True, "True", "true", "TRUE"]
|
||||
MAX_SCORE = 1
|
||||
IS_GRADED = True
|
||||
IS_GRADED = False
|
||||
|
||||
EXTERNAL_GRADER_NO_CONTACT_ERROR = "Failed to contact external graders. Please notify course staff."
|
||||
|
||||
|
||||
class PeerGradingFields(object):
|
||||
use_for_single_location = StringyBoolean(help="Whether to use this for a single location or as a panel.",
|
||||
default=USE_FOR_SINGLE_LOCATION, scope=Scope.settings)
|
||||
link_to_location = String(help="The location this problem is linked to.", default=LINK_TO_LOCATION,
|
||||
scope=Scope.settings)
|
||||
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 or not this module is scored.", default=IS_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,
|
||||
values=[{'display_name': "True", "value": True}, {'display_name': "False", "value": False}], 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 receieve for this problem.", default=MAX_SCORE,
|
||||
scope=Scope.settings)
|
||||
max_grade = StringyInteger(help="The maximum grade that a student can receive for this problem.", default=MAX_SCORE,
|
||||
scope=Scope.settings, values={"min" : 0 })
|
||||
student_data_for_location = Object(help="Student data for a given peer grading problem.",
|
||||
scope=Scope.user_state)
|
||||
weight = StringyFloat(display_name="Problem Weight",
|
||||
help="Specifies the number of points the problem is worth. By default, each response field in the problem is worth one point.",
|
||||
scope=Scope.settings)
|
||||
help="Specifies the number of points the problem is worth. By default, each problem is worth one point.",
|
||||
scope=Scope.settings, values = {"min" : 0 , "step": ".1"})
|
||||
|
||||
|
||||
class PeerGradingModule(PeerGradingFields, XModule):
|
||||
@@ -596,7 +601,6 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
|
||||
def non_editable_metadata_fields(self):
|
||||
non_editable_fields = super(PeerGradingDescriptor, self).non_editable_metadata_fields
|
||||
non_editable_fields.extend([PeerGradingFields.due_date, PeerGradingFields.grace_period_string,
|
||||
PeerGradingFields.link_to_location, PeerGradingFields.max_grade,
|
||||
PeerGradingFields.use_for_single_location])
|
||||
PeerGradingFields.max_grade])
|
||||
return non_editable_fields
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
metadata:
|
||||
display_name: Peer Grading Interface
|
||||
use_for_single_location: False
|
||||
link_to_location: None
|
||||
is_graded: False
|
||||
max_grade: 1
|
||||
data: |
|
||||
<peergrading>
|
||||
|
||||
Reference in New Issue
Block a user