设置作业对应的forge_messages表的viewed字段

This commit is contained in:
ouyangxuhua 2015-08-25 16:42:29 +08:00
parent c6b460f520
commit f56d9ed265
1 changed files with 7 additions and 0 deletions

View File

@ -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