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
116b07df
Commit
116b07df
authored
Apr 25, 2013
by
Anto Stupak
Committed by
Vasyl Nakvasiuk
May 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
word cloud: return percents. Attribute name is changed
parent
9006fd2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud_main.js
+1
-1
common/lib/xmodule/xmodule/word_cloud_module.py
+4
-4
doc/public/course_data_formats/word_cloud/word_cloud.rst
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud_main.js
View file @
116b07df
...
...
@@ -233,7 +233,7 @@ define('WordCloudMain', ['logme'], function (logme) {
}
$
.
each
(
response
.
student_words
,
function
(
word
,
stat
)
{
var
percent
=
(
response
.
display_percents
)
?
' '
+
(
Math
.
round
(
100
*
(
stat
/
response
.
total_count
)))
+
'%'
:
''
;
var
percent
=
(
response
.
display_
student_
percents
)
?
' '
+
(
Math
.
round
(
100
*
(
stat
/
response
.
total_count
)))
+
'%'
:
''
;
studentWordsKeys
.
push
(
'<strong>'
+
word
+
'</strong>'
+
percent
);
});
...
...
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
116b07df
...
...
@@ -30,7 +30,7 @@ class WordCloudFields(object):
display_name
=
String
(
help
=
"Display name for this module"
,
scope
=
Scope
.
settings
)
num_inputs
=
Integer
(
help
=
"Number of inputs"
,
scope
=
Scope
.
settings
,
default
=
5
)
num_top_words
=
Integer
(
help
=
"Number of max words, which will be displayed."
,
scope
=
Scope
.
settings
,
default
=
250
)
display_percents
=
Boolean
(
help
=
"Dispaly usage percents for each word."
,
scope
=
Scope
.
settings
,
default
=
True
)
display_
student_
percents
=
Boolean
(
help
=
"Dispaly usage percents for each word."
,
scope
=
Scope
.
settings
,
default
=
True
)
submitted
=
Boolean
(
help
=
"Whether this student has posted words to the cloud"
,
scope
=
Scope
.
user_state
,
default
=
False
)
student_words
=
List
(
help
=
"Student answer"
,
scope
=
Scope
.
user_state
,
default
=
[])
...
...
@@ -59,7 +59,7 @@ class WordCloudModule(WordCloudFields, XModule):
return
json
.
dumps
({
'status'
:
'success'
,
'submitted'
:
True
,
'display_
percents'
:
pretty_bool
(
self
.
display
_percents
),
'display_
student_percents'
:
pretty_bool
(
self
.
display_student
_percents
),
'student_words'
:
{
word
:
self
.
all_words
[
word
]
for
word
in
self
.
student_words
},
...
...
@@ -70,7 +70,7 @@ class WordCloudModule(WordCloudFields, XModule):
return
json
.
dumps
({
'status'
:
'success'
,
'submitted'
:
False
,
'display_percents'
:
False
,
'display_
student_
percents'
:
False
,
'student_words'
:
{},
'total_count'
:
0
,
'top_words'
:
{}
...
...
@@ -194,6 +194,6 @@ class WordCloudDescriptor(WordCloudFields, MakoModuleDescriptor, XmlDescriptor):
xml_object
.
set
(
'display_name'
,
self
.
display_name
)
xml_object
.
set
(
'num_inputs'
,
self
.
num_inputs
)
xml_object
.
set
(
'num_top_words'
,
self
.
num_top_words
)
xml_object
.
set
(
'display_
percents'
,
pretty_bool
(
self
.
display
_percents
))
xml_object
.
set
(
'display_
student_percents'
,
pretty_bool
(
self
.
display_student
_percents
))
return
xml_object
doc/public/course_data_formats/word_cloud/word_cloud.rst
View file @
116b07df
...
...
@@ -18,7 +18,7 @@ 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_percents| True] – Dispaly usage percents for each word.
[display_
student_
percents| True] – Dispaly usage percents for each word.
.. note::
...
...
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