|
|
|
@ -108,7 +108,13 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|
|
|
|
|
|
if @work.destroy
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html {
|
|
|
|
|
redirect_to student_work_index_url(:homework => @homework.id)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#添加评分,已评分则为修改评分
|
|
|
|
@ -226,9 +232,9 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#判断是不是当前作品的提交者
|
|
|
|
|
#提交者可以编辑作品
|
|
|
|
|
#提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品
|
|
|
|
|
def author_of_work
|
|
|
|
|
# render_403 unless User.current.id == @work.user_id && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
|
|
|
|
|
render_403 unless User.current.id == @work.user_id && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#根据条件过滤作业结果
|
|
|
|
|