$('<%= "#answer_#{@answer.id}"%>').replaceWith(
    '<%= escape_javascript(render partial: 'course/assessment/answer/answer', object: @new_answer) %>'
);

<% if @assessment.autograded? && next_unanswered_question.nil? %>
  $('input.finalise').first().show();
<% end %>

$('.expected').shorten({
  'showChars': 140,
  'moreText': I18n.t('common.show_more'),
  'lessText': I18n.t('common.show_less')
});

$('<%= "#answer_#{@answer.id}"%>').replaceWith(
    '<%= escape_javascript(render partial: 'course/assessment/answer/answer', object: @new_answer) %>'
);

<% if @assessment.autograded? && next_unanswered_question.nil? %>
  $('input.finalise').first().show();
<% end %>

$('.expected').shorten({
  'showChars': 140,
  'moreText': I18n.t('common.show_more'),
  'lessText': I18n.t('common.show_less')
});

$('textarea.code').ace();

Initialize ace editor on answer reload.
Initialize ace editor on answer reload.
