diff --git a/app/services/shixuns_service.rb b/app/services/shixuns_service.rb index f4842076..69bbc431 100644 --- a/app/services/shixuns_service.rb +++ b/app/services/shixuns_service.rb @@ -128,9 +128,9 @@ class ShixunsService manager = current_user.manager_of_shixun?(dis, current_user) game_url = if manager - challenge_id = dis.challenges.where(position: d.position).pluck(:id).first - game_identifier = Game.where(user_id: current_user, - challenge_id: challenge_id).pluck(:identifier).first + position = d.position.nil? ? 1 : d.position + game_identifier = Game.find_by_sql("SELECT g.identifier FROM games g JOIN challenges c on g.challenge_id = c.id + WHERE c.shixun_id = #{dis.id} AND c.position = #{position} AND g.user_id = #{d.user_id}").first.try(:identifier) "/tasks/#{game_identifier}" else "" diff --git a/app/views/layouts/pdf.html.erb b/app/views/layouts/pdf.html.erb index 23e1f238..b20f1c15 100644 --- a/app/views/layouts/pdf.html.erb +++ b/app/views/layouts/pdf.html.erb @@ -10,13 +10,12 @@ <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common','educoder/edu-main','educoder/edu-all', 'css/edu-public', 'css/font-awesome', 'css/edu-class', 'css/magic-check'%> - <%#= javascript_heads %> - <%= javascript_include_tag "edu/application",'educoder/edu_application'%> + <%= javascript_heads %> + <%= javascript_include_tag "edu/application", 'educoder/edu_application'%> -
+
图形统计
diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js
index 7bde1298..250cf16b 100644
--- a/public/react/src/modules/comment/Comments.js
+++ b/public/react/src/modules/comment/Comments.js
@@ -277,6 +277,12 @@ class Comments extends Component {
{item.time}
{ item.position && [第{item.position}关] }
+ { item.game_url ?
+ 违规评论已被屏蔽!