Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project

This commit is contained in:
huang 2017-03-24 10:38:45 +08:00
commit b77ba2b751
1 changed files with 40 additions and 33 deletions

View File

@ -43,10 +43,10 @@
<span style="display: none" class="c_red ml90" id="new_shixun_pass">过关任务不能为空</span>
</li>
<li class="clearfix">
<% if params[:action] == "edit" && @challenge.challenge_samples.count > 0 %>
<% @challenge.challenge_samples.each_with_index do |sample, index| %>
<label class="panel-form-label fl">样例设置:</label>
<ul class="fl task-bg-grey">
<% if params[:action] == "edit" && @challenge.challenge_samples.count > 0 %>
<label class="panel-form-label fl">样例设置:</label>
<ul class="fl task-bg-grey">
<% @challenge.challenge_samples.each_with_index do |sample, index| %>
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="sample_inputs_label">样例<%= index + 1 %></span>
@ -61,32 +61,32 @@
<input type="text" class="panel-form-width-670 panel-form-height-30 mb10" name="sample[input][]" id="textarea_sample_input_test" placeholder="样例输入" value="<%= sample.input %>" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="sample[output][]" id="textarea_sample_output_test" placeholder="样例输出" value="<%= sample.output %>" />
</li>
</ul>
<% end %>
<% else %>
<label class="panel-form-label fl">样例设置:</label>
<ul class="fl task-bg-grey">
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="sample_inputs_label">样例1</span>
<span class="color-grey fr" style="font-size:12px;">温馨提示:输入样例供学员参考。</span>
<a href="javascript:void(0)" title="增加" class="sample_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="sample[input][]" id="textarea_sample_input_test" placeholder="样例输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="sample[output][]" id="textarea_sample_output_test" placeholder="样例输出" />
</li>
<% end %>
</ul>
<% end %>
<% else %>
<label class="panel-form-label fl">样例设置:</label>
<ul class="fl task-bg-grey">
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="sample_inputs_label">样例1</span>
<span class="color-grey fr" style="font-size:12px;">温馨提示:输入样例供学员参考。</span>
<a href="javascript:void(0)" title="增加" class="sample_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="sample[input][]" id="textarea_sample_input_test" placeholder="样例输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="sample[output][]" id="textarea_sample_output_test" placeholder="样例输出" />
</li>
</ul>
<% end %>
</li>
<li class="clearfix">
<label class="panel-form-label fl">测试用例:</label>
<ul class="fl task-bg-grey">
<li class="clearfix">
<% if params[:action] == "edit" && @challenge.test_sets.count > 0 %>
<% @challenge.test_sets.each_with_index do |test, index| %>
<% if params[:action] == "edit" && @challenge.test_sets.count > 0 %>
<label class="panel-form-label fl">测试集设置:</label>
<ul class="fl task-bg-grey">
<% @challenge.test_sets.each_with_index do |test, index| %>
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="inputs_label">测试<%= index + 1 %></span>
<% if index == 0 %>
<% if index == 0%>
<span class="color-grey fr" style="font-size:12px;">温馨提示:在学员"提交评测"时进行自动检测。</span>
<% end %>
<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>
@ -96,18 +96,23 @@
</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 panel-form-height-150" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ><%= test.output %></textarea>
<% end %>
<% else %>
</li>
<% end %>
</ul>
<% else %>
<label class="panel-form-label fl">测试集设置:</label>
<ul class="fl task-bg-grey">
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="inputs_label">测试1</span>
<span class="color-grey fr" style="font-size:12px;">温馨提示:在学员"提交评测"时进行自动检测。</span>
<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="输入用例名" />
<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 panel-form-height-150" id="textarea_output_test" name="program[output][]" placeholder="输入用例内容" ></textarea>
<% end %>
</li>
</ul>
</li>
</ul>
<% end %>
</li>
<li class="clearfix">
<label class=" panel-form-label fl"> 知识/技能点:</label>
@ -161,7 +166,8 @@
"allowFileManager":true,
afterBlur:function () { this.sync(); },
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
"fileManagerJson":"/kindeditor/filemanager"
});
challenge_task_editor = KindEditor.create('#challenge_ready_knowledge',
{"width":"87.5%",
"resizeType":0,
@ -171,7 +177,8 @@
"allowFileManager":true,
afterBlur:function () { this.sync(); },
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
"fileManagerJson":"/kindeditor/filemanager"
});
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-answer"), {
mode: {name: 'text/x-java',