Commit 3f44b3aa by Alexander Kryklia

gst module docs

parent 1fb4c8c7
...@@ -8,7 +8,6 @@ import logging ...@@ -8,7 +8,6 @@ import logging
from lxml import etree from lxml import etree
from lxml import html from lxml import html
import xmltodict import xmltodict
import re
from xmodule.mako_module import MakoModuleDescriptor from xmodule.mako_module import MakoModuleDescriptor
from xmodule.xml_module import XmlDescriptor from xmodule.xml_module import XmlDescriptor
...@@ -71,17 +70,19 @@ class GraphicalSliderToolModule(XModule): ...@@ -71,17 +70,19 @@ class GraphicalSliderToolModule(XModule):
return self.content return self.content
def substitute_controls(self, html_string): def substitute_controls(self, html_string):
""" Substitutes control elements via their divs. """ Substitutes control elements (slider, textbox and plot) in
TODO: change regexps to html parsing via beautiful soup or something html_string with their divs. Html_string is content of <render> tag
similar (aim : simpler support). inside <graphical_slider_tool> tag. Documentation on how information in
<render> tag is organized and processed is located in:
mitx/docs/build/html/graphical_slider_tool.html.
Args: Args:
html_string: rendered html string with controls as xml tags html_string: content of <render> tag, with controls as xml tags,
(<slider var="a"/>) e.g. <slider var="a"/>.
Returns: Returns:
html_string with control tags replaced by proper divs html_string with control tags replaced by proper divs
(<slider var="a"/> -> <div class="....slider" > </div>) (<slider var="a"/> -> <div class="....slider" > </div>)
""" """
xml = html.fromstring(html_string) xml = html.fromstring(html_string)
......
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