Commit b782f712 by Vik Paruchuri

Add in more js to handle student feedback

parent 634b5860
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
% if status in ['correct','incorrect']: % if status in ['correct','incorrect']:
<section id="evaluation_${id}" class="evaluation"> <section id="evaluation_${id}" class="evaluation">
Score Evaluation: Score Evaluation:
<textarea rows="${rows}" cols="${cols}" name="input_${id}" class="feedback-on-feedback" id="input_${id}">Please enter some comments about the score/feedback you received here.</textarea> <textarea rows="${rows}" cols="${cols}" name="input_${id}" class="feedback-on-feedback" id="input_${id}"></textarea>
<input name="submit-message" class="submit-message" type="button" value="Submit your message"/> <input name="submit-message" class="submit-message" type="button" value="Submit your message"/>
</section> </section>
% endif % endif
......
...@@ -402,11 +402,13 @@ class CapaModule(XModule): ...@@ -402,11 +402,13 @@ class CapaModule(XModule):
event_info = dict() event_info = dict()
event_info['state'] = self.lcp.get_state() event_info['state'] = self.lcp.get_state()
event_info['problem_id'] = self.location.url() event_info['problem_id'] = self.location.url()
event_info['student_id'] = self.system.anonymous_system_id
event_info['survey_responses']= get
answers = self.make_dict_of_responses(get)
log.debug(answers)
log.debug(event_info) log.debug(event_info)
return {'success' : True}
def closed(self): def closed(self):
''' Is the student still allowed to submit answers? ''' ''' Is the student still allowed to submit answers? '''
if self.attempts == self.max_attempts: if self.attempts == self.max_attempts:
......
...@@ -200,9 +200,21 @@ class @Problem ...@@ -200,9 +200,21 @@ class @Problem
message_post: => message_post: =>
Logger.log 'message_post', @answers Logger.log 'message_post', @answers
$.postWithPrefix "#{@url}/message_post", @answers, (response) =>
fd = new FormData()
feedback = @$('section.evaluation textarea.feedback-on-feedback')[0]
fd.append(feedback.class, feedback.value)
settings =
type: "POST"
data: fd
processData: false
contentType: false
success: (response) =>
@gentle_alert response.success @gentle_alert response.success
$.ajaxWithPrefix("#{@url}/message_post", settings)
reset: => reset: =>
Logger.log 'problem_reset', @answers Logger.log 'problem_reset', @answers
$.postWithPrefix "#{@url}/problem_reset", id: @id, (response) => $.postWithPrefix "#{@url}/problem_reset", id: @id, (response) =>
......
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