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
100da2ae
Commit
100da2ae
authored
Dec 20, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added gst tests for import
parent
b0b4a90b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
common/lib/xmodule/xmodule/tests/test_import.py
+17
-0
common/test/data/graphic_slider_tool/course/2012_Fall.xml
+1
-1
common/test/data/graphic_slider_tool/graphical_slider_tool/sample_gst.xml
+3
-14
common/test/data/graphic_slider_tool/policies/2012_Fall.json
+1
-1
No files found.
common/lib/xmodule/xmodule/tests/test_import.py
View file @
100da2ae
...
...
@@ -349,6 +349,23 @@ class ImportTestCase(unittest.TestCase):
sa_id
=
"edX/sa_test/2012_Fall"
location
=
Location
([
"i4x"
,
"edX"
,
"sa_test"
,
"selfassessment"
,
"SampleQuestion"
])
# import ipdb; ipdb.set_trace()
sa_sample
=
modulestore
.
get_instance
(
sa_id
,
location
)
#10 attempts is hard coded into SampleQuestion, which is the url_name of a selfassessment xml tag
self
.
assertEqual
(
sa_sample
.
metadata
[
'attempts'
],
'10'
)
def
test_graphicslidertool_import
(
self
):
'''
Check to see if definition_from_xml in gst_module.py
works properly. Pulls data from the graphic_slider_tool directory
in the test data directory.
'''
modulestore
=
XMLModuleStore
(
DATA_DIR
,
course_dirs
=
[
'graphic_slider_tool'
])
sa_id
=
"edX/gst_test/2012_Fall"
location
=
Location
([
"i4x"
,
"edX"
,
"gst_test"
,
"graphical_slider_tool"
,
"sample_gst"
])
gst_sample
=
modulestore
.
get_instance
(
sa_id
,
location
)
render_string_from_sample_gst_xml
=
"""
<slider var="a" style="width:400px;float:left;"/>
\
<plot style="margin-top:15px;margin-bottom:15px;"/>"""
.
strip
()
self
.
assertEqual
(
gst_sample
.
definition
[
'render'
],
render_string_from_sample_gst_xml
)
common/test/data/graphic_slider_tool/course/2012_Fall.xml
View file @
100da2ae
<course>
<chapter
url_name=
"Overview"
>
<g
st
url_name=
"sample_gst"
/>
<g
raphical_slider_tool
url_name=
"sample_gst"
/>
</chapter>
</course>
common/test/data/graphic_slider_tool/g
st
/sample_gst.xml
→
common/test/data/graphic_slider_tool/g
raphical_slider_tool
/sample_gst.xml
View file @
100da2ae
<vertical>
<graphical_slider_tool>
<render>
<h2>
Graphic slider tool: Dynamic range and implicit functions.
</h2>
<p>
You can make x range (not ticks of x axis) of functions to depend on
parameter value. This can be useful when function domain depends
on parameter.
</p>
<p>
Also implicit functons like circle can be plotted as 2 separate
functions of same color.
</p>
<div
style=
"height:50px;"
>
<slider
var=
'a'
style=
"width:400px;float:left;"
/>
<textbox
var=
'a'
style=
"float:left;width:60px;margin-left:15px;"
/>
</div>
<plot
style=
"margin-top:15px;margin-bottom:15px;"
/>
<slider
var=
'a'
style=
"width:400px;float:left;"
/><plot
style=
"margin-top:15px;margin-bottom:15px;"
/>
</render>
<configuration>
<parameters>
...
...
@@ -38,4 +27,4 @@
</plot>
</configuration>
</graphical_slider_tool>
</vertical>
common/test/data/graphic_slider_tool/policies/2012_Fall.json
View file @
100da2ae
...
...
@@ -8,7 +8,7 @@
"chapter/Overview"
:
{
"display_name"
:
"Overview"
},
"g
st
/sample_gst"
:
{
"g
raphical_slider_tool
/sample_gst"
:
{
"display_name"
:
"Sample GST"
,
},
}
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