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
4ccf7c35
Commit
4ccf7c35
authored
Dec 07, 2012
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix service errors so that individual problems can now be displayed
and graded
parent
7f9fcfff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
lms/djangoapps/instructor/staff_grading_service.py
+9
-8
No files found.
lms/djangoapps/instructor/staff_grading_service.py
View file @
4ccf7c35
...
...
@@ -89,7 +89,6 @@ class StaffGradingService(object):
Returns the result of operation(). Does not catch exceptions.
"""
response
=
operation
()
log
.
debug
(
"first response: {0}"
.
format
(
response
.
status_code
))
if
(
response
.
status_code
==
302
):
# apparrently we aren't logged in. Try to fix that.
r
=
self
.
_login
()
...
...
@@ -123,7 +122,6 @@ class StaffGradingService(object):
'grader_id'
:
grader_id
})
try
:
r
=
self
.
_try_with_login
(
op
)
log
.
debug
(
r
.
text
)
except
(
RequestException
,
ConnectionError
,
HTTPError
)
as
err
:
# reraise as promised GradingServiceError, but preserve stacktrace.
raise
GradingServiceError
,
str
(
err
),
sys
.
exc_info
()[
2
]
...
...
@@ -255,18 +253,19 @@ def get_next(request, course_id):
"""
_check_access
(
request
.
user
,
course_id
)
required
=
set
(
'location'
)
required
=
set
(
[
'location'
]
)
if
request
.
method
!=
'POST'
:
raise
Http404
actual
=
set
(
request
.
POST
.
keys
())
missing
=
required
-
actual
if
len
(
missing
)
!=
0
:
if
len
(
missing
)
>
0
:
return
_err_response
(
'Missing required keys {0}'
.
format
(
', '
.
join
(
missing
)))
grader_id
=
request
.
user
.
id
p
=
request
.
POST
location
=
p
[
'location'
]
return
HttpResponse
(
_get_next
(
course_id
,
request
.
user
.
id
,
p
.
location
),
return
HttpResponse
(
_get_next
(
course_id
,
request
.
user
.
id
,
location
),
mimetype
=
"application/json"
)
...
...
@@ -319,15 +318,17 @@ def save_grade(request, course_id):
if
request
.
method
!=
'POST'
:
raise
Http404
required
=
set
(
'score'
,
'feedback'
,
'submission_id'
)
required
=
set
(
[
'score'
,
'feedback'
,
'submission_id'
,
'location'
]
)
actual
=
set
(
request
.
POST
.
keys
())
log
.
debug
(
actual
)
missing
=
required
-
actual
if
len
(
missing
)
!=
0
:
if
len
(
missing
)
>
0
:
return
_err_response
(
'Missing required keys {0}'
.
format
(
', '
.
join
(
missing
)))
grader_id
=
request
.
user
.
id
p
=
request
.
POST
location
=
p
[
'location'
]
try
:
result_json
=
grading_service
()
.
save_grade
(
course_id
,
...
...
@@ -350,6 +351,6 @@ def save_grade(request, course_id):
return
_err_response
(
'Grading service failed'
)
# Ok, save_grade seemed to work. Get the next submission to grade.
return
HttpResponse
(
_get_next
(
course_id
,
grader_id
),
return
HttpResponse
(
_get_next
(
course_id
,
grader_id
,
location
),
mimetype
=
"application/json"
)
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