dev_forum
cxt 6 years ago
parent c71da9b6ae
commit 3c5133bcb8

@ -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
# 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段

Loading…
Cancel
Save