Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
hjm 5 years ago
commit 8ba0999c15

@ -13,7 +13,7 @@ class CoursesController < ApplicationController
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner]
before_action :check_account, only: [:new, :apply_to_join_course]
before_action :check_account, only: [:new, :create, :apply_to_join_course]
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :apply_to_join_course, :exit_course]
before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt,
@ -927,12 +927,12 @@ class CoursesController < ApplicationController
role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师
ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role)
teacher_role = 1
message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
else
message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
end
end
teacher_role = 1
end
if teacher_role && current_user.student_of_course?(course)

@ -113,14 +113,14 @@ class HomeworkCommonsController < ApplicationController
else
if @user_course_identity == Course::STUDENT
@work = @homework.user_work(current_user.id)
work = @homework.student_works.find_by(user_id: current_user.id)
# 学生访问列表时计算个人成绩
myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id)
if work && myshixun
challenge_settings = @homework.homework_challenge_settings
games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id))
HomeworksService.new.update_myshixun_work_score work, myshixun, games, @homework, challenge_settings
if @homework.homework_type == "practice"
myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id)
if @work && myshixun
challenge_settings = @homework.homework_challenge_settings
games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id))
HomeworksService.new.update_myshixun_work_score @work, myshixun, games, @homework, challenge_settings
end
end
# 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段

@ -3,7 +3,7 @@ class ShixunsController < ApplicationController
include ApplicationHelper
before_action :require_login, :check_auth, except: [:download_file, :index, :menus]
before_action :check_account, only: [:new, :shixun_exec]
before_action :check_account, only: [:new, :create, :shixun_exec]
before_action :check_auth, except: [:download_file, :index, :menus]

@ -1,7 +1,7 @@
class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index]
# before_action :check_auth, except: [:index]
before_action :check_account, only: [:new]
before_action :check_account, only: [:new, :create]
before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,

Loading…
Cancel
Save