Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4db78853
Commit
4db78853
authored
11 years ago
by
Waheed Ahmed
Committed by
Adam Palay
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Students not receiving credit for peer assessment.
ORA-330
parent
1fe453a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/peer_grading_module.py
+4
-1
4 additions, 1 deletion
common/lib/xmodule/xmodule/peer_grading_module.py
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+55
-4
55 additions, 4 deletions
common/lib/xmodule/xmodule/tests/test_peer_grading.py
with
59 additions
and
5 deletions
common/lib/xmodule/xmodule/peer_grading_module.py
+
4
−
1
View file @
4db78853
...
...
@@ -255,7 +255,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
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
(
self
.
location
)
success
,
response
=
self
.
query_data_for_location
(
self
.
link_to_
location
)
if
not
success
:
log
.
exception
(
"
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):
closed
=
module_attr
(
'
closed
'
)
get_instance_state
=
module_attr
(
'
get_instance_state
'
)
get_next_submission
=
module_attr
(
'
get_next_submission
'
)
graded
=
module_attr
(
'
graded
'
)
is_student_calibrated
=
module_attr
(
'
is_student_calibrated
'
)
peer_grading
=
module_attr
(
'
peer_grading
'
)
peer_grading_closed
=
module_attr
(
'
peer_grading_closed
'
)
...
...
@@ -715,4 +716,6 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
save_calibration_essay
=
module_attr
(
'
save_calibration_essay
'
)
save_grade
=
module_attr
(
'
save_grade
'
)
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
'
)
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+
55
−
4
View file @
4db78853
import
unittest
import
json
import
logging
from
mock
import
Mock
from
mock
import
Mock
,
patch
from
webob.multidict
import
MultiDict
from
xblock.field_data
import
DictFieldData
...
...
@@ -78,12 +78,13 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
success
,
_data
=
self
.
peer_grading
.
query_data_for_location
(
self
.
problem_location
.
url
())
self
.
assertTrue
(
success
)
def
test_get_score
(
self
):
def
test_get_score
_none
(
self
):
"""
Test getting the score
@return:
Test getting the score.
"""
score
=
self
.
peer_grading
.
get_score
()
# Score should be None.
self
.
assertIsNone
(
score
[
'
score
'
])
def
test_get_max_score
(
self
):
...
...
@@ -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
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment