diff --git a/cms/djangoapps/contentstore/features/course-export.py b/cms/djangoapps/contentstore/features/course-export.py index b30c79ecb7..d8ab58a6d5 100644 --- a/cms/djangoapps/contentstore/features/course-export.py +++ b/cms/djangoapps/contentstore/features/course-export.py @@ -24,7 +24,8 @@ def i_export_the_course(step): @step('I edit and enter bad XML$') def i_enter_bad_xml(step): - enter_xml_in_advanced_problem(step, + enter_xml_in_advanced_problem( + step, """

Smallest Canvas

You want to make the smallest canvas you can.

diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index 9aeb1cb1a9..d1b0ebacf1 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -14,23 +14,24 @@ class CourseMetadata(object): # 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 # depending on the feature flag. - FILTERED_LIST = ['xml_attributes', - 'start', - 'end', - 'enrollment_start', - 'enrollment_end', - 'tabs', - 'graceperiod', - 'checklists', - 'show_timezone', - 'format', - 'graded', - 'hide_from_toc', - 'pdf_textbooks', - 'user_partitions', - 'name', # from xblock - 'tags', # from xblock - 'visible_to_staff_only' + FILTERED_LIST = [ + 'xml_attributes', + 'start', + 'end', + 'enrollment_start', + 'enrollment_end', + 'tabs', + 'graceperiod', + 'checklists', + 'show_timezone', + 'format', + 'graded', + 'hide_from_toc', + 'pdf_textbooks', + 'user_partitions', + 'name', # from xblock + 'tags', # from xblock + 'visible_to_staff_only', ] @classmethod diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 5dfecc98bf..87137039ea 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -2120,8 +2120,10 @@ class CodeResponse(LoncapaResponse): parsed = False if not parsed: - log.error("Unable to parse external grader message as valid" - " XML: score_msg['msg']=%s", msg + log.error( + "Unable to parse external grader message as valid" + " XML: score_msg['msg']=%s", + msg, ) return fail diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index c4c9106c81..48b3b89227 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -328,121 +328,174 @@ class CourseFields(object): scope=Scope.settings ) has_children = True - checklists = List(scope=Scope.settings, - default=[ - {"short_description": _("Getting Started With Studio"), - "items": [{"short_description": _("Add Course Team Members"), - "long_description": _("Grant your collaborators permission to edit your course so you can work together."), - "is_checked": False, - "action_url": "ManageUsers", - "action_text": _("Edit Course Team"), - "action_external": False}, - {"short_description": _("Set Important Dates for Your Course"), - "long_description": _("Establish your course's student enrollment and launch dates on the Schedule and Details page."), - "is_checked": False, - "action_url": "SettingsDetails", - "action_text": _("Edit Course Details & Schedule"), - "action_external": False}, - {"short_description": _("Draft Your Course's Grading Policy"), - "long_description": _("Set up your assignment types and grading policy even if you haven't created all your assignments."), - "is_checked": False, - "action_url": "SettingsGrading", - "action_text": _("Edit Grading Settings"), - "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, - "action_url": "", - "action_text": "", - "action_external": False}]}, - {"short_description": _("Draft a Rough Course Outline"), - "items": [{"short_description": _("Create Your First Section and Subsection"), - "long_description": _("Use your course outline to build your first Section and Subsection."), - "is_checked": False, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "action_external": False}, - {"short_description": _("Set Section Release Dates"), - "long_description": _("Specify the release dates for each Section in your course. Sections become visible to students on their release dates."), - "is_checked": 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."), - "is_checked": False, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "action_external": False}, - {"short_description": _("Reordering Course Content"), - "long_description": _("Use drag and drop to reorder the content in your course."), - "is_checked": False, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "action_external": False}, - {"short_description": _("Renaming Sections"), - "long_description": _("Rename Sections by clicking the Section name from the Course Outline."), - "is_checked": False, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "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, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "action_external": False}, - {"short_description": _("Add an Instructor-Only Section to Your 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."), - "is_checked": False, - "action_url": "CourseOutline", - "action_text": _("Edit Course Outline"), - "action_external": False}]}, - {"short_description": _("Explore edX's Support Tools"), - "items": [{"short_description": _("Explore the Studio Help Forum"), - "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."), - "is_checked": False, - "action_url": "http://help.edge.edx.org/", - "action_text": _("Visit Studio Help"), - "action_external": True}, - {"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 & 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 & 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 & 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 & Details"), - "action_external": False}]} - ] + checklists = List( + scope=Scope.settings, + default=[ + { + "short_description": _("Getting Started With Studio"), + "items": [ + { + "short_description": _("Add Course Team Members"), + "long_description": _("Grant your collaborators permission to edit your course so you can work together."), + "is_checked": False, + "action_url": "ManageUsers", + "action_text": _("Edit Course Team"), + "action_external": False, + }, + { + "short_description": _("Set Important Dates for Your Course"), + "long_description": _("Establish your course's student enrollment and launch dates on the Schedule and Details page."), + "is_checked": False, + "action_url": "SettingsDetails", + "action_text": _("Edit Course Details & Schedule"), + "action_external": False, + }, + { + "short_description": _("Draft Your Course's Grading Policy"), + "long_description": _("Set up your assignment types and grading policy even if you haven't created all your assignments."), + "is_checked": False, + "action_url": "SettingsGrading", + "action_text": _("Edit Grading Settings"), + "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, + "action_url": "", + "action_text": "", + "action_external": False, + }, + ], + }, + { + "short_description": _("Draft a Rough Course Outline"), + "items": [ + { + "short_description": _("Create Your First Section and Subsection"), + "long_description": _("Use your course outline to build your first Section and Subsection."), + "is_checked": False, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "action_external": False, + }, + { + "short_description": _("Set Section Release Dates"), + "long_description": _("Specify the release dates for each Section in your course. Sections become visible to students on their release dates."), + "is_checked": 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."), + "is_checked": False, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "action_external": False, + }, + { + "short_description": _("Reordering Course Content"), + "long_description": _("Use drag and drop to reorder the content in your course."), + "is_checked": False, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "action_external": False, + }, + { + "short_description": _("Renaming Sections"), + "long_description": _("Rename Sections by clicking the Section name from the Course Outline."), + "is_checked": False, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "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, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "action_external": False, + }, + { + "short_description": _("Add an Instructor-Only Section to Your 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."), + "is_checked": False, + "action_url": "CourseOutline", + "action_text": _("Edit Course Outline"), + "action_external": False, + }, + ], + }, + { + "short_description": _("Explore edX's Support Tools"), + "items": [ + { + "short_description": _("Explore the Studio Help Forum"), + "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."), + "is_checked": False, + "action_url": "http://help.edge.edx.org/", + "action_text": _("Visit Studio Help"), + "action_external": True, + }, + { + "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 & 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 & 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 & 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 & Details"), + "action_external": False, + }, + ], + }, + ], ) info_sidebar_name = String( display_name=_("Course Info Sidebar Name"), diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py index 7203e39b7d..015ecdd164 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py @@ -152,16 +152,21 @@ class MongoConnection(object): original_version (str or ObjectID): The id of a structure block_key (BlockKey): The id of the block in question """ - return [structure_from_mongo(structure) for structure in self.structures.find({ - 'original_version': original_version, - 'blocks': { - '$elemMatch': { - 'block_id': block_key.id, - 'block_type': block_key.type, - 'edit_info.update_version': {'$exists': True}, - } - } - })] + return [ + structure_from_mongo(structure) + for structure in self.structures.find({ + 'original_version': original_version, + 'blocks': { + '$elemMatch': { + 'block_id': block_key.id, + 'block_type': block_key.type, + 'edit_info.update_version': { + '$exists': True, + }, + }, + }, + }) + ] def insert_structure(self, structure): """ diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index cb471dd79c..c6f5565251 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -54,10 +54,11 @@ class StudentModule(models.Model): ## Grade, and are we done? grade = models.FloatField(null=True, blank=True, db_index=True) max_grade = models.FloatField(null=True, blank=True) - DONE_TYPES = (('na', 'NOT_APPLICABLE'), - ('f', 'FINISHED'), - ('i', 'INCOMPLETE'), - ) + DONE_TYPES = ( + ('na', 'NOT_APPLICABLE'), + ('f', 'FINISHED'), + ('i', 'INCOMPLETE'), + ) done = models.CharField(max_length=8, choices=DONE_TYPES, default='na', db_index=True) created = models.DateTimeField(auto_now_add=True, db_index=True) diff --git a/lms/djangoapps/lms_migration/management/commands/create_user.py b/lms/djangoapps/lms_migration/management/commands/create_user.py index 10051b349c..6f72ec5d94 100644 --- a/lms/djangoapps/lms_migration/management/commands/create_user.py +++ b/lms/djangoapps/lms_migration/management/commands/create_user.py @@ -115,13 +115,14 @@ class Command(BaseCommand): if make_eamap: 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, - external_email=email, - external_domain=mit_domain, - external_name=name, - internal_password=password, - external_credentials=json.dumps(credentials), - ) + eamap = ExternalAuthMap( + external_id=email, + external_email=email, + external_domain=mit_domain, + external_name=name, + internal_password=password, + external_credentials=json.dumps(credentials), + ) eamap.user = user eamap.dtsignup = datetime.datetime.now(UTC) eamap.save()