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
e7f8c7c6
Commit
e7f8c7c6
authored
Mar 19, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8 fixes
parent
39aa25c2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
lms/djangoapps/courseware/features/mock_xqueue_server.py
+3
-2
lms/djangoapps/courseware/features/problems.feature
+0
-0
lms/djangoapps/courseware/features/problems.py
+2
-1
lms/djangoapps/courseware/features/xqueue_setup.py
+2
-0
No files found.
lms/djangoapps/courseware/features/mock_xqueue_server.py
View file @
e7f8c7c6
...
@@ -7,6 +7,7 @@ import time
...
@@ -7,6 +7,7 @@ import time
from
logging
import
getLogger
from
logging
import
getLogger
logger
=
getLogger
(
__name__
)
logger
=
getLogger
(
__name__
)
class
MockXQueueRequestHandler
(
BaseHTTPRequestHandler
):
class
MockXQueueRequestHandler
(
BaseHTTPRequestHandler
):
'''
'''
A handler for XQueue POST requests.
A handler for XQueue POST requests.
...
@@ -167,7 +168,7 @@ class MockXQueueServer(HTTPServer):
...
@@ -167,7 +168,7 @@ class MockXQueueServer(HTTPServer):
'''
'''
def
__init__
(
self
,
port_num
,
def
__init__
(
self
,
port_num
,
grade_response_dict
=
{
'correct'
:
True
,
'score'
:
1
,
'msg'
:
''
}):
grade_response_dict
=
{
'correct'
:
True
,
'score'
:
1
,
'msg'
:
''
}):
'''
'''
Initialize the mock XQueue server instance.
Initialize the mock XQueue server instance.
...
@@ -273,6 +274,6 @@ class MockXQueueServerTest(unittest.TestCase):
...
@@ -273,6 +274,6 @@ class MockXQueueServerTest(unittest.TestCase):
xqueue_body
=
json
.
dumps
({
'correct'
:
True
,
'score'
:
1
,
xqueue_body
=
json
.
dumps
({
'correct'
:
True
,
'score'
:
1
,
'msg'
:
'<div></div>'
})
'msg'
:
'<div></div>'
})
expected_callback_dict
=
{
'xqueue_header'
:
grade_header
,
expected_callback_dict
=
{
'xqueue_header'
:
grade_header
,
'xqueue_body'
:
xqueue_body
}
'xqueue_body'
:
xqueue_body
}
MockXQueueRequestHandler
.
post_to_url
.
assert_called_with
(
callback_url
,
MockXQueueRequestHandler
.
post_to_url
.
assert_called_with
(
callback_url
,
expected_callback_dict
)
expected_callback_dict
)
lms/djangoapps/courseware/features/problems.feature
View file @
e7f8c7c6
lms/djangoapps/courseware/features/problems.py
View file @
e7f8c7c6
...
@@ -80,7 +80,7 @@ PROBLEM_FACTORY_DICT = {
...
@@ -80,7 +80,7 @@ PROBLEM_FACTORY_DICT = {
a1=0
a1=0
a2=0
a2=0
return (a1+a2)==int(expect)
return (a1+a2)==int(expect)
"""
)
}},
"""
)}},
'code'
:
{
'code'
:
{
'factory'
:
CodeResponseXMLFactory
(),
'factory'
:
CodeResponseXMLFactory
(),
'kwargs'
:
{
'kwargs'
:
{
...
@@ -124,6 +124,7 @@ def view_problem(step, problem_type):
...
@@ -124,6 +124,7 @@ def view_problem(step, problem_type):
world
.
browser
.
visit
(
url
)
world
.
browser
.
visit
(
url
)
@step
(
u'External graders respond "([^"]*)"'
)
@step
(
u'External graders respond "([^"]*)"'
)
def
set_external_grader_response
(
step
,
correctness
):
def
set_external_grader_response
(
step
,
correctness
):
assert
(
correctness
in
[
'correct'
,
'incorrect'
])
assert
(
correctness
in
[
'correct'
,
'incorrect'
])
...
...
lms/djangoapps/courseware/features/xqueue_setup.py
View file @
e7f8c7c6
...
@@ -3,6 +3,7 @@ from lettuce import before, after, world
...
@@ -3,6 +3,7 @@ from lettuce import before, after, world
from
django.conf
import
settings
from
django.conf
import
settings
import
threading
import
threading
@before.all
@before.all
def
setup_mock_xqueue_server
():
def
setup_mock_xqueue_server
():
...
@@ -24,6 +25,7 @@ def setup_mock_xqueue_server():
...
@@ -24,6 +25,7 @@ def setup_mock_xqueue_server():
# (and we can shut it down later)
# (and we can shut it down later)
world
.
xqueue_server
=
server
world
.
xqueue_server
=
server
@after.all
@after.all
def
teardown_mock_xqueue_server
(
total
):
def
teardown_mock_xqueue_server
(
total
):
...
...
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