Commit aa92320c by Jason Bau

Merge branch 'jbau/edx-west/peereval-message-did-enough' into edx-west/release-candidate-20130710

Conflicts:
	common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee
parents b7cadf43 ee683c9d
......@@ -343,8 +343,17 @@ class @PeerGradingProblem
submission_callback: (response) =>
if response.success
@is_calibrated_check()
required = @grading_wrapper.data('required')
graded = @grading_wrapper.data('graded')+1
@grading_wrapper.data('graded', graded)
@grading_wrapper.attr('data-graded', graded) #just in case someone wants to read the DOM
message = "<p>Successfully saved your feedback. Fetched the next essay.</p>"
if graded >= required
message = "<p>Successfully saved your feedback. Fetched the next essay.
<b>You have completed the required number of peer evaluations, but may
choose to continue grading if you'd like.</b></p>"
@grading_message.fadeIn()
@grading_message.html("<p>Successfully saved your feedback. Fetched the next essay.</p>").focus()
@grading_message.html(message).focus()
else
if response.error
@render_error(response.error)
......
......@@ -177,9 +177,10 @@ class PeerGradingModule(PeerGradingFields, XModule):
return json.dumps(d, cls=ComplexEncoder)
def query_data_for_location(self):
def query_data_for_location(self, location=None):
student_id = self.system.anonymous_student_id
location = self.link_to_location
if not location:
location = self.link_to_location
success = False
response = {}
......@@ -567,12 +568,24 @@ class PeerGradingModule(PeerGradingFields, XModule):
elif data.get('location') is not None:
problem_location = data.get('location')
success, response = self.query_data_for_location(location=problem_location)
if not success:
log.error(
"No instance data found and could not get data from controller for loc {0} student {1}".format(
problem_location, self.system.anonymous_student_id
))
return {'html': "", 'success': False}
count_graded = response['count_graded']
count_required = response['count_required']
ajax_url = self.ajax_url
html = self.system.render_template('peer_grading/peer_grading_problem.html', {
'view_html': '',
'problem_location': problem_location,
'course_id': self.system.course_id,
'ajax_url': ajax_url,
'count_graded': count_graded,
'count_required': count_required,
# Checked above
'staff_access': False,
'use_single_location': self.use_for_single_location,
......
......@@ -24,7 +24,7 @@
</div>
<section class="grading-wrapper">
<section class="grading-wrapper" data-graded="${count_graded}" data-required="${count_required}">
<h2>Student Response</h2>
<div class="grading-message">
......
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