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
4237df62
Commit
4237df62
authored
Feb 12, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in a check function to see if students are allowed to submit peer grading
parent
9ead4ebb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
+1
-0
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
+23
-0
common/lib/xmodule/xmodule/peer_grading_module.py
+1
-0
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
View file @
4237df62
...
...
@@ -73,6 +73,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
self
.
send_to_grader
(
self
.
latest_answer
(),
system
)
self
.
created
=
False
def
_parse
(
self
,
oeparam
,
prompt
,
rubric
,
system
):
'''
Parse OpenEndedResponse XML:
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
View file @
4237df62
...
...
@@ -22,6 +22,7 @@ from xmodule.stringify import stringify_children
from
xmodule.xml_module
import
XmlDescriptor
from
xmodule.modulestore
import
Location
from
capa.util
import
*
from
peer_grading_service
import
PeerGradingService
from
datetime
import
datetime
...
...
@@ -104,7 +105,9 @@ class OpenEndedChild(object):
# Used for progress / grading. Currently get credit just for
# completion (doesn't matter if you self-assessed correct/incorrect).
self
.
_max_score
=
static_data
[
'max_score'
]
self
.
peer_gs
=
PeerGradingService
(
system
.
open_ended_grading_interface
,
system
)
self
.
system
=
system
self
.
setup_response
(
system
,
location
,
definition
,
descriptor
)
def
setup_response
(
self
,
system
,
location
,
definition
,
descriptor
):
...
...
@@ -408,3 +411,23 @@ class OpenEndedChild(object):
success
=
True
return
success
,
string
def
check_if_student_can_submit
(
self
):
location
=
self
.
system
.
location
.
url
()
student_id
=
self
.
system
.
anonymous_student_id
success
=
False
response
=
{}
try
:
response
=
self
.
peer_gs
.
get_data_for_location
(
location
,
student_id
)
count_graded
=
response
[
'count_graded'
]
count_required
=
response
[
'count_required'
]
success
=
True
except
:
error_message
=
(
"Need to peer grade more in order to make another submission. "
"You have graded {0}, {1} are required."
)
.
format
(
count_graded
,
count_required
)
return
success
,
False
,
error_message
if
count_graded
>=
count_required
:
return
success
,
True
,
""
else
:
return
success
,
False
,
""
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
4237df62
...
...
@@ -155,6 +155,7 @@ class PeerGradingModule(XModule):
count_graded
=
response
[
'count_graded'
]
count_required
=
response
[
'count_required'
]
if
count_required
>
0
and
count_graded
>=
count_required
:
#Ensures that once a student receives a final score for peer grading, that it does not change.
self
.
student_data_for_location
=
response
score_dict
=
{
...
...
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