dev_new_shixunsrepository
cxt 5 years ago
parent 41181021be
commit 8ca9339d24

@ -976,7 +976,7 @@ class HomeworkCommonsController < ApplicationController
elsif homework.max_group_end_time
homework.end_time = homework.max_group_end_time
end
homework.homework_detail_manual.update_attribute('comment_status', 1)
homework.homework_detail_manual.update_attributes!(comment_status: 1)
if homework.course_acts.size == 0
homework.course_acts << CourseActivity.new(user_id: homework.user_id, course_id: homework.course_id)
@ -1004,7 +1004,7 @@ class HomeworkCommonsController < ApplicationController
if homework.end_time > Time.now && homework.homework_detail_manual.try(:comment_status) > 1
homework.homework_detail_manual.update_attribute("comment_status", 1)
homework.homework_detail_manual.update_attributes!(comment_status: 1)
end
# 补交结束时间
@ -1071,7 +1071,7 @@ class HomeworkCommonsController < ApplicationController
homework.end_time = homework.max_group_end_time
if homework.end_time > time && homework_detail_manual.try(:comment_status) > 1
homework_detail_manual.update_attribute("comment_status", 1)
homework_detail_manual.update_attributes!(comment_status: 1)
end
# 统一设置
@ -1080,7 +1080,7 @@ class HomeworkCommonsController < ApplicationController
homework.end_time = time
end
homework_detail_manual.update_attribute("comment_status", 2) if homework.end_time <= time
homework_detail_manual.update_attributes!(comment_status: 2) if homework.end_time <= time
# 实训作业的作品需要计算是否迟交
if homework.homework_type == "practice"

@ -48,7 +48,7 @@ class PollVotesController < ApplicationController
ques_vote_id = question_answer_ids.map(&:to_i).max
ques_vote = user_votes.find_by(poll_answer_id: ques_vote_id)
if ques_vote.present?
ques_vote.update_attribute!("vote_text", question_answer_text)
ques_vote.update_attributes!(vote_text: question_answer_text)
else
answer_option = {
:user_id => current_user.id,

@ -681,7 +681,7 @@ class StudentWorksController < ApplicationController
# 申诉成功后 扣匿评学生的违规匿评扣分
sw = @homework.student_works.find_by(user_id: score.user_id)
sw.update_attribute!("appeal_penalty", @homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty) if sw.present?
sw.update_attributes!(appeal_penalty: @homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty) if sw.present?
# 申诉成功 重新计算申诉者的匿评分
if @work.student_works_scores.where("reviewer_role = 3 AND appeal_status != 3").count > 0

Loading…
Cancel
Save