Permalink
Browse files

Quick hack to fix javascript issue impeding new problem submission

  • Loading branch information...
1 parent 3846a84 commit 040aca3d34ef86a9b54e1bc6ad7f9b44b586a640 @dbyrne dbyrne committed Aug 3, 2011
Showing with 7 additions and 2 deletions.
  1. +6 −1 resources/public/script/foreclojure.js
  2. +1 −1 src/foreclojure/problems.clj
@@ -81,7 +81,7 @@ function configureCodeBox(){
var hiddenCodeInput = "<input type=\"hidden\" value=\"blank\" name=\"code\" id=\"code\">";
oldBox.replaceWith("<div id=\"code-div\"> <pre id=\"editor\">" + oldBox.val() + "</pre></div>"+hiddenCodeInput);
- if ($("#run-button").length){
+ if ($("#run-button").length || $("#submission-button").length){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/textmate");
@@ -172,6 +172,11 @@ function configureCodeBox(){
var text = editor.getSession().getValue();
$('#code').val(text);
});
+
+ $("#submission-button").click(function(){
+ var text = editor.getSession().getValue();
+ $('#code').val(text);
+ });
}
}
@@ -359,7 +359,7 @@ Return a map, {:message, :url, :num-tests-passed}."
(text-area {:id "code-box" :spellcheck "false"}
:code (session/flash-get :tests))
[:p
- [:button.large {:id "run-button" :type "submit"} "Submit"]]))
+ [:button.large {:id "submission-button" :type "submit"} "Submit"]]))
(defn create-problem
"create a user submitted problem"

0 comments on commit 040aca3

Please sign in to comment.