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
71547e29
Commit
71547e29
authored
Nov 06, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for selfassessment import and export (both pass)
parent
b209018c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
common/lib/xmodule/xmodule/tests/test_export.py
+3
-0
common/lib/xmodule/xmodule/tests/test_import.py
+7
-1
common/test/data/self_assessment/course/2012_Fall.xml
+0
-1
common/test/data/self_assessment/html/Welcome.xml
+0
-7
common/test/data/self_assessment/selfassessment/SampleQuestion.xml
+2
-2
No files found.
common/lib/xmodule/xmodule/tests/test_export.py
View file @
71547e29
...
@@ -113,3 +113,6 @@ class RoundTripTestCase(unittest.TestCase):
...
@@ -113,3 +113,6 @@ class RoundTripTestCase(unittest.TestCase):
def
test_full_roundtrip
(
self
):
def
test_full_roundtrip
(
self
):
self
.
check_export_roundtrip
(
DATA_DIR
,
"full"
)
self
.
check_export_roundtrip
(
DATA_DIR
,
"full"
)
def
test_selfassessment_roundtrip
(
self
):
self
.
check_export_roundtrip
(
DATA_DIR
,
"self_assessment"
)
common/lib/xmodule/xmodule/tests/test_import.py
View file @
71547e29
...
@@ -312,9 +312,14 @@ class ImportTestCase(unittest.TestCase):
...
@@ -312,9 +312,14 @@ class ImportTestCase(unittest.TestCase):
self
.
assertRaises
(
etree
.
XMLSyntaxError
,
system
.
process_xml
,
bad_xml
)
self
.
assertRaises
(
etree
.
XMLSyntaxError
,
system
.
process_xml
,
bad_xml
)
def
test_selfassessment_import
_export
(
self
):
def
test_selfassessment_import
(
self
):
'''
'''
Check to see if definition_from_xml and definition_to_xml in self_assessment_module.py function.
Check to see if definition_from_xml and definition_to_xml in self_assessment_module.py function.
'''
'''
modulestore
=
XMLModuleStore
(
DATA_DIR
,
course_dirs
=
[
'self_assessment'
])
sa_id
=
"edX/sa_test/2012_Fall"
location
=
Location
([
"i4x"
,
"edX"
,
"sa_test"
,
"selfassessment"
,
"SampleQuestion"
])
sa_sample
=
modulestore
.
get_instance
(
sa_id
,
location
)
self
.
assertEqual
(
sa_sample
.
metadata
[
'attempts'
],
'10'
)
\ No newline at end of file
common/test/data/self_assessment/course/2012_Fall.xml
View file @
71547e29
<course>
<course>
<chapter
url_name=
"Overview"
>
<chapter
url_name=
"Overview"
>
<html
url_name=
"Welcome"
/>
<selfassessment
url_name=
"SampleQuestion"
/>
<selfassessment
url_name=
"SampleQuestion"
/>
</chapter>
</chapter>
</course>
</course>
common/test/data/self_assessment/html/Welcome.xml
deleted
100644 → 0
View file @
b209018c
<html>
<head>
</head>
<body>
Hello and welcome to the test course for self assessment.
</body>
</html>
common/test/data/self_assessment/selfassessment/SampleQuestion.xml
View file @
71547e29
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<submitmessage>
<submitmessage>
Thanks for your submission!
Thanks for your submission!
</submitmessage>
</submitmessage>
<hint
message
>
<hint
prompt
>
Enter a hint below:
Enter a hint below:
</hint
message
>
</hint
prompt
>
</selfassessment>
</selfassessment>
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