function setAceEditor() {
  var textarea = document.getElementById("editor");
  var form = textarea.form

  editor = ace.edit(textarea)
  language = $(":selected").html()
  changeEditorLanguage(language)
  editor.container.id = "ta"

  form.addEventListener("submit", function() {    
    textarea.style.visibility = "hidden"
    textarea.value = editor.getValue()
    form.appendChild(textarea)
  });
};

function onSelectChange() {
  $("#exercise_language_id").change(function() {
    language = $(":selected").html()
    changeEditorLanguage(language)
  });
};

function changeEditorLanguage(language) {
  editor.getSession().setMode("ace/mode/"+language.toLowerCase())
};


$(document).ready(function() {
  setAceEditor()
  onSelectChange()
});
@@ -129,16 +129,58 @@
 xtarea)%0A
+  editor.getSession().setUseWorker(false)%0A
   langua

Fix ace editor problem on production