|
|
@ -113,6 +113,15 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if @user_course_identity == Course::STUDENT
|
|
|
|
if @user_course_identity == Course::STUDENT
|
|
|
|
@work = @homework.user_work(current_user.id)
|
|
|
|
@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
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段
|
|
|
|
# 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段
|
|
|
|
if @work&.work_status.to_i > 0 && (@homework.work_public || @homework.score_open) &&
|
|
|
|
if @work&.work_status.to_i > 0 && (@homework.work_public || @homework.score_open) &&
|
|
|
|