From 7559cd90d6c87d4a6eca050862904065b23d4980 Mon Sep 17 00:00:00 2001 From: Alexander Kryklia Date: Tue, 30 Apr 2013 13:17:13 +0300 Subject: [PATCH] separates xfields that descriptor use and module use --- common/lib/xmodule/xmodule/word_cloud_module.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/word_cloud_module.py b/common/lib/xmodule/xmodule/word_cloud_module.py index df43c7cf53..b5a6a656f9 100644 --- a/common/lib/xmodule/xmodule/word_cloud_module.py +++ b/common/lib/xmodule/xmodule/word_cloud_module.py @@ -24,13 +24,16 @@ def pretty_bool(value): return value in BOOL_DICT -class WordCloudFields(object): +class WordCloudDescriptorFields(object): # Name of poll to use in links to this poll 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_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) student_words = List(help="Student answer", scope=Scope.user_state, default=[]) @@ -38,7 +41,7 @@ class WordCloudFields(object): top_words = Object(help="Top N words for word cloud", scope=Scope.content) -class WordCloudModule(WordCloudFields, XModule): +class WordCloudModule(WordCloudFields, WordCloudDescriptorFields, XModule): """WordCloud Module""" js = { 'coffee': [resource_string(__name__, 'js/src/javascript_loader.coffee')], @@ -169,7 +172,7 @@ class WordCloudModule(WordCloudFields, XModule): return self.content -class WordCloudDescriptor(WordCloudFields, RawDescriptor): +class WordCloudDescriptor(WordCloudDescriptorFields, RawDescriptor): module_class = WordCloudModule template_dir_name = 'word_cloud'