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
31641252
Commit
31641252
authored
Jul 25, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typos in and some additional comments
parent
43cd2c21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
common/lib/capa/capa/responsetypes.py
+4
-3
No files found.
common/lib/capa/capa/responsetypes.py
View file @
31641252
...
@@ -789,6 +789,8 @@ class CodeResponse(LoncapaResponse):
...
@@ -789,6 +789,8 @@ class CodeResponse(LoncapaResponse):
In contrast to ExternalResponse, CodeResponse has following behavior:
In contrast to ExternalResponse, CodeResponse has following behavior:
1) Goes through a queueing system
1) Goes through a queueing system
2) Does not do external request for 'get_answers'
2) Does not do external request for 'get_answers'
The XML definition of a CodeResponse is meant to be identical to that of ExternalResponse. Simply replace the
tag 'externalresponse' with 'coderesponse'
'''
'''
response_tag
=
'coderesponse'
response_tag
=
'coderesponse'
...
@@ -797,7 +799,7 @@ class CodeResponse(LoncapaResponse):
...
@@ -797,7 +799,7 @@ class CodeResponse(LoncapaResponse):
def
setup_response
(
self
):
def
setup_response
(
self
):
xml
=
self
.
xml
xml
=
self
.
xml
self
.
url
=
xml
.
get
(
'url'
,
"http://ec2-50-1
6-59-149
.compute-1.amazonaws.com/xqueue/submit/"
)
# FIXME -- hardcoded url
self
.
url
=
xml
.
get
(
'url'
,
"http://ec2-50-1
7-86-200
.compute-1.amazonaws.com/xqueue/submit/"
)
# FIXME -- hardcoded url
answer
=
xml
.
find
(
'answer'
)
answer
=
xml
.
find
(
'answer'
)
if
answer
is
not
None
:
if
answer
is
not
None
:
...
@@ -859,7 +861,6 @@ class CodeResponse(LoncapaResponse):
...
@@ -859,7 +861,6 @@ class CodeResponse(LoncapaResponse):
msg
=
'Error in CodeResponse
%
s: cannot parse response from xworker r.text=
%
s'
%
(
err
,
score_msg
)
msg
=
'Error in CodeResponse
%
s: cannot parse response from xworker r.text=
%
s'
%
(
err
,
score_msg
)
raise
Exception
(
err
)
raise
Exception
(
err
)
# The following process is lifted directly from ExternalResponse
ad
=
rxml
.
find
(
'awarddetail'
)
.
text
ad
=
rxml
.
find
(
'awarddetail'
)
.
text
admap
=
{
'EXACT_ANS'
:
'correct'
,
# TODO: handle other loncapa responses
admap
=
{
'EXACT_ANS'
:
'correct'
,
# TODO: handle other loncapa responses
'WRONG_FORMAT'
:
'incorrect'
,
'WRONG_FORMAT'
:
'incorrect'
,
...
@@ -1020,7 +1021,7 @@ main()
...
@@ -1020,7 +1021,7 @@ main()
raise
Exception
(
'Error: no response from external server url=
%
s'
%
self
.
url
)
raise
Exception
(
'Error: no response from external server url=
%
s'
%
self
.
url
)
try
:
try
:
rxml
=
etree
.
fromstring
(
r
.
text
)
# response is XML; p
ra
se it
rxml
=
etree
.
fromstring
(
r
.
text
)
# response is XML; p
ar
se it
except
Exception
as
err
:
except
Exception
as
err
:
msg
=
'Error
%
s - cannot parse response from external server r.text=
%
s'
%
(
err
,
r
.
text
)
msg
=
'Error
%
s - cannot parse response from external server r.text=
%
s'
%
(
err
,
r
.
text
)
log
.
error
(
msg
)
log
.
error
(
msg
)
...
...
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