2015-09-10 17:11:16 +08:00
|
|
|
<script type="text/javascript">
|
2016-03-17 17:34:29 +08:00
|
|
|
<% if @is_in_course == 1 || @course_activity == 1 %>
|
|
|
|
$(function(){
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
});
|
|
|
|
<% end %>
|
2015-09-10 17:11:16 +08:00
|
|
|
function reset_homework(){
|
|
|
|
$("#homework_name").val("");
|
2015-10-30 13:58:54 +08:00
|
|
|
$("#homework_publish_time").val("");
|
2015-09-10 17:11:16 +08:00
|
|
|
$("#homework_end_time").val("");
|
|
|
|
$("#course_id").val($("#option_select").val());
|
|
|
|
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
|
2016-02-02 15:50:28 +08:00
|
|
|
//homework_description_editor.html("");
|
|
|
|
$("#homework_name_span").text("");
|
|
|
|
$("#homework_end_time_span").text("");
|
|
|
|
$("#homework_end_time_span").text("");
|
|
|
|
$("#homework_course_id_span").text("");
|
2015-09-10 17:11:16 +08:00
|
|
|
$("#homework_editor").toggle();
|
|
|
|
}
|
2015-11-04 10:45:02 +08:00
|
|
|
function cancel_edit(){
|
|
|
|
<% if @is_in_course == 1 %>
|
|
|
|
window.location.href='<%=homework_common_index_path(:course => @course.id) %>';
|
|
|
|
<% elsif @is_in_course == 0 %>
|
|
|
|
window.location.href='<%=user_homeworks_user_path(User.current.id) %>';
|
|
|
|
<% elsif @is_in_course == -1 && @course_activity == 0 %>
|
|
|
|
window.location.href='<%=user_path(User.current.id) %>';
|
|
|
|
<% elsif @is_in_course == -1 && @course_activity == 1 %>
|
|
|
|
window.location.href='<%=course_path(@course.id) %>';
|
|
|
|
<% end %>
|
|
|
|
}
|
2015-09-10 17:11:16 +08:00
|
|
|
</script>
|
2016-03-17 17:34:29 +08:00
|
|
|
<div class="homepageRightBanner mb10 <%= (@is_in_course == 1 || @course_activity == 1) ? 'ml10' : '' %>">
|
2015-09-10 17:11:16 +08:00
|
|
|
<div class="NewsBannerName">编辑作业</div>
|
2015-05-20 16:49:19 +08:00
|
|
|
</div>
|
2015-06-17 17:01:03 +08:00
|
|
|
<div class="cl"></div>
|
2015-09-10 17:11:16 +08:00
|
|
|
|
|
|
|
<!-- 老师身份才可以发布作业 -->
|
2016-07-22 18:20:11 +08:00
|
|
|
<div class="HomeWork mb10 ml10" nhname='homework_common_form'>
|
2015-09-10 17:11:16 +08:00
|
|
|
<%= form_for @homework do |f| %>
|
2015-09-19 10:45:42 +08:00
|
|
|
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
2015-11-04 10:45:02 +08:00
|
|
|
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
2015-09-10 17:11:16 +08:00
|
|
|
<div id="HomeWorkCon">
|
|
|
|
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
|
|
|
|
</div>
|
|
|
|
<% end%>
|
|
|
|
</div><!----HomeWork end-->
|