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
a2e5bd07
Commit
a2e5bd07
authored
May 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in tests for peer grading module
parent
fd46ebd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
+0
-4
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+37
-3
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
View file @
a2e5bd07
...
@@ -132,10 +132,6 @@ class MockPeerGradingService(object):
...
@@ -132,10 +132,6 @@ class MockPeerGradingService(object):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
return
{
'success'
:
True
,
return
{
'success'
:
True
,
'problem_list'
:
[
'problem_list'
:
[
{
'location'
:
'i4x://MITx/3.091x/problem/open_ended_demo1'
,
'problem_name'
:
"Problem 1"
,
'num_graded'
:
3
,
'num_pending'
:
5
},
{
'location'
:
'i4x://MITx/3.091x/problem/open_ended_demo2'
,
'problem_name'
:
"Problem 2"
,
'num_graded'
:
1
,
'num_pending'
:
5
}
]}
]}
def
get_data_for_location
(
self
,
problem_location
,
student_id
):
def
get_data_for_location
(
self
,
problem_location
,
student_id
):
...
...
common/lib/xmodule/xmodule/tests/test_peer_grading.py
View file @
a2e5bd07
...
@@ -4,7 +4,7 @@ import json
...
@@ -4,7 +4,7 @@ import json
from
lxml
import
etree
from
lxml
import
etree
from
mock
import
Mock
from
mock
import
Mock
from
.
import
test_system
from
.
import
test_system
from
dummy_system
import
DummySystem
,
DummySystemUser
from
dummy_system
import
DummySystem
,
DummySystemUser
,
MockQueryDict
from
xmodule.peer_grading_module
import
PeerGradingModule
,
PeerGradingDescriptor
from
xmodule.peer_grading_module
import
PeerGradingModule
,
PeerGradingDescriptor
from
xmodule.open_ended_grading_classes.grading_service_module
import
GradingServiceError
from
xmodule.open_ended_grading_classes.grading_service_module
import
GradingServiceError
...
@@ -16,6 +16,17 @@ COURSE="open_ended"
...
@@ -16,6 +16,17 @@ COURSE="open_ended"
class
PeerGradingModuleTest
(
unittest
.
TestCase
,
DummySystemUser
):
class
PeerGradingModuleTest
(
unittest
.
TestCase
,
DummySystemUser
):
problem_location
=
Location
([
"i4x"
,
"edX"
,
"open_ended"
,
"peergrading"
,
problem_location
=
Location
([
"i4x"
,
"edX"
,
"open_ended"
,
"peergrading"
,
"PeerGradingSample"
])
"PeerGradingSample"
])
calibrated_dict
=
{
'location'
:
"blah"
}
save_dict
=
MockQueryDict
()
save_dict
.
update
({
'location'
:
"blah"
,
'submission_id'
:
1
,
'submission_key'
:
""
,
'score'
:
1
,
'feedback'
:
""
,
'rubric_scores[]'
:
[
0
,
1
],
'submission_flagged'
:
False
,
})
def
setUp
(
self
):
def
setUp
(
self
):
self
.
test_system
=
test_system
()
self
.
test_system
=
test_system
()
...
@@ -42,4 +53,27 @@ class PeerGradingModuleTest(unittest.TestCase, DummySystemUser):
...
@@ -42,4 +53,27 @@ class PeerGradingModuleTest(unittest.TestCase, DummySystemUser):
max_score
=
self
.
peer_grading
.
max_score
()
max_score
=
self
.
peer_grading
.
max_score
()
def
get_next_submission
(
self
):
def
get_next_submission
(
self
):
success
,
next_submission
=
self
.
peer_grading
.
get_next_submission
({
'location'
:
'blah'
})
success
,
next_submission
=
self
.
peer_grading
.
get_next_submission
({
'location'
:
'blah'
})
\ No newline at end of file
def
test_save_grade
(
self
):
self
.
peer_grading
.
save_grade
(
self
.
save_dict
)
def
test_is_student_calibrated
(
self
):
calibrated_dict
=
{
'location'
:
"blah"
}
self
.
peer_grading
.
is_student_calibrated
(
self
.
calibrated_dict
)
def
test_show_calibration_essay
(
self
):
self
.
peer_grading
.
show_calibration_essay
(
self
.
calibrated_dict
)
def
test_save_calibration_essay
(
self
):
self
.
peer_grading
.
save_calibration_essay
(
self
.
save_dict
)
def
test_peer_grading_closed
(
self
):
self
.
peer_grading
.
peer_grading_closed
()
def
test_peer_grading_problem
(
self
):
self
.
peer_grading
.
peer_grading_problem
(
self
.
calibrated_dict
)
def
test_get_instance_state
(
self
):
self
.
peer_grading
.
get_instance_state
()
\ No newline at end of file
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