33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
<%= javascript_include_tag 'baiduTemplate', 'jquery.datetimepicker.js' %>
|
|
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
|
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
|
<%= form_tag(:controller => 'games', :action => 'file_update', :id => @game, :myshixun_id => @myshixun) do%>
|
|
<li class="clearfix" xmlns="http://www.w3.org/1999/html">
|
|
<label class=" panel-form-label fl"> 参考答案:</label>
|
|
<textarea class = "panel-form-width-690 panel-form-height-150 fl task-textarea-pd">
|
|
<%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %>
|
|
</textarea>
|
|
<script>
|
|
var text = document.getElementById("challenge-answer");
|
|
</script>
|
|
</li>
|
|
<% end %>
|
|
|
|
<script type="text/javascript">
|
|
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-answer"), {
|
|
mode: {name: 'text/x-java',
|
|
version: 2,
|
|
singleLineStringErrors: false},
|
|
lineNumbers: true,
|
|
indentUnit: 2,
|
|
matchBrackets: true
|
|
});
|
|
|
|
editor.on('change',function(cMirror){
|
|
// get value right from instance
|
|
$('#challenge-answer').val(cMirror.getValue());
|
|
});
|
|
|
|
|
|
|
|
</script> |