Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
884db888
Commit
884db888
authored
Nov 28, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teting gst
parent
d0fcaf0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
72 deletions
+72
-72
common/lib/xmodule/xmodule/gst_module.py
+72
-72
No files found.
common/lib/xmodule/xmodule/gst_module.py
View file @
884db888
...
@@ -29,70 +29,70 @@ class GSTModule(XModule):
...
@@ -29,70 +29,70 @@ class GSTModule(XModule):
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
shared_state
=
None
,
**
kwargs
):
"""
"""
pass
Definition should have....
# Definition should have....
sliders, text, module
# sliders, text, module
Sample file:
# Sample file:
<gst>
# <gst
>
<h2> Plot... </h2
>
# <h2> Plot... </h2
>
<slider name="1" var="a"/
>
# <slid
er name="1" var="a"/>
<numb
er name="1" var="a"/>
# <number name="1" var="a"
/>
<plot
/>
# <plot/
>
<sliders_info
>
# <sliders_info
>
<sliders/
>
# <sliders/
>
<numbers_info
>
# <numbers_info>
</numbers_info
# </numbers_info
<plot_info>
# <
plot_info>
</
plot_info>
# </plot_info
>
</gst
>
# </gst>
"""
# """
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
# XModule.__init__(self, system, location, definition, descriptor,
instance_state
,
shared_state
,
**
kwargs
)
# instance_state, shared_state, **kwargs
)
# import ipdb; ipdb.set_trace(
)
# import ipdb; ipdb.set_trace()
# self.rendered = False
# self.rendered = False
def
get_html
(
self
):
# def get_html(self):
self
.
render
()
# self.render()
return
self
.
content
# return self.content
def
render
(
self
):
# def render(self):
# import ipdb; ipdb.set_trace()
# import ipdb; ipdb.set_trace()
# if self.rendered:
# if self.rendered:
return
# retur
n
## Returns a set of all types of all sub-childre
n
# ## Returns a set of all types of all sub-children
# contents = []
# contents = []
# # import ipdb; ipdb.set_trace()
# # import ipdb; ipdb.set_trace()
# for child in self.get_display_items():
# for child in self.get_display_items():
# progress = child.get_progress()
# progress = child.get_progress()
# childinfo = {
# childinfo = {
# 'gst': child.get_html(),
# 'gst': child.get_html(),
# 'plot': "\n".join(
# 'plot': "\n".join(
# grand_child.display_name.strip()
# grand_child.display_name.strip
()
# for grand_child in child.get_children
()
# for grand_child in child.get_children()
# if 'display_name' in grand_child.metadata
# if 'display_name' in grand_child.metadata
# ),
#
),
# # 'progress_status': Progress.to_js_status_str(progress
),
# # 'progress_status': Progress.to_js_status
_str(progress),
# 'progress_detail': Progress.to_js_detail
_str(progress),
# 'progress_detail': Progress.to_js_detail_str(progress
),
# 'type': child.get_icon_class(
),
# 'type': child.get_icon_class(),
# }
# }
# # if childinfo['title']=='':
# # if childinfo['title']=='':
# # childinfo['title'] = child.metadata.get('display_name','')
# # childinfo['title'] = child.metadata.get('display_name',''
)
# contents.append(childinfo
)
# contents.append(childinfo)
# params = {'items': contents,
# params = {'items': contents
,
# 'element_id': self.location.html_id()
,
# 'element_id': self.location.html_id()
,
# 'item_id': self.id
,
# 'item_id': self.id
,
# 'position': self.position
,
# 'position': self.position,
# 'tag': self.location.category
# 'tag': self.location.category
# }
#
}
params
=
{
}
self
.
content
=
self
.
system
.
render_template
(
'gst_module.html'
,
params
)
# self.content = self.system.render_template('seq_module.html', params)
# self.rendered = True
# self.rendered = True
# class GSTDescriptor(RawDescriptor):
class
GSTDescriptor
(
Raw
Descriptor
):
class
GSTDescriptor
(
MakoModuleDescriptor
,
Xml
Descriptor
):
mako_template
=
"widgets/html-edit.html"
mako_template
=
"widgets/html-edit.html"
module_class
=
GSTModule
module_class
=
GSTModule
template_dir_name
=
'gst'
template_dir_name
=
'gst'
...
@@ -108,7 +108,7 @@ class GSTDescriptor(RawDescriptor):
...
@@ -108,7 +108,7 @@ class GSTDescriptor(RawDescriptor):
'def2': 'def2-some-html'
'def2': 'def2-some-html'
}
}
"""
"""
import
ipdb
;
ipdb
.
set_trace
()
#
import ipdb; ipdb.set_trace()
children
=
[]
children
=
[]
for
child
in
xml_object
:
for
child
in
xml_object
:
try
:
try
:
...
@@ -120,7 +120,7 @@ class GSTDescriptor(RawDescriptor):
...
@@ -120,7 +120,7 @@ class GSTDescriptor(RawDescriptor):
def
definition_to_xml
(
self
,
resource_fs
):
def
definition_to_xml
(
self
,
resource_fs
):
'''Return an xml element representing this definition.'''
'''Return an xml element representing this definition.'''
import
ipdb
;
ipdb
.
set_trace
()
#
import ipdb; ipdb.set_trace()
xml_object
=
etree
.
Element
(
'gst'
)
xml_object
=
etree
.
Element
(
'gst'
)
def
add_child
(
k
):
def
add_child
(
k
):
...
@@ -135,8 +135,8 @@ class GSTDescriptor(RawDescriptor):
...
@@ -135,8 +135,8 @@ class GSTDescriptor(RawDescriptor):
return
xml_object
return
xml_object
def
__init__
(
self
,
system
,
definition
,
**
kwargs
):
# def __init__(self, system, definition, **kwargs):
'''Render and save the template for this descriptor instance'''
# '''Render and save the template for this descriptor instance'''
import
ipdb
;
ipdb
.
set_trace
()
# # import ipdb; ipdb.set_trace()
super
(
CustomTagDescriptor
,
self
)
.
__init__
(
system
,
definition
,
**
kwargs
)
# super(GSTDescriptor, self).__init__(system, definition, **kwargs)
self
.
rendered_html
=
self
.
render_template
(
system
,
definition
[
'data'
])
# self.rendered_html = self.render_template(system, definition['data'])
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment