2015-08-25 19:18:56 +08:00
|
|
|
|
<script type="text/javascript">
|
2015-08-28 16:56:09 +08:00
|
|
|
|
function reset_homework(){
|
|
|
|
|
$("#homework_name").val("");
|
2015-10-30 13:58:54 +08:00
|
|
|
|
$("#homework_publish_time").val("");
|
2015-09-01 16:59:54 +08:00
|
|
|
|
$("#homework_end_time").val("");
|
|
|
|
|
$("#course_id").val($("#option_select").val());
|
2015-09-11 10:36:16 +08:00
|
|
|
|
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true })%>");
|
2015-08-28 16:56:09 +08:00
|
|
|
|
homework_description_editor.html("");
|
2015-09-01 17:08:52 +08:00
|
|
|
|
$("#homework_editor").toggle();
|
2015-08-28 16:56:09 +08:00
|
|
|
|
}
|
2015-10-12 15:51:47 +08:00
|
|
|
|
|
|
|
|
|
// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
|
|
|
|
|
function store_seleted_resource(dom){
|
|
|
|
|
if(dom.attr('checked') == 'checked' ){
|
|
|
|
|
$.get(
|
|
|
|
|
'<%= store_selected_resource_user_path %>'+'?save=y&res_id='+dom.val()
|
|
|
|
|
)
|
|
|
|
|
}else {
|
|
|
|
|
$.get(
|
|
|
|
|
'<%= store_selected_resource_user_path %>'+'?save=n&res_id='+dom.val()
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-25 19:18:56 +08:00
|
|
|
|
</script>
|
2015-09-02 14:24:11 +08:00
|
|
|
|
<div class="homepageRightBanner mb10">
|
|
|
|
|
<div class="NewsBannerName">作业</div>
|
2015-09-02 10:25:22 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-08-25 19:18:56 +08:00
|
|
|
|
|
2015-09-08 16:36:50 +08:00
|
|
|
|
<% if @is_teacher%>
|
2015-08-25 13:50:42 +08:00
|
|
|
|
<!-- 老师身份才可以发布作业 -->
|
2015-08-28 16:59:40 +08:00
|
|
|
|
<div class="HomeWork mb10">
|
2015-08-26 13:56:37 +08:00
|
|
|
|
<% homework = HomeworkCommon.new %>
|
2015-09-21 17:11:45 +08:00
|
|
|
|
<% homework.homework_detail_manual = HomeworkDetailManual.new%>
|
2015-08-26 17:29:47 +08:00
|
|
|
|
<%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
|
2015-08-28 11:32:57 +08:00
|
|
|
|
<div id="HomeWorkCon">
|
|
|
|
|
<%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %>
|
|
|
|
|
</div>
|
2015-08-26 13:56:37 +08:00
|
|
|
|
<% end%>
|
2015-08-25 13:50:42 +08:00
|
|
|
|
</div><!----HomeWork end-->
|
|
|
|
|
<% end%>
|
|
|
|
|
|
2015-09-28 17:27:01 +08:00
|
|
|
|
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0,:is_in_course => 0} %>
|