Hook up the backend into the new feedback response for scores
This commit is contained in:
committed by
Vik Paruchuri
parent
c87d0f11d6
commit
09ed3d12a2
@@ -1928,7 +1928,7 @@ class OpenEndedResponse(LoncapaResponse):
|
||||
Returns a boolean success/fail and an error message
|
||||
"""
|
||||
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:
|
||||
return False, "Could not find needed tag {0}".format(tag)
|
||||
try:
|
||||
@@ -1936,6 +1936,7 @@ class OpenEndedResponse(LoncapaResponse):
|
||||
submission_id=int(survey_responses['submission_id'])
|
||||
grader_id = int(survey_responses['grader_id'])
|
||||
feedback = str(survey_responses['feedback'])
|
||||
score = int(survey_responses['score'])
|
||||
except:
|
||||
error_message="Could not parse submission id, grader id, or feedback from message_post ajax call."
|
||||
log.exception(error_message)
|
||||
@@ -1961,6 +1962,7 @@ class OpenEndedResponse(LoncapaResponse):
|
||||
'feedback' : feedback,
|
||||
'submission_id' : submission_id,
|
||||
'grader_id' : grader_id,
|
||||
'score': score,
|
||||
'student_info' : json.dumps(student_info),
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<a href="#">Respond to Feedback</a>
|
||||
</header>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
@@ -209,9 +209,11 @@ class @Problem
|
||||
fd.append('feedback', feedback)
|
||||
fd.append('submission_id', submission_id)
|
||||
fd.append('grader_id', grader_id)
|
||||
if(!score || parseInt(score) == NaN)
|
||||
@gentle_alert "You need to pick a rating to submit."
|
||||
if(!score)
|
||||
@gentle_alert "You need to pick a rating before you can submit."
|
||||
return
|
||||
else
|
||||
fd.append('score', score)
|
||||
|
||||
|
||||
settings =
|
||||
|
||||
Reference in New Issue
Block a user