Start to refactor grading settings
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
"""
|
||||
This module provides an interface on the grading-service backend
|
||||
for peer grading
|
||||
|
||||
Use peer_grading_service() to get the version specified
|
||||
in settings.PEER_GRADING_INTERFACE
|
||||
|
||||
"""
|
||||
import json
|
||||
import logging
|
||||
import requests
|
||||
|
||||
@@ -28,6 +28,7 @@ class PeerGradingService(GradingService):
|
||||
def __init__(self, config, system):
|
||||
config['system'] = system
|
||||
super(PeerGradingService, self).__init__(config)
|
||||
self.url = config['url'] + config['peer_grading']
|
||||
self.get_next_submission_url = self.url + '/get_next_submission/'
|
||||
self.save_grade_url = self.url + '/save_grade/'
|
||||
self.is_student_calibrated_url = self.url + '/is_student_calibrated/'
|
||||
@@ -161,6 +162,6 @@ def peer_grading_service(system):
|
||||
if settings.MOCK_PEER_GRADING:
|
||||
_service = MockPeerGradingService()
|
||||
else:
|
||||
_service = PeerGradingService(settings.PEER_GRADING_INTERFACE, system)
|
||||
_service = PeerGradingService(settings.OPEN_ENDED_GRADING_INTERFACE, system)
|
||||
|
||||
return _service
|
||||
|
||||
@@ -869,7 +869,10 @@ class ModuleSystem(object):
|
||||
xqueue=None,
|
||||
node_path="",
|
||||
anonymous_student_id='',
|
||||
course_id=None):
|
||||
course_id=None,
|
||||
peer_grading_interface=None,
|
||||
staff_grading_interface=None,
|
||||
s3_interface=None):
|
||||
'''
|
||||
Create a closure around the system environment.
|
||||
|
||||
@@ -920,6 +923,9 @@ class ModuleSystem(object):
|
||||
self.anonymous_student_id = anonymous_student_id
|
||||
self.course_id = course_id
|
||||
self.user_is_staff = user is not None and user.is_staff
|
||||
self.peer_grading_interface = peer_grading_interface
|
||||
self.staff_grading_interface = staff_grading_interface
|
||||
self.s3_interface = s3_interface
|
||||
|
||||
def get(self, attr):
|
||||
''' provide uniform access to attributes (like etree).'''
|
||||
|
||||
Reference in New Issue
Block a user