Skip to content
This repository
Browse code

Quick hack to fix javascript issue impeding new problem submission

  • Loading branch information...
commit 040aca3d34ef86a9b54e1bc6ad7f9b44b586a640 1 parent 3846a84
David Byrne dbyrne authored
7 resources/public/script/foreclojure.js
@@ -81,7 +81,7 @@ function configureCodeBox(){
81 81 var hiddenCodeInput = "<input type=\"hidden\" value=\"blank\" name=\"code\" id=\"code\">";
82 82 oldBox.replaceWith("<div id=\"code-div\"> <pre id=\"editor\">" + oldBox.val() + "</pre></div>"+hiddenCodeInput);
83 83
84   - if ($("#run-button").length){
  84 + if ($("#run-button").length || $("#submission-button").length){
85 85 var editor = ace.edit("editor");
86 86 editor.setTheme("ace/theme/textmate");
87 87
@@ -172,6 +172,11 @@ function configureCodeBox(){
172 172 var text = editor.getSession().getValue();
173 173 $('#code').val(text);
174 174 });
  175 +
  176 + $("#submission-button").click(function(){
  177 + var text = editor.getSession().getValue();
  178 + $('#code').val(text);
  179 + });
175 180 }
176 181 }
177 182
2  src/foreclojure/problems.clj
@@ -359,7 +359,7 @@ Return a map, {:message, :url, :num-tests-passed}."
359 359 (text-area {:id "code-box" :spellcheck "false"}
360 360 :code (session/flash-get :tests))
361 361 [:p
362   - [:button.large {:id "run-button" :type "submit"} "Submit"]]))
  362 + [:button.large {:id "submission-button" :type "submit"} "Submit"]]))
363 363
364 364 (defn create-problem
365 365 "create a user submitted problem"

0 comments on commit 040aca3

Please sign in to comment.
Something went wrong with that request. Please try again.