Commit aba9b3b9 by stv

Fix PEP8: E124 closing bracket does not match

visual indentation
parent 5a69fead
...@@ -24,7 +24,8 @@ def i_export_the_course(step): ...@@ -24,7 +24,8 @@ def i_export_the_course(step):
@step('I edit and enter bad XML$') @step('I edit and enter bad XML$')
def i_enter_bad_xml(step): def i_enter_bad_xml(step):
enter_xml_in_advanced_problem(step, enter_xml_in_advanced_problem(
step,
"""<problem><h1>Smallest Canvas</h1> """<problem><h1>Smallest Canvas</h1>
<p>You want to make the smallest canvas you can.</p> <p>You want to make the smallest canvas you can.</p>
<multiplechoiceresponse> <multiplechoiceresponse>
......
...@@ -14,23 +14,24 @@ class CourseMetadata(object): ...@@ -14,23 +14,24 @@ class CourseMetadata(object):
# The list of fields that wouldn't be shown in Advanced Settings. # The list of fields that wouldn't be shown in Advanced Settings.
# Should not be used directly. Instead the filtered_list method should be used if the field needs to be filtered # Should not be used directly. Instead the filtered_list method should be used if the field needs to be filtered
# depending on the feature flag. # depending on the feature flag.
FILTERED_LIST = ['xml_attributes', FILTERED_LIST = [
'start', 'xml_attributes',
'end', 'start',
'enrollment_start', 'end',
'enrollment_end', 'enrollment_start',
'tabs', 'enrollment_end',
'graceperiod', 'tabs',
'checklists', 'graceperiod',
'show_timezone', 'checklists',
'format', 'show_timezone',
'graded', 'format',
'hide_from_toc', 'graded',
'pdf_textbooks', 'hide_from_toc',
'user_partitions', 'pdf_textbooks',
'name', # from xblock 'user_partitions',
'tags', # from xblock 'name', # from xblock
'visible_to_staff_only' 'tags', # from xblock
'visible_to_staff_only',
] ]
@classmethod @classmethod
......
...@@ -2120,8 +2120,10 @@ class CodeResponse(LoncapaResponse): ...@@ -2120,8 +2120,10 @@ class CodeResponse(LoncapaResponse):
parsed = False parsed = False
if not parsed: if not parsed:
log.error("Unable to parse external grader message as valid" log.error(
" XML: score_msg['msg']=%s", msg "Unable to parse external grader message as valid"
" XML: score_msg['msg']=%s",
msg,
) )
return fail return fail
......
...@@ -328,121 +328,174 @@ class CourseFields(object): ...@@ -328,121 +328,174 @@ class CourseFields(object):
scope=Scope.settings scope=Scope.settings
) )
has_children = True has_children = True
checklists = List(scope=Scope.settings, checklists = List(
default=[ scope=Scope.settings,
{"short_description": _("Getting Started With Studio"), default=[
"items": [{"short_description": _("Add Course Team Members"), {
"long_description": _("Grant your collaborators permission to edit your course so you can work together."), "short_description": _("Getting Started With Studio"),
"is_checked": False, "items": [
"action_url": "ManageUsers", {
"action_text": _("Edit Course Team"), "short_description": _("Add Course Team Members"),
"action_external": False}, "long_description": _("Grant your collaborators permission to edit your course so you can work together."),
{"short_description": _("Set Important Dates for Your Course"), "is_checked": False,
"long_description": _("Establish your course's student enrollment and launch dates on the Schedule and Details page."), "action_url": "ManageUsers",
"is_checked": False, "action_text": _("Edit Course Team"),
"action_url": "SettingsDetails", "action_external": False,
"action_text": _("Edit Course Details &amp; Schedule"), },
"action_external": False}, {
{"short_description": _("Draft Your Course's Grading Policy"), "short_description": _("Set Important Dates for Your Course"),
"long_description": _("Set up your assignment types and grading policy even if you haven't created all your assignments."), "long_description": _("Establish your course's student enrollment and launch dates on the Schedule and Details page."),
"is_checked": False, "is_checked": False,
"action_url": "SettingsGrading", "action_url": "SettingsDetails",
"action_text": _("Edit Grading Settings"), "action_text": _("Edit Course Details &amp; Schedule"),
"action_external": False}, "action_external": False,
{"short_description": _("Explore the Other Studio Checklists"), },
"long_description": _("Discover other available course authoring tools, and find help when you need it."), {
"is_checked": False, "short_description": _("Draft Your Course's Grading Policy"),
"action_url": "", "long_description": _("Set up your assignment types and grading policy even if you haven't created all your assignments."),
"action_text": "", "is_checked": False,
"action_external": False}]}, "action_url": "SettingsGrading",
{"short_description": _("Draft a Rough Course Outline"), "action_text": _("Edit Grading Settings"),
"items": [{"short_description": _("Create Your First Section and Subsection"), "action_external": False,
"long_description": _("Use your course outline to build your first Section and Subsection."), },
"is_checked": False, {
"action_url": "CourseOutline", "short_description": _("Explore the Other Studio Checklists"),
"action_text": _("Edit Course Outline"), "long_description": _("Discover other available course authoring tools, and find help when you need it."),
"action_external": False}, "is_checked": False,
{"short_description": _("Set Section Release Dates"), "action_url": "",
"long_description": _("Specify the release dates for each Section in your course. Sections become visible to students on their release dates."), "action_text": "",
"is_checked": False, "action_external": False,
"action_url": "CourseOutline", },
"action_text": _("Edit Course Outline"), ],
"action_external": False}, },
{"short_description": _("Designate a Subsection as Graded"), {
"long_description": _("Set a Subsection to be graded as a specific assignment type. Assignments within graded Subsections count toward a student's final grade."), "short_description": _("Draft a Rough Course Outline"),
"is_checked": False, "items": [
"action_url": "CourseOutline", {
"action_text": _("Edit Course Outline"), "short_description": _("Create Your First Section and Subsection"),
"action_external": False}, "long_description": _("Use your course outline to build your first Section and Subsection."),
{"short_description": _("Reordering Course Content"), "is_checked": False,
"long_description": _("Use drag and drop to reorder the content in your course."), "action_url": "CourseOutline",
"is_checked": False, "action_text": _("Edit Course Outline"),
"action_url": "CourseOutline", "action_external": False,
"action_text": _("Edit Course Outline"), },
"action_external": False}, {
{"short_description": _("Renaming Sections"), "short_description": _("Set Section Release Dates"),
"long_description": _("Rename Sections by clicking the Section name from the Course Outline."), "long_description": _("Specify the release dates for each Section in your course. Sections become visible to students on their release dates."),
"is_checked": False, "is_checked": False,
"action_url": "CourseOutline", "action_url": "CourseOutline",
"action_text": _("Edit Course Outline"), "action_text": _("Edit Course Outline"),
"action_external": False}, "action_external": False,
{"short_description": _("Deleting Course Content"), },
"long_description": _("Delete Sections, Subsections, or Units you don't need anymore. Be careful, as there is no Undo function."), {
"is_checked": False, "short_description": _("Designate a Subsection as Graded"),
"action_url": "CourseOutline", "long_description": _("Set a Subsection to be graded as a specific assignment type. Assignments within graded Subsections count toward a student's final grade."),
"action_text": _("Edit Course Outline"), "is_checked": False,
"action_external": False}, "action_url": "CourseOutline",
{"short_description": _("Add an Instructor-Only Section to Your Outline"), "action_text": _("Edit Course Outline"),
"long_description": _("Some course authors find using a section for unsorted, in-progress work useful. To do this, create a section and set the release date to the distant future."), "action_external": False,
"is_checked": False, },
"action_url": "CourseOutline", {
"action_text": _("Edit Course Outline"), "short_description": _("Reordering Course Content"),
"action_external": False}]}, "long_description": _("Use drag and drop to reorder the content in your course."),
{"short_description": _("Explore edX's Support Tools"), "is_checked": False,
"items": [{"short_description": _("Explore the Studio Help Forum"), "action_url": "CourseOutline",
"long_description": _("Access the Studio Help forum from the menu that appears when you click your user name in the top right corner of Studio."), "action_text": _("Edit Course Outline"),
"is_checked": False, "action_external": False,
"action_url": "http://help.edge.edx.org/", },
"action_text": _("Visit Studio Help"), {
"action_external": True}, "short_description": _("Renaming Sections"),
{"short_description": _("Enroll in edX 101"), "long_description": _("Rename Sections by clicking the Section name from the Course Outline."),
"long_description": _("Register for edX 101, edX's primer for course creation."), "is_checked": False,
"is_checked": False, "action_url": "CourseOutline",
"action_url": "https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about", "action_text": _("Edit Course Outline"),
"action_text": _("Register for edX 101"), "action_external": False,
"action_external": True}, },
{"short_description": _("Download the Studio Documentation"), {
"long_description": _("Download the searchable Studio reference documentation in PDF form."), "short_description": _("Deleting Course Content"),
"is_checked": False, "long_description": _("Delete Sections, Subsections, or Units you don't need anymore. Be careful, as there is no Undo function."),
"action_url": "http://files.edx.org/Getting_Started_with_Studio.pdf", "is_checked": False,
"action_text": _("Download Documentation"), "action_url": "CourseOutline",
"action_external": True}]}, "action_text": _("Edit Course Outline"),
{"short_description": _("Draft Your Course About Page"), "action_external": False,
"items": [{"short_description": _("Draft a Course Description"), },
"long_description": _("Courses on edX have an About page that includes a course video, description, and more. Draft the text students will read before deciding to enroll in your course."), {
"is_checked": False, "short_description": _("Add an Instructor-Only Section to Your Outline"),
"action_url": "SettingsDetails", "long_description": _("Some course authors find using a section for unsorted, in-progress work useful. To do this, create a section and set the release date to the distant future."),
"action_text": _("Edit Course Schedule &amp; Details"), "is_checked": False,
"action_external": False}, "action_url": "CourseOutline",
{"short_description": _("Add Staff Bios"), "action_text": _("Edit Course Outline"),
"long_description": _("Showing prospective students who their instructor will be is helpful. Include staff bios on the course About page."), "action_external": False,
"is_checked": False, },
"action_url": "SettingsDetails", ],
"action_text": _("Edit Course Schedule &amp; Details"), },
"action_external": False}, {
{"short_description": _("Add Course FAQs"), "short_description": _("Explore edX's Support Tools"),
"long_description": _("Include a short list of frequently asked questions about your course."), "items": [
"is_checked": False, {
"action_url": "SettingsDetails", "short_description": _("Explore the Studio Help Forum"),
"action_text": _("Edit Course Schedule &amp; Details"), "long_description": _("Access the Studio Help forum from the menu that appears when you click your user name in the top right corner of Studio."),
"action_external": False}, "is_checked": False,
{"short_description": _("Add Course Prerequisites"), "action_url": "http://help.edge.edx.org/",
"long_description": _("Let students know what knowledge and/or skills they should have before they enroll in your course."), "action_text": _("Visit Studio Help"),
"is_checked": False, "action_external": True,
"action_url": "SettingsDetails", },
"action_text": _("Edit Course Schedule &amp; Details"), {
"action_external": False}]} "short_description": _("Enroll in edX 101"),
] "long_description": _("Register for edX 101, edX's primer for course creation."),
"is_checked": False,
"action_url": "https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about",
"action_text": _("Register for edX 101"),
"action_external": True,
},
{
"short_description": _("Download the Studio Documentation"),
"long_description": _("Download the searchable Studio reference documentation in PDF form."),
"is_checked": False,
"action_url": "http://files.edx.org/Getting_Started_with_Studio.pdf",
"action_text": _("Download Documentation"),
"action_external": True,
},
],
},
{
"short_description": _("Draft Your Course About Page"),
"items": [
{
"short_description": _("Draft a Course Description"),
"long_description": _("Courses on edX have an About page that includes a course video, description, and more. Draft the text students will read before deciding to enroll in your course."),
"is_checked": False,
"action_url": "SettingsDetails",
"action_text": _("Edit Course Schedule &amp; Details"),
"action_external": False,
},
{
"short_description": _("Add Staff Bios"),
"long_description": _("Showing prospective students who their instructor will be is helpful. Include staff bios on the course About page."),
"is_checked": False,
"action_url": "SettingsDetails",
"action_text": _("Edit Course Schedule &amp; Details"),
"action_external": False,
},
{
"short_description": _("Add Course FAQs"),
"long_description": _("Include a short list of frequently asked questions about your course."),
"is_checked": False,
"action_url": "SettingsDetails",
"action_text": _("Edit Course Schedule &amp; Details"),
"action_external": False,
},
{
"short_description": _("Add Course Prerequisites"),
"long_description": _("Let students know what knowledge and/or skills they should have before they enroll in your course."),
"is_checked": False,
"action_url": "SettingsDetails",
"action_text": _("Edit Course Schedule &amp; Details"),
"action_external": False,
},
],
},
],
) )
info_sidebar_name = String( info_sidebar_name = String(
display_name=_("Course Info Sidebar Name"), display_name=_("Course Info Sidebar Name"),
......
...@@ -152,16 +152,21 @@ class MongoConnection(object): ...@@ -152,16 +152,21 @@ class MongoConnection(object):
original_version (str or ObjectID): The id of a structure original_version (str or ObjectID): The id of a structure
block_key (BlockKey): The id of the block in question block_key (BlockKey): The id of the block in question
""" """
return [structure_from_mongo(structure) for structure in self.structures.find({ return [
'original_version': original_version, structure_from_mongo(structure)
'blocks': { for structure in self.structures.find({
'$elemMatch': { 'original_version': original_version,
'block_id': block_key.id, 'blocks': {
'block_type': block_key.type, '$elemMatch': {
'edit_info.update_version': {'$exists': True}, 'block_id': block_key.id,
} 'block_type': block_key.type,
} 'edit_info.update_version': {
})] '$exists': True,
},
},
},
})
]
def insert_structure(self, structure): def insert_structure(self, structure):
""" """
......
...@@ -54,10 +54,11 @@ class StudentModule(models.Model): ...@@ -54,10 +54,11 @@ class StudentModule(models.Model):
## Grade, and are we done? ## Grade, and are we done?
grade = models.FloatField(null=True, blank=True, db_index=True) grade = models.FloatField(null=True, blank=True, db_index=True)
max_grade = models.FloatField(null=True, blank=True) max_grade = models.FloatField(null=True, blank=True)
DONE_TYPES = (('na', 'NOT_APPLICABLE'), DONE_TYPES = (
('f', 'FINISHED'), ('na', 'NOT_APPLICABLE'),
('i', 'INCOMPLETE'), ('f', 'FINISHED'),
) ('i', 'INCOMPLETE'),
)
done = models.CharField(max_length=8, choices=DONE_TYPES, default='na', db_index=True) done = models.CharField(max_length=8, choices=DONE_TYPES, default='na', db_index=True)
created = models.DateTimeField(auto_now_add=True, db_index=True) created = models.DateTimeField(auto_now_add=True, db_index=True)
......
...@@ -115,13 +115,14 @@ class Command(BaseCommand): ...@@ -115,13 +115,14 @@ class Command(BaseCommand):
if make_eamap: if make_eamap:
credentials = "/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN=%s/emailAddress=%s" % (name, email) credentials = "/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN=%s/emailAddress=%s" % (name, email)
eamap = ExternalAuthMap(external_id=email, eamap = ExternalAuthMap(
external_email=email, external_id=email,
external_domain=mit_domain, external_email=email,
external_name=name, external_domain=mit_domain,
internal_password=password, external_name=name,
external_credentials=json.dumps(credentials), internal_password=password,
) external_credentials=json.dumps(credentials),
)
eamap.user = user eamap.user = user
eamap.dtsignup = datetime.datetime.now(UTC) eamap.dtsignup = datetime.datetime.now(UTC)
eamap.save() eamap.save()
......
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