Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
47b9441a
Commit
47b9441a
authored
Aug 06, 2012
by
Victor Shnayder
Committed by
Calen Pennington
Aug 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few pep8 cleanups
parent
5523c288
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
common/lib/xmodule/xmodule/capa_module.py
+3
-3
common/lib/xmodule/xmodule/html_module.py
+4
-4
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
47b9441a
...
...
@@ -119,9 +119,9 @@ class CapaModule(XModule):
if
self
.
show_answer
==
""
:
self
.
show_answer
=
"closed"
if
instance_state
!=
None
:
if
instance_state
is
not
None
:
instance_state
=
json
.
loads
(
instance_state
)
if
instance_state
!=
None
and
'attempts'
in
instance_state
:
if
instance_state
is
not
None
and
'attempts'
in
instance_state
:
self
.
attempts
=
instance_state
[
'attempts'
]
self
.
name
=
only_one
(
dom2
.
xpath
(
'/problem/@name'
))
...
...
@@ -238,7 +238,7 @@ class CapaModule(XModule):
content
=
{
'name'
:
self
.
metadata
[
'display_name'
],
'html'
:
html
,
'weight'
:
self
.
weight
,
}
}
# We using strings as truthy values, because the terminology of the
# check button is context-specific.
...
...
common/lib/xmodule/xmodule/html_module.py
View file @
47b9441a
...
...
@@ -13,6 +13,7 @@ from .html_checker import check_html
log
=
logging
.
getLogger
(
"mitx.courseware"
)
class
HtmlModule
(
XModule
):
def
get_html
(
self
):
return
self
.
html
...
...
@@ -37,7 +38,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
@classmethod
def
backcompat_paths
(
cls
,
path
):
if
path
.
endswith
(
'.html.xml'
):
path
=
path
[:
-
9
]
+
'.html'
#backcompat--look for html instead of xml
path
=
path
[:
-
9
]
+
'.html'
#
backcompat--look for html instead of xml
candidates
=
[]
while
os
.
sep
in
path
:
candidates
.
append
(
path
)
...
...
@@ -70,7 +71,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
if
filename
is
None
:
definition_xml
=
copy
.
deepcopy
(
xml_object
)
cls
.
clean_metadata_from_xml
(
definition_xml
)
return
{
'data'
:
stringify_children
(
definition_xml
)}
return
{
'data'
:
stringify_children
(
definition_xml
)}
else
:
filepath
=
cls
.
_format_filepath
(
xml_object
.
tag
,
filename
)
...
...
@@ -96,7 +97,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
log
.
warning
(
msg
)
system
.
error_tracker
(
"Warning: "
+
msg
)
definition
=
{
'data'
:
html
}
definition
=
{
'data'
:
html
}
# TODO (ichuang): remove this after migration
# for Fall 2012 LMS migration: keep filename (and unmangled filename)
...
...
@@ -133,4 +134,3 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
elt
=
etree
.
Element
(
'html'
)
elt
.
set
(
"filename"
,
self
.
url_name
)
return
elt
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment