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
af6123a1
Commit
af6123a1
authored
Feb 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in methods to query data from the controller for student grading
parent
4c5e59e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
common/lib/xmodule/xmodule/peer_grading_module.py
+33
-4
common/lib/xmodule/xmodule/peer_grading_service.py
+1
-1
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
af6123a1
...
@@ -135,12 +135,42 @@ class PeerGradingModule(XModule):
...
@@ -135,12 +135,42 @@ class PeerGradingModule(XModule):
return
json
.
dumps
(
d
,
cls
=
ComplexEncoder
)
return
json
.
dumps
(
d
,
cls
=
ComplexEncoder
)
def
query_data_for_location
(
self
):
student_id
=
self
.
system
.
anonymous_student_id
location
=
self
.
system
.
location
success
=
False
response
=
{}
try
:
response
=
self
.
peer_gs
.
get_data_for_location
(
location
,
grader_id
)
count_graded
=
response
[
'count_graded'
]
count_required
=
response
[
'count_required'
]
success
=
True
except
GradingServiceError
:
log
.
exception
(
"Error getting location data from controller for location {0}, student {1}"
.
format
(
location
,
student_id
))
return
success
,
response
def
get_progress
(
self
):
def
get_progress
(
self
):
pass
pass
def
get_score
(
self
):
def
get_score
(
self
):
pass
if
not
self
.
use_for_single_location
:
return
None
try
:
count_graded
=
self
.
student_data_for_location
[
'count_graded'
]
count_required
=
self
.
student_data_for_location
[
'count_required'
]
except
:
success
,
response
=
self
.
query_data_for_location
()
if
not
success
:
log
.
exception
(
"No instance data found and could not get data from controller for loc {0} student {1}"
.
format
(
self
.
system
.
location
,
self
.
system
.
anonymous_student_id
))
return
None
def
max_score
(
self
):
def
max_score
(
self
):
''' Maximum score. Two notes:
''' Maximum score. Two notes:
...
@@ -148,9 +178,8 @@ class PeerGradingModule(XModule):
...
@@ -148,9 +178,8 @@ class PeerGradingModule(XModule):
randomization, and 5/7 on another
randomization, and 5/7 on another
'''
'''
max_score
=
None
max_score
=
None
if
self
.
check_if_done_and_scored
():
if
self
.
use_for_single_location
:
last_response
=
self
.
get_last_response
(
self
.
current_task_number
)
max_score
=
self
.
max_score
max_score
=
last_response
[
'max_score'
]
return
max_score
return
max_score
def
get_next_submission
(
self
,
get
):
def
get_next_submission
(
self
,
get
):
...
...
common/lib/xmodule/xmodule/peer_grading_service.py
View file @
af6123a1
...
@@ -38,7 +38,7 @@ class PeerGradingService():
...
@@ -38,7 +38,7 @@ class PeerGradingService():
def
get_data_for_location
(
self
,
problem_location
,
student_id
):
def
get_data_for_location
(
self
,
problem_location
,
student_id
):
response
=
self
.
get
(
self
.
get_data_for_location_url
,
response
=
self
.
get
(
self
.
get_data_for_location_url
,
{
'location'
:
problem_location
,
'student_id'
:
student_id
})
{
'location'
:
problem_location
,
'student_id'
:
student_id
})
return
self
.
_render_rubric
(
response
)
return
response
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
response
=
self
.
get
(
self
.
get_next_submission_url
,
response
=
self
.
get
(
self
.
get_next_submission_url
,
...
...
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