Commit c0855783 by Don Mitchell

Fix student progress @sarina bug

parent 3ab925a1
...@@ -10,8 +10,9 @@ from xmodule.open_ended_grading_classes import self_assessment_module ...@@ -10,8 +10,9 @@ from xmodule.open_ended_grading_classes import self_assessment_module
from xmodule.open_ended_grading_classes import open_ended_module from xmodule.open_ended_grading_classes import open_ended_module
from xmodule.util.duedate import get_extended_due_date from xmodule.util.duedate import get_extended_due_date
from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST
from xmodule.open_ended_grading_classes.peer_grading_service import PeerGradingService, MockPeerGradingService, GradingServiceError from xmodule.open_ended_grading_classes.peer_grading_service import PeerGradingService, MockPeerGradingService
from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild
from xmodule.open_ended_grading_classes.grading_service_module import GradingServiceError
log = logging.getLogger("edx.courseware") log = logging.getLogger("edx.courseware")
...@@ -800,7 +801,7 @@ class CombinedOpenEndedV1Module(): ...@@ -800,7 +801,7 @@ class CombinedOpenEndedV1Module():
success = False success = False
allowed_to_submit = True allowed_to_submit = True
try: try:
response = self.peer_gs.get_data_for_location(self.location.to_deprecated_string(), student_id) response = self.peer_gs.get_data_for_location(self.location, student_id)
count_graded = response['count_graded'] count_graded = response['count_graded']
count_required = response['count_required'] count_required = response['count_required']
student_sub_count = response['student_sub_count'] student_sub_count = response['student_sub_count']
......
import json
import logging import logging
from dogapi import dog_stats_api from dogapi import dog_stats_api
from .grading_service_module import GradingService, GradingServiceError from .grading_service_module import GradingService
from xmodule.modulestore.keys import UsageKey
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -30,6 +30,8 @@ class PeerGradingService(GradingService): ...@@ -30,6 +30,8 @@ class PeerGradingService(GradingService):
self.system = system self.system = system
def get_data_for_location(self, problem_location, student_id): def get_data_for_location(self, problem_location, student_id):
if isinstance(problem_location, UsageKey):
problem_location = problem_location.to_deprecated_string()
params = {'location': problem_location, 'student_id': student_id} params = {'location': problem_location, 'student_id': student_id}
result = self.get(self.get_data_for_location_url, params) result = self.get(self.get_data_for_location_url, params)
self._record_result('get_data_for_location', result) self._record_result('get_data_for_location', result)
...@@ -44,6 +46,8 @@ class PeerGradingService(GradingService): ...@@ -44,6 +46,8 @@ class PeerGradingService(GradingService):
return result return result
def get_next_submission(self, problem_location, grader_id): def get_next_submission(self, problem_location, grader_id):
if isinstance(problem_location, UsageKey):
problem_location = problem_location.to_deprecated_string()
result = self._render_rubric(self.get( result = self._render_rubric(self.get(
self.get_next_submission_url, self.get_next_submission_url,
{ {
...@@ -62,6 +66,8 @@ class PeerGradingService(GradingService): ...@@ -62,6 +66,8 @@ class PeerGradingService(GradingService):
return result return result
def is_student_calibrated(self, problem_location, grader_id): def is_student_calibrated(self, problem_location, grader_id):
if isinstance(problem_location, UsageKey):
problem_location = problem_location.to_deprecated_string()
params = {'problem_id': problem_location, 'student_id': grader_id} params = {'problem_id': problem_location, 'student_id': grader_id}
result = self.get(self.is_student_calibrated_url, params) result = self.get(self.is_student_calibrated_url, params)
self._record_result( self._record_result(
...@@ -72,6 +78,8 @@ class PeerGradingService(GradingService): ...@@ -72,6 +78,8 @@ class PeerGradingService(GradingService):
return result return result
def show_calibration_essay(self, problem_location, grader_id): def show_calibration_essay(self, problem_location, grader_id):
if isinstance(problem_location, UsageKey):
problem_location = problem_location.to_deprecated_string()
params = {'problem_id': problem_location, 'student_id': grader_id} params = {'problem_id': problem_location, 'student_id': grader_id}
result = self._render_rubric(self.get(self.show_calibration_essay_url, params)) result = self._render_rubric(self.get(self.show_calibration_essay_url, params))
self._record_result('show_calibration_essay', result) self._record_result('show_calibration_essay', result)
......
...@@ -13,10 +13,11 @@ from xmodule.raw_module import RawDescriptor ...@@ -13,10 +13,11 @@ from xmodule.raw_module import RawDescriptor
from xmodule.timeinfo import TimeInfo from xmodule.timeinfo import TimeInfo
from xmodule.util.duedate import get_extended_due_date from xmodule.util.duedate import get_extended_due_date
from xmodule.x_module import XModule, module_attr from xmodule.x_module import XModule, module_attr
from xmodule.open_ended_grading_classes.peer_grading_service import PeerGradingService, GradingServiceError, MockPeerGradingService from xmodule.open_ended_grading_classes.peer_grading_service import PeerGradingService, MockPeerGradingService
from open_ended_grading_classes import combined_open_ended_rubric from open_ended_grading_classes import combined_open_ended_rubric
from django.utils.timezone import UTC from django.utils.timezone import UTC
from xmodule.open_ended_grading_classes.grading_service_module import GradingServiceError
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -72,7 +72,7 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore): ...@@ -72,7 +72,7 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore):
Try getting data from the external grading service Try getting data from the external grading service
@return: @return:
""" """
success, _data = self.peer_grading.query_data_for_location(self.problem_location.to_deprecated_string()) success, _data = self.peer_grading.query_data_for_location(self.problem_location)
self.assertTrue(success) self.assertTrue(success)
def test_get_score_none(self): def test_get_score_none(self):
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<section class="container peer-grading-container"> <section class="container peer-grading-container">
<div class="peer-grading" data-ajax-url="${ajax_url}" data-location="${problem_location}" data-use-single-location="${use_single_location}"> <div class="peer-grading" data-ajax-url="${ajax_url}" data-location="${problem_location.to_deprecated_string()}" data-use-single-location="${use_single_location}">
<div class="error-container"></div> <div class="error-container"></div>
<section class="content-panel"> <section class="content-panel">
......
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