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
3a29d260
Commit
3a29d260
authored
Jan 10, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'diana/peer-grading-views' into diana/peer-grading-improvements
parents
393ee353
19bc6574
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
lms/djangoapps/open_ended_grading/staff_grading_service.py
+5
-4
lms/djangoapps/open_ended_grading/views.py
+2
-1
No files found.
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
3a29d260
...
@@ -16,6 +16,7 @@ from django.http import HttpResponse, Http404
...
@@ -16,6 +16,7 @@ from django.http import HttpResponse, Http404
from
courseware.access
import
has_access
from
courseware.access
import
has_access
from
util.json_request
import
expect_json
from
util.json_request
import
expect_json
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
student.models
import
unique_id_for_user
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -206,11 +207,11 @@ def get_next(request, course_id):
...
@@ -206,11 +207,11 @@ def get_next(request, course_id):
if
len
(
missing
)
>
0
:
if
len
(
missing
)
>
0
:
return
_err_response
(
'Missing required keys {0}'
.
format
(
return
_err_response
(
'Missing required keys {0}'
.
format
(
', '
.
join
(
missing
)))
', '
.
join
(
missing
)))
grader_id
=
request
.
user
.
id
grader_id
=
unique_id_for_user
(
request
.
user
)
p
=
request
.
POST
p
=
request
.
POST
location
=
p
[
'location'
]
location
=
p
[
'location'
]
return
HttpResponse
(
_get_next
(
course_id
,
request
.
user
.
id
,
location
),
return
HttpResponse
(
_get_next
(
course_id
,
grader_
id
,
location
),
mimetype
=
"application/json"
)
mimetype
=
"application/json"
)
...
@@ -238,7 +239,7 @@ def get_problem_list(request, course_id):
...
@@ -238,7 +239,7 @@ def get_problem_list(request, course_id):
"""
"""
_check_access
(
request
.
user
,
course_id
)
_check_access
(
request
.
user
,
course_id
)
try
:
try
:
response
=
staff_grading_service
()
.
get_problem_list
(
course_id
,
request
.
user
.
id
)
response
=
staff_grading_service
()
.
get_problem_list
(
course_id
,
unique_id_for_user
(
request
.
user
)
)
return
HttpResponse
(
response
,
return
HttpResponse
(
response
,
mimetype
=
"application/json"
)
mimetype
=
"application/json"
)
except
GradingServiceError
:
except
GradingServiceError
:
...
@@ -287,7 +288,7 @@ def save_grade(request, course_id):
...
@@ -287,7 +288,7 @@ def save_grade(request, course_id):
return
_err_response
(
'Missing required keys {0}'
.
format
(
return
_err_response
(
'Missing required keys {0}'
.
format
(
', '
.
join
(
missing
)))
', '
.
join
(
missing
)))
grader_id
=
request
.
user
.
id
grader_id
=
unique_id_for_user
(
request
.
user
)
p
=
request
.
POST
p
=
request
.
POST
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
3a29d260
...
@@ -21,6 +21,7 @@ from django_comment_client.models import Role, FORUM_ROLE_ADMINISTRATOR, FORUM_R
...
@@ -21,6 +21,7 @@ from django_comment_client.models import Role, FORUM_ROLE_ADMINISTRATOR, FORUM_R
from
django_comment_client.utils
import
has_forum_access
from
django_comment_client.utils
import
has_forum_access
from
psychometrics
import
psychoanalyze
from
psychometrics
import
psychoanalyze
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.models
import
unique_id_for_user
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
...
@@ -78,7 +79,7 @@ def peer_grading(request, course_id):
...
@@ -78,7 +79,7 @@ def peer_grading(request, course_id):
error_text
=
""
error_text
=
""
problem_list
=
[]
problem_list
=
[]
try
:
try
:
problem_list_text
=
peer_gs
.
get_problem_list
(
course_id
,
request
.
user
.
id
)
problem_list_text
=
peer_gs
.
get_problem_list
(
course_id
,
unique_id_for_user
(
request
.
user
)
)
problem_list_json
=
json
.
loads
(
problem_list_text
)
problem_list_json
=
json
.
loads
(
problem_list_text
)
success
=
problem_list_json
[
'success'
]
success
=
problem_list_json
[
'success'
]
if
'error'
in
problem_list_json
:
if
'error'
in
problem_list_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