@@ -645,7 +646,10 @@ class CombinedOpenEndedV1Module():
ifself.attempts>self.max_attempts:
return{
'success':False,
'error':'Too many attempts.'
#This is a student_facing_error
'error':('You have attempted this question {0} times. '
'You are only allowed to attempt it {1} times.').format(
self.attempts,self.max_attempts)
}
self.state=self.INITIAL
self.allow_reset=False
...
...
@@ -784,7 +788,8 @@ class CombinedOpenEndedV1Descriptor(XmlDescriptor, EditingDescriptor):
expected_children=['task','rubric','prompt']
forchildinexpected_children:
iflen(xml_object.xpath(child))==0:
raiseValueError("Combined Open Ended definition must include at least one '{0}' tag".format(child))
#This is a staff_facing_error
raiseValueError("Combined Open Ended definition must include at least one '{0}' tag. Contact the learning sciences group for assistance.".format(child))
defparse_task(k):
"""Assumes that xml_object has child k"""
...
...
@@ -809,4 +814,4 @@ class CombinedOpenEndedV1Descriptor(XmlDescriptor, EditingDescriptor):
@@ -81,7 +80,8 @@ class CombinedOpenEndedRubric(object):
success=rubric_dict['success']
rubric_feedback=rubric_dict['html']
ifnotsuccess:
error_message="Could not parse rubric : {0} for location {1}".format(rubric_string,location.url())
#This is a staff_facing_error
error_message="Could not parse rubric : {0} for location {1}. Contact the learning sciences group for assistance.".format(rubric_string,location.url())
log.error(error_message)
raiseRubricParsingError(error_message)
...
...
@@ -90,13 +90,15 @@ class CombinedOpenEndedRubric(object):
forcategoryinrubric_categories:
total=total+len(category['options'])-1
iflen(category['options'])>(max_score_allowed+1):
error_message="Number of score points in rubric {0} higher than the max allowed, which is {1}".format(
#This is a staff_facing_error
error_message="Number of score points in rubric {0} higher than the max allowed, which is {1}. Contact the learning sciences group for assistance.".format(
len(category['options']),max_score_allowed)
log.error(error_message)
raiseRubricParsingError(error_message)
iftotal!=max_score:
error_msg="The max score {0} for problem {1} does not match the total number of points in the rubric {2}".format(
#This is a staff_facing_error
error_msg="The max score {0} for problem {1} does not match the total number of points in the rubric {2}. Contact the learning sciences group for assistance.".format(
max_score,location,total)
log.error(error_msg)
raiseRubricParsingError(error_msg)
...
...
@@ -118,7 +120,8 @@ class CombinedOpenEndedRubric(object):
categories=[]
forcategoryinelement:
ifcategory.tag!='category':
raiseRubricParsingError("[extract_categories] Expected a <category> tag: got {0} instead".format(category.tag))
#This is a staff_facing_error
raiseRubricParsingError("[extract_categories] Expected a <category> tag: got {0} instead. Contact the learning sciences group for assistance.".format(category.tag))
@@ -144,12 +147,14 @@ class CombinedOpenEndedRubric(object):
self.has_score=True
# if we are missing the score tag and we are expecting one
elifself.has_score:
raiseRubricParsingError("[extract_category] Category {0} is missing a score".format(descriptionxml.text))
#This is a staff_facing_error
raiseRubricParsingError("[extract_category] Category {0} is missing a score. Contact the learning sciences group for assistance.".format(descriptionxml.text))
raiseRubricParsingError("[extract_category]: expected description tag, got {0} instead. Contact the learning sciences group for assistance.".format(descriptionxml.tag))
description=descriptionxml.text
...
...
@@ -159,7 +164,8 @@ class CombinedOpenEndedRubric(object):
raiseRubricParsingError("[extract_category]: expected option tag, got {0} instead. Contact the learning sciences group for assistance.".format(option.tag))
else:
pointstr=option.get("points")
ifpointstr:
...
...
@@ -168,7 +174,8 @@ class CombinedOpenEndedRubric(object):
try:
points=int(pointstr)
exceptValueError:
raiseRubricParsingError("[extract_category]: expected points to have int, got {0} instead".format(pointstr))
#This is a staff_facing_error
raiseRubricParsingError("[extract_category]: expected points to have int, got {0} instead. Contact the learning sciences group for assistance.".format(pointstr))
elifautonumbering:
# use the generated one if we're in the right mode
points=cur_points
...
...
@@ -200,7 +207,6 @@ class CombinedOpenEndedRubric(object):
@@ -219,13 +225,15 @@ class CombinedOpenEndedRubric(object):
Validates a set of options. This can and should be extended to filter out other bad edge cases
'''
iflen(options)==0:
raiseRubricParsingError("[extract_category]: no options associated with this category")
#This is a staff_facing_error
raiseRubricParsingError("[extract_category]: no options associated with this category. Contact the learning sciences group for assistance.")
iflen(options)==1:
return
prev=options[0]['points']
foroptioninoptions[1:]:
ifprev==option['points']:
raiseRubricParsingError("[extract_category]: found duplicate point values between two different options")
#This is a staff_facing_error
raiseRubricParsingError("[extract_category]: found duplicate point values between two different options. Contact the learning sciences group for assistance.")
else:
prev=option['points']
...
...
@@ -241,11 +249,14 @@ class CombinedOpenEndedRubric(object):
"""
success=False
iflen(scores)==0:
log.error("Score length is 0.")
#This is a dev_facing_error
log.error("Score length is 0 when trying to reformat rubric scores for rendering.")
error_message="There was a problem saving the image in your submission. Please try a different image, or try pasting a link to an image into the answer box."
return{
'success':True,
'success':success,
'error':error_message,
'student_response':get['student_answer']
}
...
...
@@ -690,7 +715,8 @@ class OpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
"""
forchildin['openendedparam']:
iflen(xml_object.xpath(child))!=1:
raiseValueError("Open Ended definition must include exactly one '{0}' tag".format(child))
#This is a staff_facing_error
raiseValueError("Open Ended definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance.".format(child))
error_message="There was a problem saving the image in your submission. Please try a different image, or try pasting a link to an image into the answer box."
return{
...
...
@@ -214,7 +225,10 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
foriinxrange(0,len(score_list)):
score_list[i]=int(score_list[i])
exceptValueError:
return{'success':False,'error':"Non-integer score value, or no score list"}
#This is a dev_facing_error
log.error("Non-integer score value passed to save_assessment ,or no score list present.")
#This is a student_facing_error
return{'success':False,'error':"Error saving your score. Please notify course staff."}
#Record score as assessment and rubric scores as post assessment
self.record_latest_score(score)
...
...
@@ -256,6 +270,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
try:
rubric_scores=json.loads(latest_post_assessment)
except:
#This is a dev_facing_error
log.error("Cannot parse rubric scores in self assessment module from {0}".format(latest_post_assessment))
rubric_scores=[]
return[rubric_scores]
...
...
@@ -287,7 +302,8 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
expected_children=[]
forchildinexpected_children:
iflen(xml_object.xpath(child))!=1:
raiseValueError("Self assessment definition must include exactly one '{0}' tag".format(child))
#This is a staff_facing_error
raiseValueError("Self assessment definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance.".format(child))
@@ -18,6 +18,7 @@ from mitxmako.shortcuts import render_to_string
log=logging.getLogger(__name__)
STAFF_ERROR_MESSAGE='Could not contact the external grading server. Please contact the development team. If you do not have a point of contact, you can contact Vik at vik@edx.org.'
'Flagged Submissions':"Submissions have been flagged for review"
}
STUDENT_ERROR_MESSAGE="Error occured while contacting the grading service. Please notify course staff."
STAFF_ERROR_MESSAGE="Error occured while contacting the grading service. Please notify the development team. If you do not have a point of contact, please email Vik at vik@edx.org"
returnHttpResponse(json.dumps({'success':False,'error':STAFF_ERROR_MESSAGE+'Missing key {0} from submission. Please reload and try again.'.format(key)}),
<textareaname="feedback"placeholder="Feedback for student"
class="feedback-area"cols="70"></textarea>
<pclass="flag-student-container">Flag this submission for review by course staff (use if the submission contains inappropriate content): <inputtype="checkbox"class="flag-checkbox"value="student_is_flagged"></p>
<pclass="answer-unknown-container">I do not know how to grade this question: <inputtype="checkbox"class="answer-unknown-checkbox"value="answer_is_unknown"></p>