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
4db78853
Commit
4db78853
authored
Feb 27, 2014
by
Waheed Ahmed
Committed by
Adam Palay
Feb 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Students not receiving credit for peer assessment.
ORA-330
parent
1fe453a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
5 deletions
+59
-5
common/lib/xmodule/xmodule/peer_grading_module.py
+4
-1
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+55
-4
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
4db78853
...
@@ -255,7 +255,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -255,7 +255,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
count_graded
=
self
.
student_data_for_location
[
'count_graded'
]
count_graded
=
self
.
student_data_for_location
[
'count_graded'
]
count_required
=
self
.
student_data_for_location
[
'count_required'
]
count_required
=
self
.
student_data_for_location
[
'count_required'
]
except
:
except
:
success
,
response
=
self
.
query_data_for_location
(
self
.
location
)
success
,
response
=
self
.
query_data_for_location
(
self
.
l
ink_to_l
ocation
)
if
not
success
:
if
not
success
:
log
.
exception
(
log
.
exception
(
"No instance data found and could not get data from controller for loc {0} student {1}"
.
format
(
"No instance data found and could not get data from controller for loc {0} student {1}"
.
format
(
...
@@ -706,6 +706,7 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
...
@@ -706,6 +706,7 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
closed
=
module_attr
(
'closed'
)
closed
=
module_attr
(
'closed'
)
get_instance_state
=
module_attr
(
'get_instance_state'
)
get_instance_state
=
module_attr
(
'get_instance_state'
)
get_next_submission
=
module_attr
(
'get_next_submission'
)
get_next_submission
=
module_attr
(
'get_next_submission'
)
graded
=
module_attr
(
'graded'
)
is_student_calibrated
=
module_attr
(
'is_student_calibrated'
)
is_student_calibrated
=
module_attr
(
'is_student_calibrated'
)
peer_grading
=
module_attr
(
'peer_grading'
)
peer_grading
=
module_attr
(
'peer_grading'
)
peer_grading_closed
=
module_attr
(
'peer_grading_closed'
)
peer_grading_closed
=
module_attr
(
'peer_grading_closed'
)
...
@@ -715,4 +716,6 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
...
@@ -715,4 +716,6 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
save_calibration_essay
=
module_attr
(
'save_calibration_essay'
)
save_calibration_essay
=
module_attr
(
'save_calibration_essay'
)
save_grade
=
module_attr
(
'save_grade'
)
save_grade
=
module_attr
(
'save_grade'
)
show_calibration_essay
=
module_attr
(
'show_calibration_essay'
)
show_calibration_essay
=
module_attr
(
'show_calibration_essay'
)
use_for_single_location_local
=
module_attr
(
'use_for_single_location_local'
)
_find_corresponding_module_for_location
=
module_attr
(
'_find_corresponding_module_for_location'
)
_find_corresponding_module_for_location
=
module_attr
(
'_find_corresponding_module_for_location'
)
common/lib/xmodule/xmodule/tests/test_peer_grading.py
View file @
4db78853
import
unittest
import
unittest
import
json
import
json
import
logging
import
logging
from
mock
import
Mock
from
mock
import
Mock
,
patch
from
webob.multidict
import
MultiDict
from
webob.multidict
import
MultiDict
from
xblock.field_data
import
DictFieldData
from
xblock.field_data
import
DictFieldData
...
@@ -78,12 +78,13 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
...
@@ -78,12 +78,13 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
success
,
_data
=
self
.
peer_grading
.
query_data_for_location
(
self
.
problem_location
.
url
())
success
,
_data
=
self
.
peer_grading
.
query_data_for_location
(
self
.
problem_location
.
url
())
self
.
assertTrue
(
success
)
self
.
assertTrue
(
success
)
def
test_get_score
(
self
):
def
test_get_score
_none
(
self
):
"""
"""
Test getting the score
Test getting the score.
@return:
"""
"""
score
=
self
.
peer_grading
.
get_score
()
score
=
self
.
peer_grading
.
get_score
()
# Score should be None.
self
.
assertIsNone
(
score
[
'score'
])
self
.
assertIsNone
(
score
[
'score'
])
def
test_get_max_score
(
self
):
def
test_get_max_score
(
self
):
...
@@ -179,6 +180,56 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
...
@@ -179,6 +180,56 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
)
)
)
)
def
test_get_score_success_fails
(
self
):
"""
Test if query_data_for_location not succeed, their score is None.
"""
score_dict
=
self
.
get_score
(
False
,
0
,
0
)
# Score dict should be None.
self
.
assertIsNone
(
score_dict
)
def
test_get_score
(
self
):
"""
Test if the student has graded equal to required submissions,
their score is 1.0.
"""
score_dict
=
self
.
get_score
(
True
,
3
,
3
)
# Score should be 1.0.
self
.
assertEqual
(
score_dict
[
"score"
],
1.0
)
# Testing score after data is stored in student_data_for_location in xmodule.
_score_dict
=
self
.
peer_grading
.
get_score
()
# Score should be 1.0.
self
.
assertEqual
(
_score_dict
[
"score"
],
1.0
)
def
test_get_score_zero
(
self
):
"""
Test if the student has graded not equal to required submissions,
their score is 0.0.
"""
score_dict
=
self
.
get_score
(
True
,
2
,
3
)
# Score should be 0.0.
self
.
assertEqual
(
score_dict
[
"score"
],
0.0
)
def
get_score
(
self
,
success
,
count_graded
,
count_required
):
self
.
peer_grading
.
use_for_single_location_local
=
True
self
.
peer_grading
.
graded
=
True
# Patch for external grading service.
with
patch
(
'xmodule.peer_grading_module.PeerGradingModule.query_data_for_location'
)
as
mock_query_data_for_location
:
mock_query_data_for_location
.
return_value
=
(
success
,
{
"count_graded"
:
count_graded
,
"count_required"
:
count_required
}
)
# Returning score dict.
return
self
.
peer_grading
.
get_score
()
class
MockPeerGradingServiceProblemList
(
MockPeerGradingService
):
class
MockPeerGradingServiceProblemList
(
MockPeerGradingService
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
...
...
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