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
c9ddcd78
Commit
c9ddcd78
authored
Jul 19, 2013
by
Vik Paruchuri
Committed by
Vik Paruchuri
Aug 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some pep8 violations
parent
62c7255a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
20 deletions
+32
-20
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
+19
-12
common/lib/xmodule/xmodule/peer_grading_module.py
+13
-8
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
View file @
c9ddcd78
...
...
@@ -36,13 +36,18 @@ class PeerGradingService(GradingService):
return
self
.
try_to_decode
(
response
)
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
response
=
self
.
get
(
self
.
get_next_submission_url
,
{
'location'
:
problem_location
,
'grader_id'
:
grader_id
})
response
=
self
.
get
(
self
.
get_next_submission_url
,
{
'location'
:
problem_location
,
'grader_id'
:
grader_id
}
)
return
self
.
try_to_decode
(
self
.
_render_rubric
(
response
))
def
save_grade
(
self
,
**
kwargs
):
data
=
kwargs
data
.
update
({
'rubric_scores_complete'
:
True
})
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
):
...
...
@@ -56,7 +61,7 @@ class PeerGradingService(GradingService):
def
save_calibration_essay
(
self
,
**
kwargs
):
data
=
kwargs
data
.
update
({
'rubric_scores_complete'
:
True
})
data
.
update
({
'rubric_scores_complete'
:
True
})
return
self
.
try_to_decode
(
self
.
post
(
self
.
save_calibration_essay_url
,
data
))
def
get_problem_list
(
self
,
course_id
,
grader_id
):
...
...
@@ -85,15 +90,17 @@ without making actual service calls to the grading controller
class
MockPeerGradingService
(
object
):
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
return
{
'success'
:
True
,
'submission_id'
:
1
,
'submission_key'
:
""
,
'student_response'
:
'fake student response'
,
'prompt'
:
'fake submission prompt'
,
'rubric'
:
'fake rubric'
,
'max_score'
:
4
}
return
{
'success'
:
True
,
'submission_id'
:
1
,
'submission_key'
:
""
,
'student_response'
:
'fake student response'
,
'prompt'
:
'fake submission prompt'
,
'rubric'
:
'fake rubric'
,
'max_score'
:
4
}
def
save_grade
(
self
,
**
kwargs
):
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 @
c9ddcd78
...
...
@@ -23,6 +23,7 @@ log = logging.getLogger(__name__)
EXTERNAL_GRADER_NO_CONTACT_ERROR
=
"Failed to contact external graders. Please notify course staff."
class
PeerGradingFields
(
object
):
use_for_single_location
=
Boolean
(
display_name
=
"Show Single Problem"
,
...
...
@@ -68,9 +69,11 @@ class PeerGradingFields(object):
scope
=
Scope
.
settings
,
default
=
"Peer Grading Interface"
)
data
=
String
(
help
=
"Html contents to display for this module"
,
data
=
String
(
help
=
"Html contents to display for this module"
,
default
=
'<peergrading></peergrading>'
,
scope
=
Scope
.
content
)
scope
=
Scope
.
content
)
class
PeerGradingModule
(
PeerGradingFields
,
XModule
):
...
...
@@ -79,11 +82,14 @@ class PeerGradingModule(PeerGradingFields, XModule):
"""
_VERSION
=
1
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/peergrading/peer_grading.coffee'
),
resource_string
(
__name__
,
'js/src/peergrading/peer_grading_problem.coffee'
),
resource_string
(
__name__
,
'js/src/collapsible.coffee'
),
resource_string
(
__name__
,
'js/src/javascript_loader.coffee'
),
]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/peergrading/peer_grading.coffee'
),
resource_string
(
__name__
,
'js/src/peergrading/peer_grading_problem.coffee'
),
resource_string
(
__name__
,
'js/src/collapsible.coffee'
),
resource_string
(
__name__
,
'js/src/javascript_loader.coffee'
),
]
}
js_module_name
=
"PeerGrading"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/combinedopenended/display.scss'
)]}
...
...
@@ -134,7 +140,6 @@ class PeerGradingModule(PeerGradingFields, XModule):
return
True
return
False
def
_err_response
(
self
,
msg
):
"""
Return a HttpResponse with a json dump with success=False, and the given error message.
...
...
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