Commit a2e5bd07 by Vik Paruchuri

Add in tests for peer grading module

parent fd46ebd1
......@@ -132,10 +132,6 @@ class MockPeerGradingService(object):
def get_problem_list(self, course_id, grader_id):
return {'success': True,
'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):
......
......@@ -4,7 +4,7 @@ import json
from lxml import etree
from mock import Mock
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.open_ended_grading_classes.grading_service_module import GradingServiceError
......@@ -16,6 +16,17 @@ COURSE="open_ended"
class PeerGradingModuleTest(unittest.TestCase, DummySystemUser):
problem_location = Location(["i4x", "edX", "open_ended", "peergrading",
"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):
self.test_system = test_system()
......@@ -42,4 +53,27 @@ class PeerGradingModuleTest(unittest.TestCase, DummySystemUser):
max_score = self.peer_grading.max_score()
def get_next_submission(self):
success, next_submission = self.peer_grading.get_next_submission({'location' : 'blah'})
\ No newline at end of file
success, next_submission = self.peer_grading.get_next_submission({'location' : 'blah'})
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment