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
dadb128b
Commit
dadb128b
authored
Jul 12, 2013
by
Vik Paruchuri
Committed by
Vik Paruchuri
Aug 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify save_grade and pass through answer_unknown
parent
67d1e559
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
29 deletions
+12
-29
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
+4
-13
common/lib/xmodule/xmodule/peer_grading_module.py
+7
-16
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+1
-0
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
View file @
dadb128b
...
...
@@ -40,17 +40,9 @@ class PeerGradingService(GradingService):
{
'location'
:
problem_location
,
'grader_id'
:
grader_id
})
return
self
.
try_to_decode
(
self
.
_render_rubric
(
response
))
def
save_grade
(
self
,
location
,
grader_id
,
submission_id
,
score
,
feedback
,
submission_key
,
rubric_scores
,
submission_flagged
):
data
=
{
'grader_id'
:
grader_id
,
'submission_id'
:
submission_id
,
'score'
:
score
,
'feedback'
:
feedback
,
'submission_key'
:
submission_key
,
'location'
:
location
,
'rubric_scores'
:
rubric_scores
,
'rubric_scores_complete'
:
True
,
'submission_flagged'
:
submission_flagged
}
def
save_grade
(
self
,
**
kwargs
):
data
=
kwargs
data
.
update
({
'rubric_scores_complete'
:
True
})
return
self
.
try_to_decode
(
self
.
post
(
self
.
save_grade_url
,
data
))
def
is_student_calibrated
(
self
,
problem_location
,
grader_id
):
...
...
@@ -108,8 +100,7 @@ class MockPeerGradingService(object):
'rubric'
:
'fake rubric'
,
'max_score'
:
4
}
def
save_grade
(
self
,
location
,
grader_id
,
submission_id
,
score
,
feedback
,
submission_key
,
rubric_scores
,
submission_flagged
):
def
save_grade
(
self
,
**
kwargs
):
return
{
'success'
:
True
}
def
is_student_calibrated
(
self
,
problem_location
,
grader_id
):
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
dadb128b
...
...
@@ -308,31 +308,22 @@ class PeerGradingModule(PeerGradingFields, XModule):
error: if there was an error in the submission, this is the error message
"""
required
=
set
([
'location'
,
'submission_id'
,
'submission_key'
,
'score'
,
'feedback'
,
'rubric_scores[]'
,
'submission_flagged'
])
required
=
set
([
'location'
,
'submission_id'
,
'submission_key'
,
'score'
,
'feedback'
,
'rubric_scores[]'
,
'submission_flagged'
,
'answer_unknown'
])
success
,
message
=
self
.
_check_required
(
data
,
required
)
if
not
success
:
return
self
.
_err_response
(
message
)
grader_id
=
self
.
system
.
anonymous_student_id
location
=
data
.
get
(
'location'
)
submission_id
=
data
.
get
(
'submission_id'
)
score
=
data
.
get
(
'score'
)
feedback
=
data
.
get
(
'feedback'
)
submission_key
=
data
.
get
(
'submission_key'
)
rubric_scores
=
data
.
getlist
(
'rubric_scores[]'
)
submission_flagged
=
data
.
get
(
'submission_flagged'
)
data_dict
=
{
k
:
data
.
get
(
k
)
for
k
in
required
}
data_dict
[
'rubric_scores'
]
=
data_dict
[
'rubric_scores[]'
]
data_dict
[
'grader_id'
]
=
self
.
system
.
anonymous_student_id
try
:
response
=
self
.
peer_gs
.
save_grade
(
location
,
grader_id
,
submission_id
,
score
,
feedback
,
submission_key
,
rubric_scores
,
submission_flagged
)
response
=
self
.
peer_gs
.
save_grade
(
**
data_dict
)
return
response
except
GradingServiceError
:
# This is a dev_facing_error
log
.
exception
(
"""Error saving grade to open ended grading service. server url: {0}, location: {1}, submission_id:{2},
submission_key: {3}, score: {4}"""
.
format
(
self
.
peer_gs
.
url
,
location
,
submission_id
,
submission_key
,
score
)
log
.
exception
(
"""Error saving grade to open ended grading service. server url: {0}"""
.
format
(
self
.
peer_gs
.
url
)
)
# This is a student_facing_error
return
{
...
...
common/lib/xmodule/xmodule/tests/test_peer_grading.py
View file @
dadb128b
...
...
@@ -28,6 +28,7 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
'feedback'
:
""
,
'rubric_scores[]'
:
[
0
,
1
],
'submission_flagged'
:
False
,
'answer_unknown'
:
False
,
})
def
setUp
(
self
):
...
...
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