Commit 69333759 by Vik Paruchuri

Properly parse url for grading controller

parent e6dd07a4
......@@ -24,6 +24,7 @@ from static_replace import replace_urls
from open_ended_grading.peer_grading_service import PeerGradingService
from open_ended_grading.staff_grading_service import StaffGradingService
from open_ended_grading.controller_query_service import ControllerQueryService
from open_ended_grading import open_ended_util
from student.models import unique_id_for_user
from models import StudentModule
import datetime
......@@ -158,10 +159,8 @@ def _peer_grading(tab, user, course, active_page):
def _combined_open_ended_grading(tab, user, course, active_page):
if user.is_authenticated:
link = reverse('open_ended_problems', args=[course.id])
peer_grading_url = settings.PEER_GRADING_INTERFACE
split_url = peer_grading_url.split("/")
controller_url = "http://" + split_url[2] + "/grading_controller"
log.debug(controller_url)
controller_url = open_ended_util.get_controller_url()
controller_qs = ControllerQueryService(controller_url)
student_id = unique_id_for_user(user)
course_id = course.id
......
from django.conf import settings
def get_controller_url():
peer_grading_url = settings.PEER_GRADING_INTERFACE
split_url = peer_grading_url.split("/")
controller_url = "http://" + split_url[2] + "/grading_controller"
return controller_url
......@@ -19,6 +19,8 @@ import json
from .staff_grading import StaffGrading
from student.models import unique_id_for_user
import open_ended_util
log = logging.getLogger(__name__)
......@@ -28,7 +30,8 @@ if settings.MOCK_PEER_GRADING:
else:
peer_gs = PeerGradingService(settings.PEER_GRADING_INTERFACE)
controller_qs = ControllerQueryService(settings.PEER_GRADING_INTERFACE)
controller_url = open_ended_util.get_controller_url()
controller_qs = ControllerQueryService(controller_url)
"""
Reverses the URL from the name and the course id, and then adds a trailing slash if
......
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