Commit b83df64f by Vik Paruchuri

Inline response to feedback

parent f7043497
...@@ -213,8 +213,11 @@ class CombinedOpenEndedModule(XModule): ...@@ -213,8 +213,11 @@ class CombinedOpenEndedModule(XModule):
last_response=task.latest_answer() last_response=task.latest_answer()
last_score = task.latest_score() last_score = task.latest_score()
last_post_assessment = task.latest_post_assessment() last_post_assessment = task.latest_post_assessment()
last_post_feedback=""
if task_type=="openended": if task_type=="openended":
last_post_assessment = task.latest_post_assessment(short_feedback=True) last_post_assessment = task.latest_post_assessment(short_feedback=True)
last_post_evaluation = task.format_feedback_with_evaluation(last_post_assessment)
last_post_assessment = last_post_evaluation
max_score = task.max_score() max_score = task.max_score()
state = task.state state = task.state
last_response_dict={'response' : last_response, 'score' : last_score, last_response_dict={'response' : last_response, 'score' : last_score,
......
...@@ -30,6 +30,8 @@ class @CombinedOpenEnded ...@@ -30,6 +30,8 @@ class @CombinedOpenEnded
@hint_wrapper = @$('.hint-wrapper') @hint_wrapper = @$('.hint-wrapper')
@message_wrapper = @$('.message-wrapper') @message_wrapper = @$('.message-wrapper')
@submit_button = @$('.submit-button') @submit_button = @$('.submit-button')
@submit_evaluation_button = @$('.submit-evaluation-button')
@submit_evaluation_button.click @message_post
@child_state = @el.data('state') @child_state = @el.data('state')
@child_type = @el.data('child-type') @child_type = @el.data('child-type')
if @child_type=="openended" if @child_type=="openended"
...@@ -134,7 +136,6 @@ class @CombinedOpenEnded ...@@ -134,7 +136,6 @@ class @CombinedOpenEnded
else else
@errors_area.html('Problem state got out of sync. Try reloading the page.') @errors_area.html('Problem state got out of sync. Try reloading the page.')
save_hint: (event) => save_hint: (event) =>
event.preventDefault() event.preventDefault()
if @child_state == 'post_assessment' if @child_state == 'post_assessment'
......
...@@ -404,6 +404,11 @@ class OpenEndedModule(openendedchild.OpenEndedChild): ...@@ -404,6 +404,11 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
correct = (score_ratio >= 0.66) correct = (score_ratio >= 0.66)
return correct return correct
def format_feedback_with_evaluation(self,feedback):
context={'msg' : feedback, id : "1", rows : 30, cols : 30}
html= render_to_string('open_ended_evaluation.html', context)
return html
def handle_ajax(self, dispatch, get, system): def handle_ajax(self, dispatch, get, system):
''' '''
This is called by courseware.module_render, to handle an AJAX call. This is called by courseware.module_render, to handle an AJAX call.
......
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