Commit 1be6ce3e by Vik Paruchuri

Add in and route control options

parent cb54081d
...@@ -14,7 +14,8 @@ import textwrap ...@@ -14,7 +14,8 @@ import textwrap
log = logging.getLogger("mitx.courseware") log = logging.getLogger("mitx.courseware")
V1_SETTINGS_ATTRIBUTES = ["display_name", "max_attempts", "graded", "accept_file_upload", V1_SETTINGS_ATTRIBUTES = ["display_name", "max_attempts", "graded", "accept_file_upload",
"skip_spelling_checks", "due", "graceperiod", "weight"] "skip_spelling_checks", "due", "graceperiod", "weight", "min_to_calibrate",
"max_to_calibrate", "peer_grader_count", "required_peer_grading"]
V1_STUDENT_ATTRIBUTES = ["current_task_number", "task_states", "state", V1_STUDENT_ATTRIBUTES = ["current_task_number", "task_states", "state",
"student_attempts", "ready_to_reset"] "student_attempts", "ready_to_reset"]
...@@ -37,7 +38,7 @@ DEFAULT_DATA = textwrap.dedent("""\ ...@@ -37,7 +38,7 @@ DEFAULT_DATA = textwrap.dedent("""\
</p> </p>
<p> <p>
Write a persuasive essay to a newspaper reflecting your vies on censorship in libraries. Do you believe that certain materials, such as books, music, movies, magazines, etc., should be removed from the shelves if they are found offensive? Support your position with convincing arguments from your own experience, observations, and/or reading. Write a persuasive essay to a newspaper reflecting your views on censorship in libraries. Do you believe that certain materials, such as books, music, movies, magazines, etc., should be removed from the shelves if they are found offensive? Support your position with convincing arguments from your own experience, observations, and/or reading.
</p> </p>
</prompt> </prompt>
...@@ -244,6 +245,34 @@ class CombinedOpenEndedFields(object): ...@@ -244,6 +245,34 @@ class CombinedOpenEndedFields(object):
values={"min" : 0 , "step": ".1"}, values={"min" : 0 , "step": ".1"},
default=1 default=1
) )
min_to_calibrate = Integer(
display_name="Minimum Peer Grading Calibrations",
help="The minimum number of calibration essays each student will need to complete for peer grading.",
default=1,
scope=Scope.settings,
values={"min" : 1, "step" : "1"}
)
max_to_calibrate = Integer(
display_name="Maximum Peer Grading Calibrations",
help="The maximum number of calibration essays each student will need to complete for peer grading.",
default=1,
scope=Scope.settings,
values={"max" : 20, "step" : "1"}
)
peer_grader_count = Integer(
display_name="Peer Graders per Response",
help="The number of peers who will grade each submission.",
default=1,
scope=Scope.settings,
values={"min" : 1, "step" : "1", "max" : 5}
)
required_peer_grading = Integer(
display_name="Required Peer Grading",
help="The number of other students each student making a submission will have to grade.",
default=1,
scope=Scope.settings,
values={"min" : 1, "step" : "1", "max" : 5}
)
markdown = String( markdown = String(
help="Markdown source of this module", help="Markdown source of this module",
default=textwrap.dedent("""\ default=textwrap.dedent("""\
......
...@@ -106,6 +106,11 @@ class CombinedOpenEndedV1Module(): ...@@ -106,6 +106,11 @@ class CombinedOpenEndedV1Module():
self.accept_file_upload = instance_state.get('accept_file_upload', ACCEPT_FILE_UPLOAD) in TRUE_DICT self.accept_file_upload = instance_state.get('accept_file_upload', ACCEPT_FILE_UPLOAD) in TRUE_DICT
self.skip_basic_checks = instance_state.get('skip_spelling_checks', SKIP_BASIC_CHECKS) in TRUE_DICT self.skip_basic_checks = instance_state.get('skip_spelling_checks', SKIP_BASIC_CHECKS) in TRUE_DICT
self.required_peer_grading = instance_state.get('required_peer_grading', 3)
self.peer_grader_count = instance_state.get('peer_grader_count', 3)
self.min_to_calibrate = instance_state.get('min_to_calibrate', 3)
self.max_to_calibrate = instance_state.get('max_to_calibrate', 6)
due_date = instance_state.get('due', None) due_date = instance_state.get('due', None)
grace_period_string = instance_state.get('graceperiod', None) grace_period_string = instance_state.get('graceperiod', None)
...@@ -131,6 +136,12 @@ class CombinedOpenEndedV1Module(): ...@@ -131,6 +136,12 @@ class CombinedOpenEndedV1Module():
'close_date': self.timeinfo.close_date, 'close_date': self.timeinfo.close_date,
's3_interface': self.system.s3_interface, 's3_interface': self.system.s3_interface,
'skip_basic_checks': self.skip_basic_checks, 'skip_basic_checks': self.skip_basic_checks,
'control': {
'required_peer_grading': self.required_peer_grading,
'peer_grader_count': self.peer_grader_count,
'min_to_calibrate': self.min_to_calibrate,
'max_to_calibrate': self.max_to_calibrate,
}
} }
self.task_xml = definition['task_xml'] self.task_xml = definition['task_xml']
......
...@@ -118,6 +118,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): ...@@ -118,6 +118,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
'answer': self.answer, 'answer': self.answer,
'problem_id': self.display_name, 'problem_id': self.display_name,
'skip_basic_checks': self.skip_basic_checks, 'skip_basic_checks': self.skip_basic_checks,
'control': json.dumps(self.control),
}) })
updated_grader_payload = json.dumps(parsed_grader_payload) updated_grader_payload = json.dumps(parsed_grader_payload)
......
...@@ -92,6 +92,7 @@ class OpenEndedChild(object): ...@@ -92,6 +92,7 @@ class OpenEndedChild(object):
self.s3_interface = static_data['s3_interface'] self.s3_interface = static_data['s3_interface']
self.skip_basic_checks = static_data['skip_basic_checks'] self.skip_basic_checks = static_data['skip_basic_checks']
self._max_score = static_data['max_score'] self._max_score = static_data['max_score']
self.control = static_data['control']
# Used for progress / grading. Currently get credit just for # Used for progress / grading. Currently get credit just for
# completion (doesn't matter if you self-assessed correct/incorrect). # completion (doesn't matter if you self-assessed correct/incorrect).
......
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