diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index fef1198d..2537c465 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -508,7 +508,7 @@ class StudentWorkController < ApplicationController end @tab = params[:tab].nil? ? 1 : params[:tab].to_i - if User.current.member_of_course?(@homework.course) && params[:order].nil? && params[:sort].nil? && params[:name].nil? && params[:group].nil? && params[:page].nil? + if (User.current.member_of_course?(@homework.course) || User.current.admin?) && params[:order].nil? && params[:sort].nil? && params[:name].nil? && params[:group].nil? && params[:page].nil? if !@course.is_end && @homework.homework_type == 4 && @homework.homework_detail_manual.comment_status > 0 && (@homework.end_time > Time.now || (@homework.end_time <= Time.now && @homework.allow_late)) update_shixun_work_status @homework end diff --git a/db/migrate/20190314080805_create_shixun_student_works.rb b/db/migrate/20190314080805_create_shixun_student_works.rb index b4a606ba..2fd9ae18 100644 --- a/db/migrate/20190314080805_create_shixun_student_works.rb +++ b/db/migrate/20190314080805_create_shixun_student_works.rb @@ -81,6 +81,8 @@ class CreateShixunStudentWorks < ActiveRecord::Migration end end work.update_column("myshixun_id", myshixun.id) + else + work.update_attributes(:myshixun_id => 0) end end end