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
e8b12d84
Commit
e8b12d84
authored
Aug 03, 2012
by
Victor Shnayder
Committed by
Calen Pennington
Aug 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanups
parent
7930ba03
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
common/lib/xmodule/xmodule/abtest_module.py
+6
-2
common/lib/xmodule/xmodule/course_module.py
+0
-0
common/lib/xmodule/xmodule/modulestore/xml.py
+7
-2
common/lib/xmodule/xmodule/x_module.py
+3
-2
No files found.
common/lib/xmodule/xmodule/abtest_module.py
View file @
e8b12d84
...
...
@@ -103,7 +103,9 @@ class ABTestDescriptor(RawDescriptor, XmlDescriptor):
experiment
=
xml_object
.
get
(
'experiment'
)
if
experiment
is
None
:
raise
InvalidDefinitionError
(
"ABTests must specify an experiment. Not found in:
\n
{xml}"
.
format
(
xml
=
etree
.
tostring
(
xml_object
,
pretty_print
=
True
)))
raise
InvalidDefinitionError
(
"ABTests must specify an experiment. Not found in:
\n
{xml}"
.
format
(
xml
=
etree
.
tostring
(
xml_object
,
pretty_print
=
True
)))
definition
=
{
'data'
:
{
...
...
@@ -127,7 +129,9 @@ class ABTestDescriptor(RawDescriptor, XmlDescriptor):
definition
[
'data'
][
'group_content'
][
name
]
=
child_content_urls
definition
[
'children'
]
.
extend
(
child_content_urls
)
default_portion
=
1
-
sum
(
portion
for
(
name
,
portion
)
in
definition
[
'data'
][
'group_portions'
]
.
items
())
default_portion
=
1
-
sum
(
portion
for
(
name
,
portion
)
in
definition
[
'data'
][
'group_portions'
]
.
items
())
if
default_portion
<
0
:
raise
InvalidDefinitionError
(
"ABTest portions must add up to less than or equal to 1"
)
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
e8b12d84
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
e8b12d84
...
...
@@ -188,21 +188,26 @@ class XMLModuleStore(ModuleStoreBase):
course_file
=
StringIO
(
clean_out_mako_templating
(
course_file
.
read
()))
course_data
=
etree
.
parse
(
course_file
)
.
getroot
()
org
=
course_data
.
get
(
'org'
)
if
org
is
None
:
log
.
error
(
"No 'org' attribute set for course in {dir}. "
msg
=
(
"No 'org' attribute set for course in {dir}. "
"Using default 'edx'"
.
format
(
dir
=
course_dir
))
log
.
error
(
msg
)
tracker
(
msg
)
org
=
'edx'
course
=
course_data
.
get
(
'course'
)
if
course
is
None
:
log
.
error
(
"No 'course' attribute set for course in {dir}."
msg
=
(
"No 'course' attribute set for course in {dir}."
" Using default '{default}'"
.
format
(
dir
=
course_dir
,
default
=
course_dir
))
log
.
error
(
msg
)
tracker
(
msg
)
course
=
course_dir
system
=
ImportSystem
(
self
,
org
,
course
,
course_dir
,
tracker
)
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
e8b12d84
...
...
@@ -6,6 +6,7 @@ from fs.errors import ResourceNotFoundError
from
functools
import
partial
from
lxml
import
etree
from
lxml.etree
import
XMLSyntaxError
from
pprint
import
pprint
from
xmodule.modulestore
import
Location
from
xmodule.errortracker
import
exc_info_to_str
...
...
@@ -550,9 +551,9 @@ class XModuleDescriptor(Plugin, HTMLSnippet):
if
not
eq
:
for
attr
in
self
.
equality_attributes
:
p
rint
(
getattr
(
self
,
attr
,
None
),
p
print
(
(
getattr
(
self
,
attr
,
None
),
getattr
(
other
,
attr
,
None
),
getattr
(
self
,
attr
,
None
)
==
getattr
(
other
,
attr
,
None
))
getattr
(
self
,
attr
,
None
)
==
getattr
(
other
,
attr
,
None
)
))
return
eq
...
...
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