Merge branch 'develop' into szzh
This commit is contained in:
commit
2c0de45330
|
@ -89,6 +89,7 @@ class WordsController < ApplicationController
|
||||||
elsif @journal_destroyed.jour_type == "Principal"
|
elsif @journal_destroyed.jour_type == "Principal"
|
||||||
@user = User.find(@journal_destroyed.jour_id)
|
@user = User.find(@journal_destroyed.jour_id)
|
||||||
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
||||||
|
@is_user = true
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -1,42 +1,4 @@
|
||||||
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
||||||
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html">
|
|
||||||
function regexName()
|
|
||||||
{
|
|
||||||
var name = $.trim($("#homework_attach_name").val());
|
|
||||||
|
|
||||||
if(name=="")
|
|
||||||
{
|
|
||||||
$("#homework_attach_name_span").text("作品名称不能为空");
|
|
||||||
$("#homework_attach_name_span").css('color','#ff0000');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#homework_attach_name_span").text("填写正确");
|
|
||||||
$("#homework_attach_name_span").css('color','#008000');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function regexDescription()
|
|
||||||
{
|
|
||||||
var name = $.trim($("#homework_attach_description").val());
|
|
||||||
|
|
||||||
if(name=="")
|
|
||||||
{
|
|
||||||
$("#homework_attach_description_span").text("作品描述不能为空");
|
|
||||||
$("#homework_attach_description_span").css('color','#ff0000');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#homework_attach_description_span").text("填写正确");
|
|
||||||
$("#homework_attach_description_span").css('color','#008000');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function submit_homework_form(){if(regexName()&®exDescription()){$('#new_homework_attach').submit();}}
|
|
||||||
</script>
|
|
||||||
<div class="container" id="content">
|
<div class="container" id="content">
|
||||||
<div class="Newwork">
|
<div class="Newwork">
|
||||||
<div id="tb_" class="tb_">
|
<div id="tb_" class="tb_">
|
||||||
|
@ -69,7 +31,7 @@
|
||||||
</span>
|
</span>
|
||||||
作品名称 :
|
作品名称 :
|
||||||
</label>
|
</label>
|
||||||
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();" %>
|
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexHomeworkCommonName();" %>
|
||||||
<span id="homework_attach_name_span"></span>
|
<span id="homework_attach_name_span"></span>
|
||||||
</p>
|
</p>
|
||||||
<p style="float:left;">
|
<p style="float:left;">
|
||||||
|
@ -79,7 +41,7 @@
|
||||||
</span>
|
</span>
|
||||||
作品描述 :
|
作品描述 :
|
||||||
</label>
|
</label>
|
||||||
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
|
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexHomeworkCommonDescription();"%>
|
||||||
<p id="homework_attach_description_span" style="padding-left: 100px;"></p>
|
<p id="homework_attach_description_span" style="padding-left: 100px;"></p>
|
||||||
</p>
|
</p>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<li >
|
<li >
|
||||||
<label class="label02"> 开发语言: </label>
|
<label class="label02"> 开发语言: </label>
|
||||||
<select class="fl mb10 h26 w150" >
|
<select class="fl mb10 h26 w150" >
|
||||||
<option>C++</option>
|
<option>C</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -89,11 +89,11 @@
|
||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<label class="label02"> 测试输入: </label>
|
<label class="label02"> 测试输入: </label>
|
||||||
<input type="text" class="fl h26 w186 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
|
<input type="text" class="fl h26 w200 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
|
||||||
</li>
|
</li>
|
||||||
<li >
|
<li >
|
||||||
<label class=" fl f14 ml10"> 输出: </label>
|
<label class=" fl f14 ml10"> 输出: </label>
|
||||||
<input type="text" class="fl h26 w186 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
|
<input type="text" class="fl h26 w200 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
||||||
|
@ -107,11 +107,11 @@
|
||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<label class="label02"> 测试输入: </label>
|
<label class="label02"> 测试输入: </label>
|
||||||
<input type="text" class="fl h26 w186 mb10" name="input[0]" />
|
<input type="text" class="fl h26 w200 mb10" name="input[0]" />
|
||||||
</li>
|
</li>
|
||||||
<li >
|
<li >
|
||||||
<label class=" fl f14 ml10"> 输出: </label>
|
<label class=" fl f14 ml10"> 输出: </label>
|
||||||
<input type="text" class="fl h26 w186 mb10" name="output[0]" />
|
<input type="text" class="fl h26 w200 mb10" name="output[0]" />
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
|
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
|
||||||
<span class="ml5 fl">
|
<span class="ml5 fl">
|
||||||
自动评测的编程作业(支持C++程序的自动评分)
|
自动评测的编程作业(支持C程序的自动评分)
|
||||||
</span>
|
</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
|
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
|
||||||
|
|
|
@ -72,4 +72,5 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
</div><!---ping_box end--->
|
</div><!---ping_box end--->
|
||||||
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||||
|
<div class="cl"></div>
|
||||||
</div><!---show_hwork end--->
|
</div><!---show_hwork end--->
|
|
@ -1,12 +1,11 @@
|
||||||
<% if @journal_destroyed.nil? %>
|
<% if @journal_destroyed.nil? %>
|
||||||
alert('<%=l(:notice_failed_delete)%>');
|
alert('<%=l(:notice_failed_delete)%>');
|
||||||
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
|
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
|
||||||
<% if @user && @jours_count%>
|
<% if @is_user%>
|
||||||
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
|
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
|
||||||
var params = init_list_more_div_params($("#nh_messages"));
|
var params = init_list_more_div_params($("#nh_messages"));
|
||||||
change_status_4_list_more_div(params);
|
change_status_4_list_more_div(params);
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<% if @bid && @jours_count %>
|
<% if @bid && @jours_count %>
|
||||||
$('#jours_count').html("<%= @jours_count %>");
|
$('#jours_count').html("<%= @jours_count %>");
|
||||||
<% elsif @course && @jours_count%>
|
<% elsif @course && @jours_count%>
|
||||||
|
@ -24,3 +23,4 @@
|
||||||
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
|
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
|
||||||
$('#new_form_reference_user_id').val("");
|
$('#new_form_reference_user_id').val("");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -506,14 +506,51 @@ function submit_homework(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function regexHomeworkCommonName()
|
||||||
|
{
|
||||||
|
var name = $.trim($("#homework_attach_name").val());
|
||||||
|
|
||||||
|
if(name=="")
|
||||||
|
{
|
||||||
|
$("#homework_attach_name_span").text("作品名称不能为空");
|
||||||
|
$("#homework_attach_name_span").css('color','#ff0000');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#homework_attach_name_span").text("填写正确");
|
||||||
|
$("#homework_attach_name_span").css('color','#008000');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function regexHomeworkCommonDescription()
|
||||||
|
{
|
||||||
|
var name = $.trim($("#homework_attach_description").val());
|
||||||
|
|
||||||
|
if(name=="")
|
||||||
|
{
|
||||||
|
$("#homework_attach_description_span").text("作品描述不能为空");
|
||||||
|
$("#homework_attach_description_span").css('color','#ff0000');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#homework_attach_description_span").text("填写正确");
|
||||||
|
$("#homework_attach_description_span").css('color','#008000');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submit_homework_form(){if(regexHomeworkCommonName()&®exHomeworkCommonDescription()){$('#new_homework_attach').submit();}}
|
||||||
|
|
||||||
//增加测试结果
|
//增加测试结果
|
||||||
function add_programing_test(obj) {
|
function add_programing_test(obj) {
|
||||||
var now = new Date().getTime();
|
var now = new Date().getTime();
|
||||||
obj.after("<div><li><label class='label02'> 测试输入: </label><input type='text' class='fl h26 w186 mb10' name='input[" + now +"]'' />" +
|
obj.after("<div><li><label class='label02'> 测试输入: </label><input type='text' class='fl h26 w200 mb10' name='input[" + now +"]'' />" +
|
||||||
"</li><li ><label class='fl f14 ml10'> 输出: </label><input type='text' class='fl h26 w186 mb10' name='output[" + now +"]' />" +
|
"</li><li ><label class='fl f14 ml10'> 输出: </label><input type='text' class='fl h26 w200 mb10' name='output[" + now +"]' />" +
|
||||||
"</li><li><a class='icon_add ml10' href='javascript:void(0);' title='添加测试' onclick='add_programing_test($(this).parent().parent())'></a>" +
|
"</li><li><a class='icon_add ml10' href='javascript:void(0);' title='添加测试' onclick='add_programing_test($(this).parent().parent())'></a>" +
|
||||||
"<a class='icon_remove' href='javascript:void(0);' title='删除测试' onclick='remove_programing_test($(this).parent().parent())'></a>" +
|
"<a class='icon_remove' href='javascript:void(0);' title='删除测试' onclick='remove_programing_test($(this).parent().parent())'></a>" +
|
||||||
"<span class='green_btn fl ml5 mt1'>测试</span></li><div class='cl'></div></div>");
|
"</li><div class='cl'></div></div>");
|
||||||
}
|
}
|
||||||
//删除测试结果
|
//删除测试结果
|
||||||
function remove_programing_test(obj) {
|
function remove_programing_test(obj) {
|
||||||
|
|
|
@ -609,6 +609,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
|
||||||
.w547{ width:544px;}
|
.w547{ width:544px;}
|
||||||
.w196{ width:196px;}
|
.w196{ width:196px;}
|
||||||
.w186{ width:186px;}
|
.w186{ width:186px;}
|
||||||
|
.w200{width: 200px;}
|
||||||
.w459{ width:459px;}
|
.w459{ width:459px;}
|
||||||
.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
|
.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
|
||||||
.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}
|
.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}
|
||||||
|
|
Loading…
Reference in New Issue