Commit ae6a8abe by cahrens Committed by Andy Armstrong

Doc string updates.

parent 53ebf83d
...@@ -285,16 +285,16 @@ def create_assessment( ...@@ -285,16 +285,16 @@ def create_assessment(
logger.exception(message) logger.exception(message)
raise PeerAssessmentWorkflowError(message) raise PeerAssessmentWorkflowError(message)
except InvalidRubric: except InvalidRubric:
msg = u"Rubric definition was not valid" msg = u"The rubric definition is not valid."
logger.exception(msg) logger.exception(msg)
raise PeerAssessmentRequestError(msg) raise PeerAssessmentRequestError(msg)
except InvalidRubricSelection: except InvalidRubricSelection:
msg = u"Invalid options selected in the rubric" msg = u"Invalid options were selected in the rubric."
logger.warning(msg, exc_info=True) logger.warning(msg, exc_info=True)
raise PeerAssessmentRequestError(msg) raise PeerAssessmentRequestError(msg)
except DatabaseError: except DatabaseError:
error_message = ( error_message = (
u"An error occurred while retrieving the peer workflow item by scorer with ID: {}" u"An error occurred while creating an assessment by the scorer with this ID: {}"
).format(scorer_id) ).format(scorer_id)
logger.exception(error_message) logger.exception(error_message)
raise PeerAssessmentInternalError(error_message) raise PeerAssessmentInternalError(error_message)
......
...@@ -227,16 +227,16 @@ def create_assessment( ...@@ -227,16 +227,16 @@ def create_assessment(
return full_assessment_dict(assessment) return full_assessment_dict(assessment)
except InvalidRubric: except InvalidRubric:
error_message = u"Rubric definition was not valid" error_message = u"The rubric definition is not valid."
logger.exception(error_message) logger.exception(error_message)
raise StaffAssessmentRequestError(error_message) raise StaffAssessmentRequestError(error_message)
except InvalidRubricSelection: except InvalidRubricSelection:
error_message = u"Invalid options selected in the rubric" error_message = u"Invalid options were selected in the rubric."
logger.warning(error_message, exc_info=True) logger.warning(error_message, exc_info=True)
raise StaffAssessmentRequestError(error_message) raise StaffAssessmentRequestError(error_message)
except DatabaseError: except DatabaseError:
error_message = ( error_message = (
u"An error occurred while creating assessment by scorer with ID: {}" u"An error occurred while creating an assessment by the scorer with this ID: {}"
).format(scorer_id) ).format(scorer_id)
logger.exception(error_message) logger.exception(error_message)
raise StaffAssessmentInternalError(error_message) raise StaffAssessmentInternalError(error_message)
......
...@@ -311,7 +311,7 @@ class TestStaffAssessment(CacheResetTest): ...@@ -311,7 +311,7 @@ class TestStaffAssessment(CacheResetTest):
OPTIONS_SELECTED_DICT["most"]["options"], dict(), "", OPTIONS_SELECTED_DICT["most"]["options"], dict(), "",
invalid_rubric, invalid_rubric,
) )
self.assertEqual(str(context_manager.exception), u"Rubric definition was not valid") self.assertEqual(str(context_manager.exception), u"The rubric definition is not valid.")
@data("criterion_not_found", "option_not_found", "missing_criteria", "some_criteria_not_assessed") @data("criterion_not_found", "option_not_found", "missing_criteria", "some_criteria_not_assessed")
def test_invalid_rubric_options_exception(self, invalid_reason): def test_invalid_rubric_options_exception(self, invalid_reason):
...@@ -337,7 +337,7 @@ class TestStaffAssessment(CacheResetTest): ...@@ -337,7 +337,7 @@ class TestStaffAssessment(CacheResetTest):
dict_to_use, dict(), "", dict_to_use, dict(), "",
RUBRIC, RUBRIC,
) )
self.assertEqual(str(context_manager.exception), u"Invalid options selected in the rubric") self.assertEqual(str(context_manager.exception), u"Invalid options were selected in the rubric.")
@mock.patch.object(Assessment.objects, 'filter') @mock.patch.object(Assessment.objects, 'filter')
def test_database_filter_error_handling(self, mock_filter): def test_database_filter_error_handling(self, mock_filter):
...@@ -379,7 +379,7 @@ class TestStaffAssessment(CacheResetTest): ...@@ -379,7 +379,7 @@ class TestStaffAssessment(CacheResetTest):
) )
self.assertEqual( self.assertEqual(
str(context_manager.exception), str(context_manager.exception),
u"An error occurred while creating assessment by scorer with ID: {}".format("Dumbledore") u"An error occurred while creating an assessment by the scorer with this ID: {}".format("Dumbledore")
) )
@staticmethod @staticmethod
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<i class="openassessment_alert_icon"></i> <i class="openassessment_alert_icon"></i>
<div class="openassessment_alert_header"> <div class="openassessment_alert_header">
<h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings Section" %}</h2> <h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings Section" %}</h2>
<p class="openassessment_alert_message">{% trans "A change that you made to this assessment's rubric has an impact on some examples laid out in the settings tab. For more information, go to the Settings section and fix areas highlighted in red." %}</p> <p class="openassessment_alert_message">{% trans "A change that you made to this assessment's rubric has an impact on some examples laid out in the settings tab. For more information, go to the Settings section and fix the areas highlighted in red." %}</p>
</div> </div>
<a href="" rel="view" class="action openassessment_alert_close"> <a href="" rel="view" class="action openassessment_alert_close">
<i class="icon fa fa-times-circle" aria-hidden="true"></i> <i class="icon fa fa-times-circle" aria-hidden="true"></i>
......
...@@ -235,13 +235,13 @@ def verify_assessment_parameters(func): ...@@ -235,13 +235,13 @@ def verify_assessment_parameters(func):
def verify_and_call(instance, data, suffix): def verify_and_call(instance, data, suffix):
# Validate the request # Validate the request
if 'options_selected' not in data: if 'options_selected' not in data:
return {'success': False, 'msg': instance._('Must provide options selected in the assessment')} return {'success': False, 'msg': instance._('You must provide options selected in the assessment.')}
if 'overall_feedback' not in data: if 'overall_feedback' not in data:
return {'success': False, 'msg': instance._('Must provide overall feedback in the assessment')} return {'success': False, 'msg': instance._('You must provide overall feedback in the assessment.')}
if 'criterion_feedback' not in data: if 'criterion_feedback' not in data:
return {'success': False, 'msg': instance._('Must provide feedback for criteria in the assessment')} return {'success': False, 'msg': instance._('You must provide feedback for criteria in the assessment.')}
return func(instance, data, suffix) return func(instance, data, suffix)
return verify_and_call return verify_and_call
...@@ -52,7 +52,9 @@ class PeerAssessmentMixin(object): ...@@ -52,7 +52,9 @@ class PeerAssessmentMixin(object):
""" """
if self.submission_uuid is None: if self.submission_uuid is None:
return {'success': False, 'msg': self._('You must submit a response before you can peer-assess.')} return {
'success': False, 'msg': self._('You must submit a response before you can perform a peer assessment.')
}
uuid_server, uuid_client = self._get_server_and_client_submission_uuids(data) uuid_server, uuid_client = self._get_server_and_client_submission_uuids(data)
if uuid_server != uuid_client: if uuid_server != uuid_client:
......
...@@ -38,7 +38,9 @@ class StaffAssessmentMixin(object): ...@@ -38,7 +38,9 @@ class StaffAssessmentMixin(object):
Create a staff assessment from a staff submission. Create a staff assessment from a staff submission.
""" """
if 'submission_uuid' not in data: if 'submission_uuid' not in data:
return {'success': False, 'msg': self._(u"Missing the submission id of the submission being assessed.")} return {
'success': False, 'msg': self._(u"The submission ID of the submission being assessed was not found.")
}
try: try:
assessment = staff_api.create_assessment( assessment = staff_api.create_assessment(
...@@ -123,7 +125,7 @@ class StaffAssessmentMixin(object): ...@@ -123,7 +125,7 @@ class StaffAssessmentMixin(object):
context = { context = {
'status_value': self._('Complete'), 'status_value': self._('Complete'),
'icon_class': 'fa-check', 'icon_class': 'fa-check',
'message_title': self._('You Must Complete the Above Steps to View Your Grade'), 'message_title': self._('You Must Complete the Steps Above to View Your Grade'),
'message_content': self._('Although a course staff member has assessed your response, you will receive your grade only after you have completed all the required steps of this problem.'), 'message_content': self._('Although a course staff member has assessed your response, you will receive your grade only after you have completed all the required steps of this problem.'),
} }
else: # Both student and staff still have work to do, just show "Not Available". else: # Both student and staff still have work to do, just show "Not Available".
......
...@@ -260,7 +260,7 @@ describe('OpenAssessment.StaffAreaView', function() { ...@@ -260,7 +260,7 @@ describe('OpenAssessment.StaffAreaView', function() {
var staffArea = createStaffArea(); var staffArea = createStaffArea();
chooseStudent(staffArea, ''); chooseStudent(staffArea, '');
expect($('.openassessment_student_info_form .form--error', staffArea.element).text().trim()) expect($('.openassessment_student_info_form .form--error', staffArea.element).text().trim())
.toBe('A learner name must be provided.'); .toBe('You must provide a learner name.');
}); });
describe('Submission Management', function() { describe('Submission Management', function() {
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
deferred.reject(); deferred.reject();
}); });
} else { } else {
showFormError(gettext('A learner name must be provided.')); showFormError(gettext('You must provide a learner name.'));
deferred.reject(); deferred.reject();
} }
return deferred.promise(); return deferred.promise();
......
...@@ -84,7 +84,7 @@ class TestStaffAssessmentRender(StaffAssessmentTestBase, SubmitAssessmentsMixin) ...@@ -84,7 +84,7 @@ class TestStaffAssessmentRender(StaffAssessmentTestBase, SubmitAssessmentsMixin)
{ {
'status_value': 'Complete', 'status_value': 'Complete',
'icon_class': 'fa-check', 'icon_class': 'fa-check',
'message_title': 'You Must Complete the Above Steps to View Your Grade', 'message_title': 'You Must Complete the Steps Above to View Your Grade',
'message_content': 'Although a course staff member has assessed your response, you will receive your grade only after you have completed all the required steps of this problem.' 'message_content': 'Although a course staff member has assessed your response, you will receive your grade only after you have completed all the required steps of this problem.'
} }
) )
......
...@@ -232,7 +232,7 @@ class PeerAssessmentTestStaffOverride(OpenAssessmentTest): ...@@ -232,7 +232,7 @@ class PeerAssessmentTestStaffOverride(OpenAssessmentTest):
# Refresh the page so the learner sees the Staff Grade section. # Refresh the page so the learner sees the Staff Grade section.
self.browser.refresh() self.browser.refresh()
self._verify_staff_grade_section("COMPLETE", "YOU MUST COMPLETE THE ABOVE STEPS TO VIEW YOUR GRADE") self._verify_staff_grade_section("COMPLETE", "YOU MUST COMPLETE THE STEPS ABOVE TO VIEW YOUR GRADE")
# Verify no final grade yet. # Verify no final grade yet.
self.assertIsNone(self.grade_page.wait_for_page().score) self.assertIsNone(self.grade_page.wait_for_page().score)
...@@ -519,7 +519,7 @@ class StaffAreaTest(OpenAssessmentTest): ...@@ -519,7 +519,7 @@ class StaffAreaTest(OpenAssessmentTest):
# Refresh the page so the learner sees the Staff Grade section. # Refresh the page so the learner sees the Staff Grade section.
self.browser.refresh() self.browser.refresh()
self._verify_staff_grade_section("COMPLETE", "YOU MUST COMPLETE THE ABOVE STEPS TO VIEW YOUR GRADE") self._verify_staff_grade_section("COMPLETE", "YOU MUST COMPLETE THE STEPS ABOVE TO VIEW YOUR GRADE")
# Verify no final grade yet. # Verify no final grade yet.
self.assertIsNone(self.grade_page.wait_for_page().score) self.assertIsNone(self.grade_page.wait_for_page().score)
......
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