From d6f794c4d7dcd9d0326dea36aee1b3de5f1f5783 Mon Sep 17 00:00:00 2001 From: Vasyl Nakvasiuk Date: Tue, 30 Jul 2013 11:59:41 +0300 Subject: [PATCH] gst module: add configuration and render properties --- common/lib/xmodule/xmodule/gst_module.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/gst_module.py b/common/lib/xmodule/xmodule/gst_module.py index 80fafe4dc2..9605aee2b0 100644 --- a/common/lib/xmodule/xmodule/gst_module.py +++ b/common/lib/xmodule/xmodule/gst_module.py @@ -92,6 +92,16 @@ class GraphicalSliderToolModule(GraphicalSliderToolFields, XModule): css = {'scss': [resource_string(__name__, 'css/gst/display.scss')]} js_module_name = "GraphicalSliderTool" + @property + def configuration(self): + return stringify_children( + html.fromstring(self.data).xpath('configuration')[0]) + + @property + def render(self): + return stringify_children( + html.fromstring(self.data).xpath('render')[0]) + def get_html(self): """ Renders parameters to template. """ @@ -99,12 +109,6 @@ class GraphicalSliderToolModule(GraphicalSliderToolFields, XModule): self.html_id = self.location.html_id() self.html_class = self.location.category - self.configuration = html.fromstring(self.data).xpath('configuration')[0] - self.configuration = stringify_children(self.configuration) - - self.render = html.fromstring(self.data).xpath('render')[0] - self.render = stringify_children(self.render) - self.configuration_json = self.build_configuration_json() params = { 'gst_html': self.substitute_controls(self.render),