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
f9e97cb9
Commit
f9e97cb9
authored
May 09, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for proper saving
parent
7a1ef62e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
8 deletions
+34
-8
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+5
-0
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+23
-2
common/lib/xmodule/xmodule/tests/test_util_open_ended.py
+4
-4
common/test/data/open_ended/peergrading/PeerGradingScored.xml
+2
-2
No files found.
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
f9e97cb9
...
...
@@ -496,6 +496,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
self
.
test_system
.
xqueue
[
'interface'
]
=
Mock
(
send_to_queue
=
Mock
(
side_effect
=
[
1
,
"queued"
])
)
self
.
setup_modulestore
(
COURSE
)
def
test_open_ended_load_and_save
(
self
):
"""
...
...
@@ -510,6 +511,10 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
self
.
assertEqual
(
task_one_json
[
'child_history'
][
0
][
'answer'
],
self
.
answer
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
self
.
assertEqual
(
task_one_json
[
'child_history'
][
0
][
'answer'
],
self
.
answer
)
def
test_open_ended_flow_reset
(
self
):
"""
Test the flow of the module if we complete the self assessment step and then reset
...
...
common/lib/xmodule/xmodule/tests/test_peer_grading.py
View file @
f9e97cb9
...
...
@@ -40,6 +40,7 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
"""
self
.
test_system
=
test_system
()
self
.
test_system
.
open_ended_grading_interface
=
None
self
.
setup_modulestore
(
COURSE
)
self
.
peer_grading
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
def
test_module_closed
(
self
):
...
...
@@ -129,4 +130,24 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
Get the instance state dict
@return:
"""
self
.
peer_grading
.
get_instance_state
()
\ No newline at end of file
self
.
peer_grading
.
get_instance_state
()
class
PeerGradingModuleScoredTest
(
unittest
.
TestCase
,
DummyModulestore
):
"""
Test peer grading xmodule at the unit level. More detailed tests are difficult, as the module relies on an
external grading service.
"""
problem_location
=
Location
([
"i4x"
,
"edX"
,
"open_ended"
,
"peergrading"
,
"PeerGradingScored"
])
def
setUp
(
self
):
"""
Create a peer grading module from a test system
@return:
"""
self
.
test_system
=
test_system
()
self
.
test_system
.
open_ended_grading_interface
=
None
self
.
setup_modulestore
(
COURSE
)
def
test_metadata_load
(
self
):
peer_grading
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
self
.
assertEqual
(
peer_grading
.
closed
(),
False
)
\ No newline at end of file
common/lib/xmodule/xmodule/tests/test_util_open_ended.py
View file @
f9e97cb9
...
...
@@ -38,12 +38,12 @@ class DummyModulestore(object):
"""
test_system
=
test_system
()
def
setup_modulestore
(
self
,
name
):
self
.
modulestore
=
XMLModuleStore
(
DATA_DIR
,
course_dirs
=
[
name
])
def
get_course
(
self
,
name
):
"""Get a test course by directory name. If there's more than one, error."""
modulestore
=
XMLModuleStore
(
DATA_DIR
,
course_dirs
=
[
name
])
courses
=
modulestore
.
get_courses
()
self
.
modulestore
=
modulestore
courses
=
self
.
modulestore
.
get_courses
()
return
courses
[
0
]
def
get_module_from_location
(
self
,
location
,
course
):
...
...
common/test/data/open_ended/peergrading/PeerGradingScored.xml
View file @
f9e97cb9
<peergrading
is_graded=
"True"
max_grade=
"1"
use_for_single_location=
"True"
link_to_location=
"i4x://edX/open_ended/combinedopenended/SampleQuestion"
/>
\ No newline at end of file
<peergrading
is_graded=
"True"
max_grade=
"1"
use_for_single_location=
"False"
link_to_location=
"i4x://edX/open_ended/combinedopenended/SampleQuestion"
/>
\ 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