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

This commit is contained in:
huang 2017-03-16 10:26:22 +08:00
commit 8527fc857e
2 changed files with 50 additions and 27 deletions

View File

@ -3,13 +3,24 @@
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="sample_inputs_label"></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>
<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>
<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>
<a href="javascript:void(0)" title="删除" class="sample_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][]" id="textarea_input_test" placeholder="样例输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="program[output][]" id="textarea_output_test" placeholder="样例输出" />
</li>
</script>
<script id="t:test-answer-list" type="text/html">
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl" name="inputs_label"></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>
<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="测试输出" />
</li>
</script>
<div id="shixun_form">
<li class="clearfix">
<label class=" panel-form-label fl"><span class="c_red mr5">*</span>名称:</label>
@ -30,10 +41,10 @@
<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="test_icon_add"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt12"></i></a>
<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="program[input][]" id="textarea_input_test" placeholder="样例输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="program[output][]" id="textarea_output_test" placeholder="样例输出" />
<input type="text" class="panel-form-width-670 panel-form-height-30 mb10" name="program[input][]" id="textarea_sample_input_test" placeholder="样例输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30" name="program[output][]" id="textarea_sample_output_test" placeholder="样例输出" />
</li>
</ul>
</li>
@ -42,13 +53,12 @@
<ul class="fl task-bg-grey ">
<li class="clearfix">
<p class="clearfix">
<span class="color-green fb fl">测试1</span>
<span class="color-green fb fl" name="inputs_label">测试1</span>
<span class="color-grey fr" style="font-size:12px;">温馨提示:在学员"提交评测"时进行自动检测。</span>
<a href="#" title="增加"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt12"></i></a>
<a href="#" title="删除"><i class="fa fa-times-circle color-grey font-16 ml10 fl mt12"></i></a>
<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" placeholder="测试输入" />
<input type="text" class="panel-form-width-670 panel-form-height-30 " placeholder="测试输出" />
<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" name="program[output][]" id="textarea_output_test" placeholder="测试输出" />
</li>
</ul>
</li>
@ -59,23 +69,11 @@
<button data-dismiss="alert" class="close fr mt3 ml5" type="button">×</button>
使用交互模式的 Python3 解释器
</div>
<div class="task-tag tag-grey mb10 mr10 fl">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button">×</button>
简单使用 vim 编写脚本文件并执行这个脚本文件
</div>
<div class="task-tag tag-grey mb10 mr10 fl">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button">×</button>
Python 语法:缩进
</div>
<div class="task-tag tag-grey mb10 mr10 fl">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button">×</button>
规范代码风格和注释
</div>
<div class="task-tag tag-grey mb10 mr10 fl">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button">×</button>
<button class="close fl mt3 mr10" type="button" onclick="$('#add_shixun_skill').slideToggle();">+</button>
<div class="task-tag tag-grey mb10 mr10 fl undis" id="add_shixun_skill">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
<input type="text" class=" task-tag-input" placeholder="请输入完成本任务得到的技能1个" />
</div>
<button class="close fl mt3 " type="button">+</button>
</div>
</li>
<li class="clearfix">
@ -101,6 +99,31 @@
bt.RIGHT_DELIMITER = '!>';
$("#shixun_form").on('click', 'a.test_icon_add', function () {
var html = bt('t:test-answer-list', null);
$(this).parent().parent('.clearfix').after(html);
var inputs = document.getElementsByName("program[input][]");
var outputs = document.getElementsByName("program[output][]");
var inputs_labels = document.getElementsByName("inputs_label");
for (var j = 0; j < inputs_labels.length; j++) {
$(inputs_labels[j]).html("测试"+ (j + 1));
}
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);
}
}
$(inputs[inputs.length - 1]).focus();
});
$("#shixun_form").on('click', 'a.test_icon_remove', function () {
$(this).parent().parent('.clearfix').remove();
var inputs_labels = document.getElementsByName("inputs_label");
for (var j = 0; j < inputs_labels.length; j++) {
$(inputs_labels[j]).html("测试" + (j + 1));
}
});
$("#shixun_form").on('click', 'a.sample_icon_add', function () {
var html = bt('t:sample-answer-list', null);
$(this).parent().parent('.clearfix').after(html);
var inputs = document.getElementsByName("sample[input][]");
@ -117,7 +140,7 @@
}
$(inputs[inputs.length - 1]).focus();
});
$("#shixun_form").on('click', 'a.test_icon_remove', function () {
$("#shixun_form").on('click', 'a.sample_icon_remove', function () {
$(this).parent().parent('.clearfix').remove();
var inputs_labels = document.getElementsByName("sample_inputs_label");
for (var j = 0; j < inputs_labels.length; j++) {

View File

@ -16,7 +16,7 @@
<% end %>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag02').slideToggle();"><%= l(:label_add_tag)%></a>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag02').slideToggle();"><%= l(:label_add_tag) %></a>
<span id="add_tag02" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote => true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name2",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>