Commit 7559cd90 by Alexander Kryklia Committed by Vasyl Nakvasiuk

separates xfields that descriptor use and module use

parent 36d2dd63
...@@ -24,13 +24,16 @@ def pretty_bool(value): ...@@ -24,13 +24,16 @@ def pretty_bool(value):
return value in BOOL_DICT return value in BOOL_DICT
class WordCloudFields(object): class WordCloudDescriptorFields(object):
# Name of poll to use in links to this poll # Name of poll to use in links to this poll
display_name = String(help="Display name for this module", scope=Scope.settings) 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_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) num_top_words = Integer(help="Number of max words, which will be displayed.", scope=Scope.settings, default=250)
display_student_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)
class WordCloudFields(object):
submitted = Boolean(help="Whether this student has posted words to the cloud", scope=Scope.user_state, default=False) 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=[]) student_words = List(help="Student answer", scope=Scope.user_state, default=[])
...@@ -38,7 +41,7 @@ class WordCloudFields(object): ...@@ -38,7 +41,7 @@ class WordCloudFields(object):
top_words = Object(help="Top N words for word cloud", scope=Scope.content) top_words = Object(help="Top N words for word cloud", scope=Scope.content)
class WordCloudModule(WordCloudFields, XModule): class WordCloudModule(WordCloudFields, WordCloudDescriptorFields, XModule):
"""WordCloud Module""" """WordCloud Module"""
js = { js = {
'coffee': [resource_string(__name__, 'js/src/javascript_loader.coffee')], 'coffee': [resource_string(__name__, 'js/src/javascript_loader.coffee')],
...@@ -169,7 +172,7 @@ class WordCloudModule(WordCloudFields, XModule): ...@@ -169,7 +172,7 @@ class WordCloudModule(WordCloudFields, XModule):
return self.content return self.content
class WordCloudDescriptor(WordCloudFields, RawDescriptor): class WordCloudDescriptor(WordCloudDescriptorFields, RawDescriptor):
module_class = WordCloudModule module_class = WordCloudModule
template_dir_name = 'word_cloud' template_dir_name = 'word_cloud'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment