Commit b06ce84a by Vik Paruchuri

Wire in submit message

parent b71233fd
...@@ -195,7 +195,7 @@ class LoncapaProblem(object): ...@@ -195,7 +195,7 @@ class LoncapaProblem(object):
TODO: Handle multiple problems on one page sync issues. TODO: Handle multiple problems on one page sync issues.
""" """
success=False success=False
message = "" message = "Could not find a valid responder."
log.debug("in lcp") log.debug("in lcp")
for responder in self.responders.values(): for responder in self.responders.values():
if hasattr(responder, 'handle_message_post'): if hasattr(responder, 'handle_message_post'):
......
...@@ -1932,9 +1932,10 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1932,9 +1932,10 @@ class OpenEndedResponse(LoncapaResponse):
if tag not in survey_responses: if tag not in survey_responses:
return False, "Could not find needed tag {0}".format(tag) return False, "Could not find needed tag {0}".format(tag)
try: try:
submission_id=int(survey_responses['submission_id'][0]) log.debug(survey_responses['submission_id'])
grader_id = int(survey_responses['grader_id'][0]) submission_id=int(survey_responses['submission_id'])
feedback = str(survey_responses['feedback'][0]) grader_id = int(survey_responses['grader_id'])
feedback = str(survey_responses['feedback'])
except: except:
error_message="Could not parse submission id, grader id, or feedback from message_post ajax call." error_message="Could not parse submission id, grader id, or feedback from message_post ajax call."
log.exception(error_message) log.exception(error_message)
...@@ -1947,7 +1948,12 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1947,7 +1948,12 @@ class OpenEndedResponse(LoncapaResponse):
anonymous_student_id + anonymous_student_id +
self.answer_id) self.answer_id)
xheader = xqueue_interface.make_xheader(lms_key=queuekey,queue_name=self.message_queue_name) xheader = xqueue_interface.make_xheader(
lms_callback_url=self.system.xqueue['callback_url'],
lms_key=queuekey,
queue_name=self.message_queue_name
)
student_info = {'anonymous_student_id': anonymous_student_id, student_info = {'anonymous_student_id': anonymous_student_id,
'submission_time': qtime, 'submission_time': qtime,
} }
...@@ -1966,7 +1972,7 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1966,7 +1972,7 @@ class OpenEndedResponse(LoncapaResponse):
if error: if error:
success=False success=False
return success, "Successfully sent to queue." return success, "Successfully submitted your feedback."
def get_score(self, student_answers): def get_score(self, student_answers):
......
...@@ -407,7 +407,7 @@ class CapaModule(XModule): ...@@ -407,7 +407,7 @@ class CapaModule(XModule):
success, message = self.lcp.message_post(event_info) success, message = self.lcp.message_post(event_info)
return {'success' : success} return {'success' : success, 'message' : message}
def closed(self): def closed(self):
''' Is the student still allowed to submit answers? ''' ''' Is the student still allowed to submit answers? '''
......
...@@ -215,7 +215,10 @@ class @Problem ...@@ -215,7 +215,10 @@ class @Problem
processData: false processData: false
contentType: false contentType: false
success: (response) => success: (response) =>
@gentle_alert response.success @gentle_alert response.message
switch response.success
when 'True', 'true'
@$('section.evaluation input.submit-message').hide()
$.ajaxWithPrefix("#{@url}/message_post", settings) $.ajaxWithPrefix("#{@url}/message_post", settings)
......
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