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
abc67b5e
Commit
abc67b5e
authored
May 15, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2021 from edx/vaxxxa/word_cloud_fix_peps
word cloud: fix pylint warnings, fix word cloud test
parents
1afe5561
b02e92a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
common/lib/xmodule/xmodule/word_cloud_module.py
+9
-4
doc/public/course_data_formats/word_cloud/word_cloud.rst
+12
-1
No files found.
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
abc67b5e
...
...
@@ -11,6 +11,7 @@ import logging
from
pkg_resources
import
resource_string
from
xmodule.raw_module
import
RawDescriptor
from
xmodule.editing_module
import
MetadataOnlyEditingDescriptor
from
xmodule.x_module
import
XModule
from
xblock.core
import
Scope
,
String
,
Object
,
Boolean
,
List
,
Integer
...
...
@@ -19,8 +20,13 @@ log = logging.getLogger(__name__)
def
pretty_bool
(
value
):
BOOL_DICT
=
[
True
,
"True"
,
"true"
,
"T"
,
"t"
,
"1"
]
return
value
in
BOOL_DICT
"""Check value for possible `True` value.
Using this function we can manage different type of Boolean value
in xml files.
"""
bool_dict
=
[
True
,
"True"
,
"true"
,
"T"
,
"t"
,
"1"
]
return
value
in
bool_dict
class
WordCloudFields
(
object
):
...
...
@@ -227,9 +233,8 @@ class WordCloudModule(WordCloudFields, XModule):
return
self
.
content
class
WordCloudDescriptor
(
WordCloudFields
,
RawDescriptor
):
class
WordCloudDescriptor
(
MetadataOnlyEditingDescriptor
,
RawDescriptor
,
WordCloudFields
):
"""Descriptor for WordCloud Xmodule."""
module_class
=
WordCloudModule
template_dir_name
=
'word_cloud'
stores_state
=
True
mako_template
=
"widgets/raw-edit.html"
doc/public/course_data_formats/word_cloud/word_cloud.rst
View file @
abc67b5e
...
...
@@ -18,12 +18,23 @@ The following attributes can be specified for this tag::
[display_name| AUTOGENERATE] – Display name of xmodule. When this attribute is not defined - display name autogenerate with some hash.
[num_inputs| 5] – Number of inputs.
[num_top_words| 250] – Number of max words, which will be displayed.
[display_student_percents| True] – Display usage percents for each word.
[display_student_percents| True] – Display usage percents for each word on the same line together with words.
.. note::
Percent is shown always when mouse over the word in cloud.
.. note::
Possible answer for boolean type attributes:
True – "True", "true", "T", "t", "1"
False – "False", "false", "F", "f", "0"
.. note::
If you want to use the same word cloud (the same storage of words), you must use the same display_name value.
Code Example
============
...
...
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