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
ed6a8f68
Commit
ed6a8f68
authored
Nov 19, 2012
by
Victor Shnayder
Committed by
Victor Shnayder
Nov 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting to stub out the backend staff grading service [wip]
parent
9d8d6655
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
lms/djangoapps/instructor/staff_grading_service.py
+57
-0
lms/urls.py
+4
-0
No files found.
lms/djangoapps/instructor/staff_grading_service.py
0 → 100644
View file @
ed6a8f68
"""
This module provides views that proxy to the staff grading backend service.
"""
import
json
import
requests
import
sys
from
django.http
import
Http404
from
django.http
import
HttpResponse
from
util.json_request
import
expect_json
class
GradingServiceError
(
Exception
):
pass
class
StaffGradingService
(
object
):
"""
Interface to staff grading backend.
"""
def
__init__
(
self
,
url
):
self
.
url
=
url
# TODO: add auth
self
.
session
=
requests
.
session
()
def
get_next
(
course_id
):
"""
Get the next thing to grade. Returns json, or raises GradingServiceError
if there's a problem.
"""
try
:
r
=
self
.
session
.
get
(
url
+
'get_next'
)
except
requests
.
exceptions
.
ConnectionError
as
err
:
# reraise as promised GradingServiceError, but preserve stacktrace.
raise
GradingServiceError
,
str
(
err
),
sys
.
exc_info
()[
2
]
return
r
.
text
#@login_required
def
get_next
(
request
,
course_id
):
"""
"""
d
=
{
'success'
:
False
}
return
HttpResponse
(
json
.
dumps
(
d
))
#@login_required
@expect_json
def
save_grade
(
request
,
course_id
):
"""
"""
d
=
{
'success'
:
False
}
return
HttpResponse
(
json
.
dumps
(
d
))
lms/urls.py
View file @
ed6a8f68
...
@@ -232,6 +232,10 @@ if settings.COURSEWARE_ENABLED:
...
@@ -232,6 +232,10 @@ if settings.COURSEWARE_ENABLED:
'instructor.views.enroll_students'
,
name
=
'enroll_students'
),
'instructor.views.enroll_students'
,
name
=
'enroll_students'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading$'
,
'instructor.views.staff_grading'
,
name
=
'staff_grading'
),
'instructor.views.staff_grading'
,
name
=
'staff_grading'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/get_next$'
,
'instructor.staff_grading_service.get_next'
,
name
=
'staff_grading_get_next'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/save_grade$'
,
'instructor.staff_grading_service.save_grade'
,
name
=
'staff_grading_save_grade'
),
)
)
# discussion forums live within courseware, so courseware must be enabled first
# discussion forums live within courseware, so courseware must be enabled first
...
...
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