设置作业对应的forge_messages表的viewed字段
This commit is contained in:
parent
c6b460f520
commit
f56d9ed265
|
@ -11,6 +11,13 @@ class StudentWorkController < ApplicationController
|
|||
protect_from_forgery :except => :set_program_score
|
||||
|
||||
def index
|
||||
#设置作业对应的forge_messages表的viewed字段
|
||||
query_student_work = @homework.course_messages
|
||||
query_student_work.each do |query|
|
||||
if User.current.id == query.user_id
|
||||
query.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||
course_group = CourseGroup.find_by_id(@group) if @group
|
||||
|
|
Loading…
Reference in New Issue