Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project
This commit is contained in:
commit
3482ececf9
|
@ -22,7 +22,7 @@
|
|||
<a href="javascript:void(0);" title="删除" class="test_icon_remove"><i class="fa fa-times-circle color-grey font-16 ml10 fl mt12"></i></a>
|
||||
</p>
|
||||
<input type="text" class="panel-form-width-670 panel-form-height-30 mb10" name="program[input][]" placeholder="测试输入" />
|
||||
<input type="text" class="panel-form-width-670 panel-form-height-30" name="program[output][]" placeholder="测试输出" />
|
||||
<textarea class="panel-form-width-670 panel-form-height-150" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ></textarea>
|
||||
</li>
|
||||
</script>
|
||||
<div id="shixun_form">
|
||||
|
@ -33,10 +33,12 @@
|
|||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">预备知识:</label>
|
||||
<%= f.text_area :ready_knowledge, :class => "panel-form-width-690 panel-form-height-150 fl task-textarea-pd", :no_label => true, :placeholder => "请输入完成当前任务依赖的知识点或者其它相关信息,指导学员完成任务" %>
|
||||
<%= f.kindeditor :ready_knowledge, :placeholder => "请输入完成当前任务依赖的知识点或者其它相关信息,指导学员完成任务", :width=>'87.5%', :height =>159, :resizeType => 0, :no_label => true %>
|
||||
<%#= f.text_area :ready_knowledge, :class => "panel-form-width-690 panel-form-height-150 fl task-textarea-pd", :no_label => true, :placeholder => "请输入完成当前任务依赖的知识点或者其它相关信息,指导学员完成任务" %>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>过关任务:</label>
|
||||
<%#= f.kindeditor :task_pass, :editor_id => "challenge_task_pass", :width=>'87.5%', :height => 159, :resizeType => 0, :no_label => true %>
|
||||
<%= f.text_area :task_pass, :class => "panel-form-width-690 panel-form-height-150 fl task-textarea-pd", :no_label => true %>
|
||||
<span style="display: none" class="c_red ml90" id="new_shixun_pass">过关任务不能为空</span>
|
||||
</li>
|
||||
|
@ -47,7 +49,7 @@
|
|||
<ul class="fl task-bg-grey">
|
||||
<li class="clearfix">
|
||||
<p class="clearfix">
|
||||
<span class="color-green fb fl" name="sample_inputs_label">样例<%= index + 1%></span>
|
||||
<span class="color-green fb fl" name="sample_inputs_label">样例<%= index + 1 %></span>
|
||||
<% if index == 0 %>
|
||||
<span class="color-grey fr" style="font-size:12px;">温馨提示:输入样例供学员参考。</span>
|
||||
<% end %>
|
||||
|
@ -93,7 +95,7 @@
|
|||
<% end %>
|
||||
</p>
|
||||
<input type="text" class="panel-form-width-670 panel-form-height-30 mb10" name="program[input][]" id="textarea_input_test" value="<%= test.input %>"/>
|
||||
<textarea class="panel-form-width-670 fl" style="height: 150px;" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ><%= test.output %></textarea>
|
||||
<textarea class="panel-form-width-670 panel-form-height-150" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ><%= test.output %></textarea>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="clearfix">
|
||||
|
@ -102,7 +104,7 @@
|
|||
<a href="javascript:void(0);" title="增加" class="test_icon_add"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt12"></i></a>
|
||||
</p>
|
||||
<input type="text" class="panel-form-width-670 panel-form-height-30 mb10" name="program[input][]" id="textarea_input_test" placeholder="输入用例名" />
|
||||
<textarea class="panel-form-width-670 fl" style="height: 150px;" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ></textarea>
|
||||
<textarea class="panel-form-width-670 panel-form-height-150" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ></textarea>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -150,6 +152,27 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
challenge_knowledge_editor = KindEditor.create('#challenge_task_pass',
|
||||
{"width":"87.5%",
|
||||
"resizeType":0,
|
||||
"no_label":true,
|
||||
"autoHeightMode":true,
|
||||
"height":200,
|
||||
"allowFileManager":true,
|
||||
afterBlur:function () { this.sync(); },
|
||||
"uploadJson":"/kindeditor/upload",
|
||||
"fileManagerJson":"/kindeditor/filemanager"});
|
||||
challenge_task_editor = KindEditor.create('#challenge_ready_knowledge',
|
||||
{"width":"87.5%",
|
||||
"resizeType":0,
|
||||
"no_label":true,
|
||||
"autoHeightMode":true,
|
||||
"height":200,
|
||||
"allowFileManager":true,
|
||||
afterBlur:function () { this.sync(); },
|
||||
"uploadJson":"/kindeditor/upload",
|
||||
"fileManagerJson":"/kindeditor/filemanager"});
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-answer"), {
|
||||
mode: {name: 'text/x-java',
|
||||
version: 2,
|
||||
|
@ -200,8 +223,8 @@
|
|||
}
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
autoTextarea2(inputs[i], outputs[i], 0, 140);
|
||||
autoTextarea2(outputs[i], inputs[i], 0, 140);
|
||||
// autoTextarea2(inputs[i], outputs[i], 0, 140);
|
||||
// autoTextarea2(outputs[i], inputs[i], 0, 140);
|
||||
}
|
||||
}
|
||||
$(inputs[inputs.length - 1]).focus();
|
||||
|
@ -241,12 +264,12 @@
|
|||
});
|
||||
var text1 = document.getElementById("textarea_sample_input_test");
|
||||
var text2 = document.getElementById("textarea_sample_output_test");
|
||||
autoTextarea(text1, 0, 140);
|
||||
autoTextarea(text2, 0, 140);
|
||||
// autoTextarea(text1, 0, 140);
|
||||
// autoTextarea(text2, 0, 140);
|
||||
var text3 = document.getElementById("textarea_input_test");
|
||||
var text4 = document.getElementById("textarea_output_test");
|
||||
autoTextarea2(text3, text4, 0, 140);
|
||||
autoTextarea2(text4, text3, 0, 140);
|
||||
// autoTextarea2(text3, text4, 0, 140);
|
||||
// autoTextarea2(text4, text3, 0, 140);
|
||||
$("#challenge_score").keyup(function(){
|
||||
(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)
|
||||
});
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">预备知识:</label>
|
||||
<div class="fl task-bg-grey">
|
||||
<%= @challenge.ready_knowledge.blank? ? "无" : (h @challenge.ready_knowledge) %>
|
||||
<%= @challenge.ready_knowledge.blank? ? "无" : (h @challenge.ready_knowledge.html_safe) %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>过关任务:</label>
|
||||
<div class="fl task-bg-grey">
|
||||
<%= h @challenge.task_pass %>
|
||||
<%= h @challenge.task_pass.html_safe %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
|
|
Loading…
Reference in New Issue