added gst tests for export
This commit is contained in:
@@ -41,7 +41,7 @@ def strip_filenames(descriptor):
|
||||
class RoundTripTestCase(unittest.TestCase):
|
||||
'''Check that our test courses roundtrip properly'''
|
||||
def check_export_roundtrip(self, data_dir, course_dir):
|
||||
|
||||
# import ipdb; ipdb.set_trace()
|
||||
root_dir = path(mkdtemp())
|
||||
print "Copying test course to temp dir {0}".format(root_dir)
|
||||
|
||||
@@ -117,3 +117,8 @@ class RoundTripTestCase(unittest.TestCase):
|
||||
def test_selfassessment_roundtrip(self):
|
||||
#Test selfassessment xmodule to see if it exports correctly
|
||||
self.check_export_roundtrip(DATA_DIR,"self_assessment")
|
||||
|
||||
def test_graphicslidertool_roundtrip(self):
|
||||
#Test graphicslidertool xmodule to see if it exports correctly
|
||||
# import ipdb; ipdb.set_trace()
|
||||
self.check_export_roundtrip(DATA_DIR,"graphic_slider_tool")
|
||||
|
||||
2
common/test/data/graphic_slider_tool/README.md
Normal file
2
common/test/data/graphic_slider_tool/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
This is a very very simple course, useful for debugging graphical slider tool
|
||||
code.
|
||||
1
common/test/data/graphic_slider_tool/course.xml
Symbolic link
1
common/test/data/graphic_slider_tool/course.xml
Symbolic link
@@ -0,0 +1 @@
|
||||
roots/2012_Fall.xml
|
||||
@@ -0,0 +1,5 @@
|
||||
<course>
|
||||
<chapter url_name="Overview">
|
||||
<gst url_name="sample_gst"/>
|
||||
</chapter>
|
||||
</course>
|
||||
41
common/test/data/graphic_slider_tool/gst/sample_gst.xml
Normal file
41
common/test/data/graphic_slider_tool/gst/sample_gst.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<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;"/>
|
||||
</render>
|
||||
<configuration>
|
||||
<parameters>
|
||||
<param var="a" min="5" max="25" step="0.5" initial="12.5" />
|
||||
</parameters>
|
||||
<functions>
|
||||
<function color="red">return Math.sqrt(a * a - x * x);</function>
|
||||
<function color="red">return -Math.sqrt(a * a - x * x);</function>
|
||||
</functions>
|
||||
<plot>
|
||||
<xrange>
|
||||
<!-- dynamic range -->
|
||||
<min>
|
||||
return -a;
|
||||
</min>
|
||||
<max>
|
||||
return a;
|
||||
</max>
|
||||
</xrange>
|
||||
<num_points>1000</num_points>
|
||||
<xticks>-30, 6, 30</xticks>
|
||||
<yticks>-30, 6, 30</yticks>
|
||||
</plot>
|
||||
</configuration>
|
||||
</graphical_slider_tool>
|
||||
</vertical>
|
||||
14
common/test/data/graphic_slider_tool/policies/2012_Fall.json
Normal file
14
common/test/data/graphic_slider_tool/policies/2012_Fall.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"course/2012_Fall": {
|
||||
"graceperiod": "2 days 5 hours 59 minutes 59 seconds",
|
||||
"start": "2015-07-17T12:00",
|
||||
"display_name": "GST Test",
|
||||
"graded": "false"
|
||||
},
|
||||
"chapter/Overview": {
|
||||
"display_name": "Overview"
|
||||
},
|
||||
"gst/sample_gst": {
|
||||
"display_name": "Sample GST",
|
||||
},
|
||||
}
|
||||
1
common/test/data/graphic_slider_tool/roots/2012_Fall.xml
Normal file
1
common/test/data/graphic_slider_tool/roots/2012_Fall.xml
Normal file
@@ -0,0 +1 @@
|
||||
<course org="edX" course="gst_test" url_name="2012_Fall"/>
|
||||
@@ -1 +0,0 @@
|
||||
roots/2012_Fall.xml
|
||||
1
common/test/data/self_assessment/course.xml
Normal file
1
common/test/data/self_assessment/course.xml
Normal file
@@ -0,0 +1 @@
|
||||
<course org="edX" course="sa_test" url_name="2012_Fall"/>
|
||||
Reference in New Issue
Block a user