Commit 844fb033 by Vik Paruchuri

javascript transitions okay, can integrate open ended response now

parent 69d8c4a9
...@@ -64,10 +64,10 @@ class @CombinedOpenEnded ...@@ -64,10 +64,10 @@ class @CombinedOpenEnded
@next_problem_button.show() @next_problem_button.show()
else else
@next_problem_button.hide() @next_problem_button.hide()
if @allow_reset #if @allow_reset
@reset_button.show() @reset_button.show()
else #else
@reset_button.hide() # @reset_button.hide()
find_assessment_elements: -> find_assessment_elements: ->
...@@ -132,8 +132,7 @@ class @CombinedOpenEnded ...@@ -132,8 +132,7 @@ class @CombinedOpenEnded
reset: (event) => reset: (event) =>
event.preventDefault() event.preventDefault()
@errors_area.html('Problem state got out of sync. Try reloading the page.') if @child_state == 'done'
if @state == 'done'
$.postWithPrefix "#{@ajax_url}/reset", {}, (response) => $.postWithPrefix "#{@ajax_url}/reset", {}, (response) =>
if response.success if response.success
@answer_area.val('') @answer_area.val('')
...@@ -151,7 +150,6 @@ class @CombinedOpenEnded ...@@ -151,7 +150,6 @@ class @CombinedOpenEnded
next_problem: (event) => next_problem: (event) =>
event.preventDefault() event.preventDefault()
@errors_area.html('Problem state got out of sync. Try reloading the page.')
if @child_state == 'done' if @child_state == 'done'
$.postWithPrefix "#{@ajax_url}/next_problem", {}, (response) => $.postWithPrefix "#{@ajax_url}/next_problem", {}, (response) =>
if response.success if response.success
...@@ -161,7 +159,7 @@ class @CombinedOpenEnded ...@@ -161,7 +159,7 @@ class @CombinedOpenEnded
@message_wrapper.html('') @message_wrapper.html('')
@child_state = 'initial' @child_state = 'initial'
@rebind() @rebind()
@reset_button.hide() @next_problem_button.hide()
location.reload() location.reload()
else else
@errors_area.html(response.error) @errors_area.html(response.error)
......
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