Commit 91a9962b by Vik Paruchuri

Improve next problem handling and state tracking

parent d5c3b58d
......@@ -7,6 +7,8 @@ class @CombinedOpenEnded
@allow_reset = @el.data('allow_reset')
@reset_button = @$('.reset-button')
@reset_button.click @reset
@next_problem_button = @$('.next-step-button')
@next_problem_button.click @next_problem
@combined_open_ended= @$('.combined-open-ended')
# valid states: 'initial', 'assessing', 'post_assessment', 'done'
......@@ -37,6 +39,7 @@ class @CombinedOpenEnded
@submit_button.unbind('click')
@submit_button.show()
@reset_button.hide()
@next_problem_button.hide()
@hint_area.attr('disabled', false)
if @child_state == 'initial'
@answer_area.attr("disabled", false)
......@@ -54,10 +57,12 @@ class @CombinedOpenEnded
@answer_area.attr("disabled", true)
@hint_area.attr('disabled', true)
@submit_button.hide()
if @allow_reset
@reset_button.show()
else
@reset_button.hide()
if !@state == 'done'
@next_problem_button.show()
if @allow_reset
@reset_button.show()
else
@reset_button.hide()
find_assessment_elements: ->
@assessment = @$('select.assessment')
......
......@@ -5,5 +5,6 @@
% endfor
<input type="button" value="Reset" class="reset-button" name="reset"/>
<input type="button" value="Next Step" class="next-step-button" name="reset"/>
</section>
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