From 91a9962bef454d5ef626d3680a515a42a88a498b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 4 Jan 2013 09:59:25 -0500 Subject: [PATCH] Improve next problem handling and state tracking --- .../xmodule/js/src/combinedopenended/display.coffee | 13 +++++++++---- lms/templates/combined_open_ended.html | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index a7aee1b895..0e8cadd69f 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -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') diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index 65a57b98eb..51afddcd15 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -5,5 +5,6 @@ % endfor +