dev_cs
cxt 5 years ago
parent 3d9287815d
commit 0a2bf3f79c

@ -478,16 +478,15 @@ class StudentWorksController < ApplicationController
ActiveRecord::Base.transaction do
challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank?
if challenge.present?
comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) ||
@comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) ||
ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: challenge.id)
else
comment = @work.shixun_work_comments.find_by(challenge_id: 0) ||
@comment = @work.shixun_work_comments.find_by(challenge_id: 0) ||
ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: 0)
end
comment.comment = params[:comment]
comment.hidden_comment = params[:hidden_comment]
comment.save!
normal_status("评阅成功")
@comment.comment = params[:comment]
@comment.hidden_comment = params[:hidden_comment]
@comment.save!
end
end

@ -0,0 +1,3 @@
json.comment_id @comment.id
json.status 0
json.message "评阅成功"
Loading…
Cancel
Save