老师删除作业功能

This commit is contained in:
sw 2015-05-28 14:13:47 +08:00
parent 8c6ea88504
commit 3f9855f25c
4 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
class HomeworkCommonController < ApplicationController class HomeworkCommonController < ApplicationController
layout "base_courses" layout "base_courses"
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment] before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment]
def index def index
@ -120,7 +120,11 @@ class HomeworkCommonController < ApplicationController
end end
def destroy def destroy
if @homework.destroy
respond_to do |format|
format.html {redirect_to homework_common_index_path(:course => @course.id)}
end
end
end end
#开启匿评 #开启匿评

View File

@ -26,6 +26,7 @@
</p> </p>
<% if @is_teacher%> <% if @is_teacher%>
<%= homework_anonymous_comment(homework)%> <%= homework_anonymous_comment(homework)%>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
<%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %> <%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
<% elsif @is_student%> <% elsif @is_student%>
<%= student_anonymous_comment homework %> <%= student_anonymous_comment homework %>

View File

@ -878,7 +878,6 @@ zh:
button_copy_and_follow: 复制并转到新问题 button_copy_and_follow: 复制并转到新问题
button_annotate: 追溯 button_annotate: 追溯
button_edit: 编辑
button_configure: 配置 button_configure: 配置
button_quote: 引用 button_quote: 引用
button_duplicate: 副本 button_duplicate: 副本

View File

@ -147,7 +147,6 @@ a:hover.work_edit{color: #fff; background: #64bdd9;}
.hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;} .hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
.dis{display:block; } .dis{display:block; }
.undis{display:none;} .undis{display:none;}
.c_red{ color:#de030d;}
.f_12{ font-size:12px;} .f_12{ font-size:12px;}
.w_40{ width:40px; border:1px solid red;} .w_40{ width:40px; border:1px solid red;}
.dis_ul{ height:70px; border-bottom:1px dashed #d4d4d4; margin-bottom:10px;} .dis_ul{ height:70px; border-bottom:1px dashed #d4d4d4; margin-bottom:10px;}