Add in more js to handle student feedback
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
% if status in ['correct','incorrect']:
|
||||
<section id="evaluation_${id}" class="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"/>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
@@ -402,11 +402,13 @@ class CapaModule(XModule):
|
||||
event_info = dict()
|
||||
event_info['state'] = self.lcp.get_state()
|
||||
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)
|
||||
|
||||
return {'success' : True}
|
||||
|
||||
def closed(self):
|
||||
''' Is the student still allowed to submit answers? '''
|
||||
if self.attempts == self.max_attempts:
|
||||
|
||||
@@ -200,8 +200,20 @@ class @Problem
|
||||
|
||||
message_post: =>
|
||||
Logger.log 'message_post', @answers
|
||||
$.postWithPrefix "#{@url}/message_post", @answers, (response) =>
|
||||
@gentle_alert response.success
|
||||
|
||||
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
|
||||
|
||||
$.ajaxWithPrefix("#{@url}/message_post", settings)
|
||||
|
||||
reset: =>
|
||||
Logger.log 'problem_reset', @answers
|
||||
|
||||
Reference in New Issue
Block a user