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

dev_cs
caicai8 5 years ago
commit 70ccfe9bef

@ -494,7 +494,15 @@ class StudentWorksController < ApplicationController
# 删除实训作品评阅
def destroy_work_comment
ActiveRecord::Base.transaction do
@work.shixun_work_comments.find_by!(id: params[:comment_id]).destroy_all
tip_exception("visible_comment参数有误") if params[:visible_comment].blank?
comment = @work.shixun_work_comments.find_by!(id: params[:comment_id])
params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil
if comment.comment.nil? && comment.hidden_comment.nil?
comment.destroy!
else
comment.save!
end
normal_status("删除成功")
end
end

@ -39,6 +39,7 @@ if @shixun
challenge_comment = @work.shixun_work_comments.find_by(challenge_id: game.challenge_id)
json.challenge_comment challenge_comment&.comment
json.challenge_comment_hidden challenge_comment&.hidden_comment
json.comment_id challenge_comment&.id
end
end
@ -59,6 +60,7 @@ if @shixun
# 评阅信息
json.work_comment @comment&.comment
json.work_comment_hidden @user_course_identity < Course::STUDENT ? @comment&.hidden_comment : nil
json.comment_id @comment&.id
# 图形统计
# 1 效率

Loading…
Cancel
Save