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
0967cb0d
Commit
0967cb0d
authored
Jul 24, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix word cloud modules not exporting correctly.
parent
77a796e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
cms/djangoapps/contentstore/tests/test_contentstore.py
+28
-0
common/lib/xmodule/xmodule/word_cloud_module.py
+8
-0
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
0967cb0d
...
...
@@ -855,6 +855,34 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
shutil
.
rmtree
(
root_dir
)
def
test_export_course_with_metadata_only_word_cloud
(
self
):
"""
Similar to `test_export_course_with_metadata_only_video`.
"""
module_store
=
modulestore
(
'direct'
)
draft_store
=
modulestore
(
'draft'
)
content_store
=
contentstore
()
import_from_xml
(
module_store
,
'common/test/data/'
,
[
'word_cloud'
])
location
=
CourseDescriptor
.
id_to_location
(
'HarvardX/ER22x/2013_Spring'
)
verticals
=
module_store
.
get_items
([
'i4x'
,
'HarvardX'
,
'ER22x'
,
'vertical'
,
None
,
None
])
self
.
assertGreater
(
len
(
verticals
),
0
)
parent
=
verticals
[
0
]
ItemFactory
.
create
(
parent_location
=
parent
.
location
,
category
=
"word_cloud"
,
display_name
=
"untitled"
)
root_dir
=
path
(
mkdtemp_clean
())
print
'Exporting to tempdir = {0}'
.
format
(
root_dir
)
# export out to a tempdir
export_to_xml
(
module_store
,
content_store
,
location
,
root_dir
,
'test_export'
,
draft_modulestore
=
draft_store
)
shutil
.
rmtree
(
root_dir
)
def
test_course_handouts_rewrites
(
self
):
module_store
=
modulestore
(
'direct'
)
...
...
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
0967cb0d
...
...
@@ -9,6 +9,8 @@ If student have answered - words he entered and cloud.
import
json
import
logging
from
lxml
import
etree
from
pkg_resources
import
resource_string
from
xmodule.raw_module
import
RawDescriptor
from
xmodule.editing_module
import
MetadataOnlyEditingDescriptor
...
...
@@ -244,3 +246,9 @@ class WordCloudDescriptor(WordCloudFields, MetadataOnlyEditingDescriptor, RawDes
"""Descriptor for WordCloud Xmodule."""
module_class
=
WordCloudModule
template_dir_name
=
'word_cloud'
def
definition_to_xml
(
self
,
resource_fs
):
"""
Since there's no real data, just return an empty XML tag.
"""
return
etree
.
fromstring
(
'<word_cloud />'
)
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