From d45c490bf065833898f569d42c1de9009ddc9907 Mon Sep 17 00:00:00 2001 From: Alexander Kryklia Date: Wed, 19 Dec 2012 12:40:21 +0200 Subject: [PATCH] plot now not required --- common/lib/xmodule/xmodule/gst_module.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/gst_module.py b/common/lib/xmodule/xmodule/gst_module.py index 0058c827d0..3bedd6dc9f 100644 --- a/common/lib/xmodule/xmodule/gst_module.py +++ b/common/lib/xmodule/xmodule/gst_module.py @@ -73,17 +73,19 @@ class GraphicalSliderToolModule(XModule): plot_div = '
' # extract css style from plot - plot_def = re.search(r'\$plot[^\$]*\$', html_string).group() - style = re.search(r'(?=.*style\=[\"\'](.*)[\"\'])', plot_def) - if style: - style = style.groups()[0] - else: # no style parameter - style = '' - replacement = plot_div.format(element_class=self.html_class, - element_id=self.html_id, - style=style) - html_string = re.sub(r'\$plot[^\$]*\$', replacement, html_string, - flags=re.UNICODE) + plot_def = re.search(r'\$plot[^\$]*\$', html_string) + if plot_def: + plot_def = plot_def.group() + style = re.search(r'(?=.*style\=[\"\'](.*)[\"\'])', plot_def) + if style: + style = style.groups()[0] + else: # no style parameter + style = '' + replacement = plot_div.format(element_class=self.html_class, + element_id=self.html_id, + style=style) + html_string = re.sub(r'\$plot[^\$]*\$', replacement, html_string, + flags=re.UNICODE) # get variables if json.loads(self.configuration_json)['root'].get('parameters'):