Commit 0ec1db81 by Vik Paruchuri

Add in a message area

parent 1e4c8595
......@@ -74,13 +74,9 @@ class @CombinedOpenEnded
@hint_area.attr('disabled', true)
@submit_button.hide()
if @task_number<@task_count
@next_problem_button.show()
@next_problem
else
@next_problem_button.hide()
#if @allow_reset
@reset_button.show()
#else
# @reset_button.hide()
find_assessment_elements: ->
......@@ -161,8 +157,7 @@ class @CombinedOpenEnded
else
@errors_area.html('Problem state got out of sync. Try reloading the page.')
next_problem: (event) =>
event.preventDefault()
next_problem: =>
if @child_state == 'done'
$.postWithPrefix "#{@ajax_url}/next_problem", {}, (response) =>
if response.success
......@@ -203,7 +198,7 @@ class @CombinedOpenEnded
processData: false
contentType: false
success: (response) =>
@gentle_alert response.message
@gentle_alert response.msg
@$('section.evaluation').slideToggle()
@message_wrapper.html(response.message_html)
@child_state = 'done'
......@@ -216,4 +211,5 @@ class @CombinedOpenEnded
if @el.find('.open-ended-alert').length
@el.find('.open-ended-alert').remove()
alert_elem = "<div class='open-ended-alert'>" + msg + "</div>"
@el.find('.open-ended-action').after(alert_elem)
@el.find('.open-ended-alert').css(opacity: 0).animate(opacity: 1, 700)
\ No newline at end of file
......@@ -8,6 +8,5 @@
<input type="button" value="Reset" class="reset-button" name="reset"/>
<input type="button" value="Next Step" class="next-step-button" name="reset"/>
</section>
<section id="combined-open-ended-status" class="combined-open-ended-status">
%for status in status_list:
<statusitem>
<div class="statusitem">
Step ${status['task_number']} (${status['state']}) : ${status['score']} / ${status['max_score']}
%if status['type']=="openended":
${status['post_assessment']}
%endif
</statusitem>
</div>
%endfor
</section>
\ No newline at end of file
......@@ -51,5 +51,6 @@
</div>
% endif
</div>
<div class="open-ended-action"></div>
<div class="open-ended-alert"></div>
</section>
......@@ -16,4 +16,6 @@
<div class="message-wrapper">${initial_message}</div>
<input type="button" value="Submit" class="submit-button" name="show"/>
<div class="open-ended-action"></div>
<div class="open-ended-alert"></div>
</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