1、老师新建作业,两类作业的选择

2、编程作业静态页面的添加
This commit is contained in:
sw 2015-06-16 10:39:42 +08:00
parent d3837ba03c
commit 44e3daa0d2
3 changed files with 132 additions and 8 deletions

View File

@ -6,12 +6,114 @@
<%= l(:label_course_homework_new)%>
</h2>
</div>
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_common_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
<div class="hwork_new" id="hwork_new">
<h3 class="c_blue f16 mb10">请选择将要发布的作业类型
</h3>
<input type="radio" class="mb10 fl" name="homework_common_type" id="homework_detail_manual_radio" checked/><span class="ml5 fl">人工评分的作业(支持匿名互评、灵活设置评分比例)</span>
<div class="cl"></div>
<input type="radio" class="mb20 fl" name="homework_common_type" id="homework_detail_programing_radio"/><span class="ml5 fl">自动评测的编程作业支持C++程序的自动评分)</span>
<div class="cl"></div>
<a href="javascript:void(0);" class=" orange_btn" onclick="select_homework_common_type()">下一步</a>
</div><!--hwork_new end-->
<div class="cl"></div>
<div class="cl"></div>
<div id="homework_detail_manual" class="undis">
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_common_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<a href="javascript:void(0);" class="orange_btn_homework fl mr10" onclick="return_homework_common_type()">上一步</a>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
</div><!--hwork_new end-->
<div class="cl"></div>
</div>
<div id="homework_detail_programing" class="undis">
<div class="hwork_new">
<ul class="hwork_new_basic">
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称:&nbsp;</label>
<input type="text" name="" class="w548 h26 mb10 fl" >
</li>
<div class="cl"></div>
<li >
<label class="label02 ">&nbsp;&nbsp;作业描述及&nbsp;&nbsp;&nbsp;&nbsp;<br />评分依据:&nbsp;</label>
<textarea name="" placeholder="请在此填入作业的要求及评分依据" class=" w548 h150 mb10 fl" ></textarea>
</li>
<div class="cl"></div>
<li >
<label class="label02">&nbsp;&nbsp;附件:&nbsp;</label>
<input type="submit" name="" value="文件浏览" class="sub_btn">&nbsp;&nbsp;&nbsp;&nbsp;<span class=" c_grey ">-文件不超过200MB</span>
</li>
<div class="cl"></div>
<li class="fl">
<label class="label02"><span class="c_red">*</span>&nbsp;截止日期:&nbsp;</label>
<input type="text" name="" class="hwork_input02 fl" value="2015-04-03 12:00" >
<a href="javascript:void(0);" class="pic_date mt5 ml5"></a>
<div class="cl"></div>
</li>
<li class="fl ml100">
<label class="label02">&nbsp;发布日期:&nbsp;</label>
<input type="text" name="" class="hwork_input02 fl" value="2015-04-03 12:00" >
<a href="javascript:void(0);" class="pic_date mt5 ml5"></a>
<div class="cl"></div>
</li>
<div class="cl"></div>
<li>
<label class="label02">迟交扣分:&nbsp;</label>
<select class="fl mb10 h26 w70" name="s2" >
<option >1</option>
<option selected="selected">2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select>
<span class="fl mt5">&nbsp;分</span>
<div class="cl"></div>
</li>
</ul><!--hwork_new_basic end--->
<div class="hwork_new_set">
<p class="fl ml20 f14 mb10 c_orange">编程评测设置</p>
<div class="cl"></div>
<ul>
<li >
<label class="label02">&nbsp;开发语言:&nbsp;</label>
<select class="fl mb10 h26 w150" >
<option>C++</option>
</select>
<div class="cl"></div>
</li>
<li >
<label class="label02">&nbsp;标准代码:&nbsp;</label>
<textarea name="" class=" w459 h150 mb10 fl" ></textarea>
<div class="cl"></div>
</li>
<li >
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w196 mb10" />
</li>
<li >
<label class=" fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w196 mb10" />
</li>
<li><a class="icon_add ml10 " href="javascript:void(0);" title="添加测试"></a> <span class="green_btn fl ml5">OK&nbsp;!</span></li>
<div class="cl"></div>
<li >
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w196 mb10" />
</li>
<li >
<label class="fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w196 mb10" />
</li>
<li><a class="icon_add ml10 " href="javascript:void(0);" title="添加测试"></a> <a href="javascript:void(0);" class="green_btn fl ml5 ">测试</a></li>
<div class="cl"></div>
</ul>
</div><!--hwork_new_set end-->
<a href="courses_hworklist.html" class="blue_btn fl mr10 " >提交</a>
<a href="javascript:void(0);" class="orange_btn_homework fl mr10" onclick="return_homework_common_type()">上一步</a>
<a href="#" target="_blank" class="grey_btn fl ">取消</a>
</div><!--hwork_new end-->
<div class="cl"></div>
</div>

View File

@ -394,6 +394,27 @@ function show_bid_dead_line(year,month,day,divname)
+ "</form>"
+ "<p class='fr'>作品提交还剩:</p>");
}
//新建作业,下一步按钮
function select_homework_common_type()
{
if($("#homework_detail_manual_radio").attr("checked") == "checked"){
$("#homework_detail_manual").show();
}
else if($("#homework_detail_programing_radio").attr("checked") == "checked"){
$("#homework_detail_programing").show();
}
$("#hwork_new").hide();
}
//新建作业,上一步按钮
function return_homework_common_type()
{
$("#homework_detail_manual").hide();
$("#homework_detail_programing").hide();
$("#hwork_new").show();
}
//验证新建作业的名字
function regex_homework_name()
{

View File

@ -161,6 +161,7 @@ a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; pa
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{ background:#329cbd;cursor: pointer;}
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
a:hover.orange_btn{ background:#d63502;}