Commit 09ed3d12 by Diana Huang Committed by Vik Paruchuri

Hook up the backend into the new feedback response for scores

parent c87d0f11
...@@ -1928,7 +1928,7 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1928,7 +1928,7 @@ class OpenEndedResponse(LoncapaResponse):
Returns a boolean success/fail and an error message Returns a boolean success/fail and an error message
""" """
survey_responses=event_info['survey_responses'] survey_responses=event_info['survey_responses']
for tag in ['feedback', 'submission_id', 'grader_id']: for tag in ['feedback', 'submission_id', 'grader_id', 'score']:
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:
...@@ -1936,6 +1936,7 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1936,6 +1936,7 @@ class OpenEndedResponse(LoncapaResponse):
submission_id=int(survey_responses['submission_id']) submission_id=int(survey_responses['submission_id'])
grader_id = int(survey_responses['grader_id']) grader_id = int(survey_responses['grader_id'])
feedback = str(survey_responses['feedback']) feedback = str(survey_responses['feedback'])
score = int(survey_responses['score'])
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)
...@@ -1961,6 +1962,7 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1961,6 +1962,7 @@ class OpenEndedResponse(LoncapaResponse):
'feedback' : feedback, 'feedback' : feedback,
'submission_id' : submission_id, 'submission_id' : submission_id,
'grader_id' : grader_id, 'grader_id' : grader_id,
'score': score,
'student_info' : json.dumps(student_info), 'student_info' : json.dumps(student_info),
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<a href="#">Respond to Feedback</a> <a href="#">Respond to Feedback</a>
</header> </header>
<section id="evaluation_${id}" class="evaluation"> <section id="evaluation_${id}" class="evaluation">
<p>How accurate do you think this feedback is?</p> <p>How accurate do you find this feedback?</p>
<div class="evaluation-scoring"> <div class="evaluation-scoring">
<ul class="scoring-list"> <ul class="scoring-list">
<li><input type="radio" name="evaluation-score" id="evaluation-score-5" value="5" /> <label for="evaluation-score-5"> Excellent</label></li> <li><input type="radio" name="evaluation-score" id="evaluation-score-5" value="5" /> <label for="evaluation-score-5"> Excellent</label></li>
......
...@@ -209,9 +209,11 @@ class @Problem ...@@ -209,9 +209,11 @@ class @Problem
fd.append('feedback', feedback) fd.append('feedback', feedback)
fd.append('submission_id', submission_id) fd.append('submission_id', submission_id)
fd.append('grader_id', grader_id) fd.append('grader_id', grader_id)
if(!score || parseInt(score) == NaN) if(!score)
@gentle_alert "You need to pick a rating to submit." @gentle_alert "You need to pick a rating before you can submit."
return return
else
fd.append('score', score)
settings = 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